Websand Partner API Docs

Websand Partner API Documentation

This is documentation for Websand partners.  

Websand partners are typically agencies or platform providers that have a Websand instance that is directly connected to their data source. This allows them to sell Websand (email marketing and marketing automation) as a service to their customers with minimal fuss.  

Using this API you will be able to create and remove Websand users for your partner account.  

If you are looking for the standard API document  please click here.

If you are a business platform or agency and want more information on how to join our growing list of Websand partners, please get in touch and let's start the conversation.


REST based API

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

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

Authentication is handled via a HTTP Token authentication header  -  "Authorization: Token {YOUR-API-KEY}"

This documentation is for the creation of new Websand accounts through our business partners and is generic in nature.  

Individual API specifications for the payload are defined for each individual Websand partner. 


Creating New Customers

POST:   https://{customer-subdomain}.websandhq.com/api/data/customers

Posting to this end point will create a new Websand account for a specific partner.  For example, a new Websand customer from the Shopblocks APP store.  When successful, this call will create a new Websand user based around the 'partner' data structure and data feed.  

Therefore for the end user, the process of creating a new Websand instance complete with a data flow will be a simple and painless process.

Pre-requisites

It requires a Websand partner account to be created and have Subuser permissions.  If you don't have one, please get in touch.

Endpoint -  https://{customer-subdomain}.websandhq.com/api/data/customers - to be used by the partner to send API requests to create new Websand accounts (creating partner sub-accounts).

Requests should be made to the partner (parent) user's subdomain using the partner (parent) user's API token.

A successful request will return a response with a 201 HTTP status code and will include the login URL for the created customer account.

Parameters:

merchant_id:string
merchant_name:string
customer_email:string
customer_name:string	
registered_at:datetime

Here's an example request:

curl -H "Authorization: Token {YOUR-API-KEY}" -H 'Content-Type: application/json' -X POST -d '{"merchant_id":"abc123def", "merchant_name":"Bob's Meat Shop","customer_name":"Bob McBoberson","customer_email":"bob@example.com"}'

https://{customer-subdomain}.websandhq.com/api/data/customers

Successful response body will look like this:

{"customer_url":"http://bob-s-meat-shop.websandhq.com","created":"ok","invite_email_sent_to":"bob@example.com","status":201}

Deleting Customers

If a partner is selling or promoting Websand through an APP store or simply connected to an existing 'partner' e-commerce or business system.  Then when a user decides to cancel their agreement with the partner, or even decide to cancel the Websand service through a partner 'APP' store, this post will freeze their Websand account.   Hopefully this will be a rarely used call. 

DELETE  https://{customer-subdomain}.websandhq.com/api/data/customers


Pre-requisites

It requires a Websand partner account to be created, be active and have Subuser permissions. 

Please use the endpoint  https://{customer-subdomain}.websandhq.com/api/data/customers when sending requests to deleting user accounts.

As above, requests to delete an account should be made to the parent account's subdomain using the parent account's API token.

No data is immediately deleted however the account will be marked as inactive and send permissions will be revoked.  We (Websand) will then contact the customer to confirm the process, and advise them of their options.

Parameters:

merchant_id:string

Example request:

curl -H "Authorization: Token {YOUR-API-KEY}" -H 'Content-Type: application/json' -X DELETE -d '{"merchant_id":"abc123def"}' 
<a href="https://{customer-subdomain}.websandhq.com/api/data/customers">https://{customer-subdomain}.websandhq.com/api/data/customers</a>

Successful response body:

{"status":200,"message":"ok"}

Payload API calls

Once a Websand user is all set up, the payload API is used to send customer data from your business platform into Websand.  This will be unique to your requirements as defined by our partnership.  

For an example, please refer to the Payload API call document for an example of a Payload call from an e-commerce platform.

POST https://{customer-account}.websandhq.com/api/data/transaction


For more information on payload specific requirements please refer to Transactional API and Subscriber API 


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. 

Still need help? Contact Us Contact Us