Skip to content

Websand Subscriber API

Connecting your subscriber data to Websand

Use the Websand subscriber API to connect your subscriber data from your website or application directly into Websand.

Once connected, the data will flow. Updating or add subscribers to your marketing audience, with contacts updated into the relevant segments.

If the contact is added to a segment which is a part of an automation, they’ll be receiving a marketing message. That’s the right message, at the right time to the right person. That’s how data driven marketing works in Websand.

Websand Subscriber API Documentation

Using this document

This document provides details on using the Websand API. That is feeding data from your platform or business system directly into Websand in an automated fashion.

You will need to have a Websand account set up before you start the API process, signup for a trial here

If you are using an existing established e-commerce platform we probably already have an API in place (or planned) so please get in touch.

If you are looking to connect your own bespoke data or platform, please book a call. We’d love to help.

REST API

The Websand API is an HTTPS interface with endpoints for specific actions.

The API follows REST conventions by using HTTPS verbs equivalent to the request type – requests to delete resources use the DELETE HTTPS verb, resource creation requests use the POST verb etc.

Authentication is handled via a HTTPS Token authentication header which can be generated from your Websand instance from the Account Settings Page.

"Authorization: Token {YOUR-API-KEY}"

General Data Endpoints:

Websand has two API endpoints you can use.

The subscriber endpoint which accepts non transactional customer data – i.e. a list of people.

The transactional endpoint accepts customer transactional data (events and the people those events relate to).   Click here for more details on the Transactional API

Subscriber Endpoint

The subscriber endpoint which accepts non transactional customer data – i.e. a list of people.  This is your traditional email list or sign up data.

Each endpoint is unique to each account, you can find the Subscriber endpoint from the Endpoint menu.

POST  https://v4wbsd.com/{{your_websand_endpoint_path}}

Example:  
POST https://v4wbsd.com/ep/a5dacf21-fae1-43fb-bc14-2e68037f5870

Receives customer subscriber data in JSON format for processing and indexing and requires authentication. 

This is not transactional data, typically people that have signed up without purchasing anything.

The API supports custom additional fields, which can be included in the request as required by the customer.  An example of the minimal request body is below.  This is the MINIMAL REQUEST.

{
  "email": "kellykristmas@northpole.org",
  "source": "santa groto",
  "first": "Kelly",
  "subscribed_at": "2023-06-13T00:00:00.000Z"
}

The full field listing is featured below.

 ({accountId, payload}) => {
  return {
    accountId, 
    email: payload.email,

   event: {
      event: "profile",
      customer: {
        updatedsource: payload.source,
        firstname: payload.first,
        lastname: payload.lastname,
        address: payload.address,
        street:payload.street,
        city: payload.city,
        zip: payload.postcode,
        country: payload.country,
        company: payload.company,
        jobtitle: payload.jobtitle,    
        sector: payload.sector,
        status: payload.status,
        abandoncarturl: payload.abandoncarturl,
        field1: payload.f1,  // non specified field //
        field2: payload.f2,  // non specified field //
        field3: payload.f3,  // non specified field //
        interest: payload.interest,
        tags: payload.tags,  
        lastupdated: new Date( payload.subscribed_at || new Date() )
      }
    }
  }
}

For payload testing, please use the Endpoint page for the Subscriber endpoint.

In this feature, you can test example payloads to make sure everything works perfectly before you move into the code.

Endpoint settings page within Websand

Notes when using the API

submit_datetime is the timestamp used for any date-range processing in the WebsandHQ system and is ISO 8601 format.

Any (including custom) properties in the  customer container are merged with the persistent customer profiles upon import.  The newer data supersedes older data.

Access the API key for the account from the Account Settings Page (see below).

Websand account settings page access api key

Response Statuses

2xx responses

2xx responses indicate successful requests.  The beautiful #200’s, it’s all good.

4xx responses

4xx responses indicate issues with request data/authentication – response body should include specific error message(s) to help you go all Sherlock and figure out the issue.  Something wrong at your side – get in touch and let’s see how we can help.

5xx responses

5xx responses indicate server-side issues. OMG. Something wrong at our side – please raise the alarm and let us know.

Need help with the API

If you need more help using the Websand API, or further help with your email marketing or data strategy. We’d love to help so please get in touch.

Email support@websand.co.uk or book some time on the calendar below