Import recipients

Allows you to import recipients in a campaign

HTTP request

POST

https://sarbacaneapis.com/v1/campaigns/{campaignId}/recipients

Header parameters

Parameter Description Required
accountId Account Id Yes
apiKey Api key Yes

URL parameters

Parameter Description Required
campaignId Campaign Id Yes

Errors

HTML Code Error message Description
401 NEED_ACCOUNT_ID No account ID specified in request
401 NEED_API_KEY No API key is specified in the request
401 API_KEY_UNAUTHORIZED Invalid API key
404 SERVICE_*_UNREACHABLE The requested service is unavailable
500 FAILED TO ACQUIRE LOCK Target in use by another resource
500 INTERNAL_SERVER_ERROR Internal service error, please contact support

HTTP authentication

Copied !

curl -X POST "https://sarbacaneapis.com/v1/campaigns/{campaignId}/recipients"
  -u "YOUR_ACCOUNTID:YOUR_API_KEY"
  -d '[ { "email": "user1@domain.com", "phone": "+33600000001"}, { "email": "user2@domain.com", "phone": "+33600000002" } ]'

HTTP header authentication

Copied !

curl -X POST "https://sarbacaneapis.com/v1/campaigns/{campaignId}/recipients"
  -H "accountId: YOUR_ACCOUNTID"
  -H "apiKey: YOUR_API_KEY"
  -d '[ { "email": "user1@domain.com", "phone": "+33600000001"}, { "email": "user2@domain.com", "phone": "+33600000002" } ]'

HTTP success response code

Copied !
HTTP/2 200

Response

Copied !

[
    {
        "email": "user1@domain.com",
        "phone": "+33600000001"
    },
    {
        "email": "user2@domain.com",
        "phone": "+33600000002"
    }
]

List campaigns

Allows you to list all campaigns

HTTP request

GET

https://sarbacaneapis.com/v1/campaigns

Header parameters

Parameter Description Required
accountId Account Id Yes
apiKey Api key Yes

URL parameters

Parameter Description Required
offset starting position No
limit Maximum items retrieved No
search Search text in name or subject of campaigns No
state Search campaigns by status (ENUM : DRAFT, FINISH, ROUTING or MODERATION) No

Errors

HTML Code Error message Description
400 INVALID_CAMPAIGNS_LIST_STATE Invalid state, you are filtering on a state that does not exist. Should be part of this enumeration : DRAFT, FINISH, ROUTING or MODERATION
401 NEED_ACCOUNT_ID No account ID specified in the request
401 NEED_API_KEY No API key is specified in the request
401 API_KEY_UNAUTHORIZED Invalid API key
404 SERVICE_*_UNREACHABLE The requested service is unavailable
500 INTERNAL_SERVER_ERROR Internal server error, please contact us

HTTP Authentification

Copied !
curl -X GET "https://sarbacaneapis.com/v1/campaigns?offset=0&limit=2&search=campaign&state=DRAFT"
  -u "YOUR_ACCOUNTID:YOUR_API_KEY"

HTTP HEADER Authentification

Copied !
curl -X GET "https://sarbacaneapis.com/v1/campaigns?offset=0&limit=2&search=campaign&state=DRAFT"
  -H "accountId: YOUR_ACCOUNTID"
  -H "apiKey: YOUR_API_KEY"

HTTP success code

Copied !
HTTP/2 200

Response

Copied !

[
    {
        "count": 1827,
        "created": "2017-09-22T15:02:31Z",
        "edited": "2017-09-25T15:25:28Z",
        "id": "zqb26jJXSnywtCcX1Cj_HA",
        "kind": "SMS",
        "name": "SMS campaign"
    },
    {
        "count": 195668,
        "created": "2017-09-25T15:50:30Z",
        "edited": "2017-09-26T10:11:35Z",
        "id": "TEsK2AHJS-agbfdc-iDctQ",
        "kind": "NORMAL",
        "name": "E-mail 200k contacts"
    }
]

Create an email campaign

Allows to create an email campaign

HTTP request

POST

https://sarbacaneapis.com/v1/campaigns/email

Header parameters

Parameter Description Required
accountId Account Id Yes
apiKey Api Key Yes

Body Parameters

Parameter Description Required
name Name of campaign Yes
emailFrom Sending email address Yes
aliasFrom Sender name Yes
emailReplyTo Reply email address Yes
aliasReplyTo Sender name of the reply Yes
subject Subject of the email Yes
preheader Preheader of the email No
teams An array of group IDs associated with the campaign No

Errors

HTML Code Error message Description
401 NEED_ACCOUNT_ID No account ID specified in the request
401 NEED_API_KEY No API key is specified in the request
401 API_KEY_UNAUTHORIZED Invalid API key
404 SERVICE_*_UNREACHABLE The requested service is unavailable
500 INTERNAL_SERVER_ERROR Internal server error, please contact us

HTTP Authentification

Copied !

curl -X POST "https://sarbacaneapis.com/v1/campaigns/email"
  -u "YOUR_ACCOUNTID:YOUR_API_KEY"
  -d '{
    "name": "Name",
    "emailFrom": "contact@email.com",
    "aliasFrom": "From",
    "emailReplyTo": "contact@email.com",
    "aliasReplyTo": "Reply To",
    "subject": "Subject",
    "preheader": "Preheader"
  }'

HTTP HEADER Authentification

Copied !

curl -X POST "https://sarbacaneapis.com/v1/campaigns/email"
  -H "accountId: YOUR_ACCOUNTID"
  -H "apiKey: YOUR_API_KEY"
  -d '{
    "name": "Name",
    "emailFrom": "contact@email.com",
    "aliasFrom": "From",
    "emailReplyTo": "contact@email.com",
    "aliasReplyTo": "Reply To",
    "subject": "Subject",
    "preheader": "Preheader"
  }'

HTTP success code

Copied !
HTTP/2 200

Response

Copied !

{
    "id":"kRzJCozIR1-U4F-r971haQ",
    "name":"Name"
}

Create a SMS campaign

Allows you to create a SMS campaign

HTTP request

POST

https://sarbacaneapis.com/v1/campaigns/sms

Header parameters

Parameter Description Required
accountId Account Id Yes
apiKey Api key Yes

Body Parameters

Parameter Description Required
name Name of the campaign Yes
kind Kind of the campaign, must be SMS_MARKETING or SMS_NOTIFICATION Yes
smsFrom Name of the SMS sender (between 3 and 11 alphanumeric characters) No
content SMS content (Max: 450 characters from the GSM table) Yes
teams An array of group ids associated with the campaign No

Errors

HTML Code Error message Description
401 NEED_ACCOUNT_ID No account ID specified in the request
401 NEED_API_KEY No API key is specified in the request
401 API_KEY_UNAUTHORIZED Invalid API key
404 SERVICE_*_UNREACHABLE The requested service is unavailable
500 INTERNAL_SERVER_ERROR Internal server error, please contact us

HTTP Authentification

Copied !

curl -X POST "https://sarbacaneapis.com/v1/campaigns/sms"
  -u "YOUR_ACCOUNTID:YOUR_API_KEY"
  -d '{
    "name": "Name",
    "kind": "SMS_NOTIFICATION",
    "content": "Inscription validée !"
  }'

HTTP HEADER Authentification

Copied !

curl -X POST "https://sarbacaneapis.com/v1/campaigns/sms"
  -H "accountId: YOUR_ACCOUNTID"
  -H "apiKey: YOUR_API_KEY"
  -d '{
    "name": "Name",
    "kind": "SMS_MARKETING",
    "smsFrom": "YOURCOMPANY",
    "content": "Solde: -20% dès ce soir !"
  }'

HTTP success code

Copied !
HTTP/2 200

Response

Copied !

{
    "id":"kRzJCozIR1-U4F-r971haQ",
    "name":"Name"
}

Get campaign details

Allows you to get campaign details

HTTP request

GET

https://sarbacaneapis.com/v1/campaigns/{campaignId}

Header parameters

Parameter Description Required
accountId Account Id Yes
apiKey Api key Yes

URL parameters

Parameter Description Required
campaignId Campaign ID of a specific campaign Yes

Errors

HTML Code Error message Description
401 NEED_ACCOUNT_ID No account ID specified in the request
401 NEED_API_KEY No API key is specified in the request
401 API_KEY_UNAUTHORIZED Invalid API key
404 SERVICE_*_UNREACHABLE The requested service is unavailable
500 INTERNAL_SERVER_ERROR Internal server error, please contact us

HTTP Authentification

Copied !
curl -X GET "https://sarbacaneapis.com/v1/campaigns/{campaignId}"
  -u "YOUR_ACCOUNTID:YOUR_API_KEY"

HTTP HEADER Authentification

Copied !
curl -X GET "https://sarbacaneapis.com/v1/campaigns/{campaignId}"
  -H "accountId: YOUR_ACCOUNTID"
  -H "apiKey: YOUR_API_KEY"

HTTP success code

Copied !
HTTP/2 200

Response

Copied !


{
    "campaign": {
        "blacklists": [
            "DEFAULT_BLACKLIST"
        ],
        "id": "kRzJCozIR1-U4F-r971haQ",
        "kind": "NORMAL",
        "modificationDate": "2018-07-27T08:06:48Z",
        "name": "Name",
        "sends": [
            "PRQ-IEN8Teq1QhPAuIL1kg"
        ],
        "sentDate": "0001-01-01T00:00:00Z",
        "state": "DRAFTING",
        "tags": [
            "EMAIL"
        ],
        "unsubscription": {}
    }
}

Import list

Allows you to import contacts list to your campaign

HTTP request

POST

https://sarbacaneapis.com/v1/campaigns/{campaignId}/list

Header parameters

Parameter Description Required
accountId Account Id Yes
apiKey Api key Yes

Body Parameters

Parameter Description Required
listId List Id Yes

URL parameters

Parameter Description Required
campaignId Campaign Id Yes

Errors

HTML Code Error message Description
401 NEED_ACCOUNT_ID No account ID specified in the request
401 NEED_API_KEY No API key is specified in the request
401 API_KEY_UNAUTHORIZED Invalid API key
404 SERVICE_*_UNREACHABLE The requested service is unavailable
500 INTERNAL_SERVER_ERROR Internal server error, please contact us

HTTP Authentification

Copied !

curl -X POST "https://sarbacaneapis.com/v1/campaigns/{campaignId}/list"
  -u "YOUR_ACCOUNTID:YOUR_API_KEY"
  -d '{
    "listId": "rZskDacLS4-v4q-X2whMbP"
  }'

HTTP HEADER Authentification

Copied !

curl -X POST "https://sarbacaneapis.com/v1/campaigns/{campaignId}/list"
  -H "accountId: YOUR_ACCOUNTID"
  -H "apiKey: YOUR_API_KEY"
  -d '{
    "listId": "rZskDacLS4-v4q-X2whMbP"
  }'

HTTP success code

Copied !
HTTP/2 200

Response

Copied !

Add content

Allows you to add HTML/Text content to the specified send. You must first retrieve the sendId for the relevant send: in a STANDARD campaign there is only one sendId per campaign.

HTTP request

POST

https://sarbacaneapis.com/v1/campaigns/{campaignId}/send/{sendId}/content

Header parameters

Parameter Description Required
accountId Account Id Yes
apiKey Api key Yes

URL parameters

Parameter Description Required
campaignId Campaign Id Yes
sendId Send Id. This Id is unique for a standard campaign but can be multiple (eg : AB TESTING campaign) Yes

Errors

HTML Code Error message Description
401 NEED_ACCOUNT_ID No account ID specified in the request
401 NEED_API_KEY No API key is specified in the request
401 API_KEY_UNAUTHORIZED Invalid API key
404 SERVICE_*_UNREACHABLE The requested service is unavailable
500 INTERNAL_SERVER_ERROR Internal server error, please contact us

HTTP Authentification

Copied !

curl -X POST "https://sarbacaneapis.com/v1/campaigns/{campaignId}/send/{sendId}/content"
  -u "YOUR_ACCOUNTID:YOUR_API_KEY"
  -d '{ "html":"", "text": "text" }'
'

HTTP HEADER Authentification

Copied !

curl -X POST "https://sarbacaneapis.com/v1/campaigns/{campaignId}/send/{sendId}/content"
  -H "accountId: YOUR_ACCOUNTID"
  -H "apiKey: YOUR_API_KEY"
  -d '{ "html":"", "text": "text" }'

HTTP success code

Copied !
HTTP/2 200

Response

Copied !

Import template

Allows you to import a template in your campaign

HTTP request

POST

https://sarbacaneapis.com/v1/campaigns/{campaignId}/content

Header parameters

Parameter Description Required
accountId Account Id Yes
apiKey Api key Yes

Body Parameters

Parameter Description Required
templateId Template Id Yes

URL parameters

Parameter Description Required
campaignId Campaign Id Yes

Errors

HTML Code Error message Description
401 NEED_ACCOUNT_ID No account ID specified in the request
401 NEED_API_KEY No API key is specified in the request
401 API_KEY_UNAUTHORIZED Invalid API key
404 SERVICE_*_UNREACHABLE The requested service is unavailable
500 INTERNAL_SERVER_ERROR Internal server error, please contact us

HTTP Authentification

Copied !

curl -X POST "https://sarbacaneapis.com/v1/campaigns/{campaignId}/content"
  -u "YOUR_ACCOUNTID:YOUR_API_KEY"
  -d '{
    "templateId": "md1166aAQXOItlDLcBzyQA"
  }'

HTTP HEADER Authentification

Copied !

curl -X POST "https://sarbacaneapis.com/v1/campaigns/{campaignId}/content"
  -H "accountId: YOUR_ACCOUNTID"
  -H "apiKey: YOUR_API_KEY"
  -d '{ "templateId": "md1166aAQXOItlDLcBzyQA" }'

HTTP success code

Copied !
HTTP/2 200

Response

Copied !

List recipient’s campaign

Allow you to list recipients from a campaign

HTTP request

GET

https://sarbacaneapis.com/v1/campaigns/{campaignId}/recipients

Header parameters

Parameter Description Required
accountId Account Id Yes
apiKey Api key Yes

URL parameters

Parameter Description Required
campaignId Campaign Id Yes
offset Starting position No
limit Maximum number of elements returned - Max: 1,000 No

Errors

HTML Code Error message Description
401 NEED_ACCOUNT_ID No account ID specified in request
401 NEED_API_KEY No API key is specified in the request
401 API_KEY_UNAUTHORIZED Invalid API key
404 SERVICE_*_UNREACHABLE The requested service is unavailable
500 FAILED TO ACQUIRE LOCK Target in use by another resource
500 INTERNAL_SERVER_ERROR Internal service error, please contact support

HTTP authentication

Copied !
curl -X GET "https://sarbacaneapis.com/v1/campaigns/{campaignId}/recipients"
  -u "YOUR_ACCOUNTID:YOUR_API_KEY"

HTTP header authentication

Copied !

curl -X GET "https://sarbacaneapis.com/v1/campaigns/{campaignId}/recipients"
  -H "accountId: YOUR_ACCOUNTID"
  -H "apiKey: YOUR_API_KEY"

HTTP success response code

Copied !
HTTP/2 200

Response

Copied !

[
    {
        "id": "qYCnj6VoQA2rD9stZMJ5-Q",
        "email": "user1@domain.com",
        "phone": "+33600000001"
    },
    {
        "id": "pQLje5XpRB4zU5hwPOMR2-K",
        "email": "user2@domain.com",
        "phone": "+33600000002"
    }
]

Add campaign’s blacklist

Allows you to associate blacklists with your campaign

HTTP request

POST

https://sarbacaneapis.com/v1/campaigns/{campaignId}/blacklists

Header parameters

Parameter Description Required
accountId Account Id Yes
apiKey Api key Yes

Body Parameters

Parameter Description Required
blacklistIds An array of blacklist IDs (Array [ {}, {} ]) Yes

URL parameters

Parameter Description Required
campaignId Campaign Id Yes

Errors

HTML Code Error message Description
401 NEED_ACCOUNT_ID No account ID specified in the request
401 NEED_API_KEY No API key is specified in the request
401 API_KEY_UNAUTHORIZED Invalid API key
404 SERVICE_*_UNREACHABLE The requested service is unavailable
500 INTERNAL_SERVER_ERROR Internal server error, please contact us

HTTP Authentification

Copied !

curl -X POST "https://sarbacaneapis.com/v1/campaigns/{campaignId}/blacklists"
  -u "YOUR_ACCOUNTID:YOUR_API_KEY"
  -d '{
    "blacklistIds": [
      "rZskDacLS4-v4q-X2whMbP",
      "zRtDrmirReerskYVAz9o1A"
    ]
  }'

HTTP HEADER Authentification

Copied !

curl -X POST "https://sarbacaneapis.com/v1/campaigns/{campaignId}/blacklists"
  -H "accountId: YOUR_ACCOUNTID"
  -H "apiKey: YOUR_API_KEY"
  -d '{ "blacklistIds": [
    "rZskDacLS4-v4q-X2whMbP",
    "zRtDrmirReerskYVAz9o1A"
  ]}'

HTTP success code

Copied !

HTTP/2 200

Response

Copied !

{
  "blacklistIds": [
      "rZskDacLS4-v4q-X2whMbP",
      "zRtDrmirReerskYVAz9o1A"
  ],
}

Send campaign

Allows you to send a campaign

HTTP request

POST

https://sarbacaneapis.com/v1/campaigns/{campaignId}/send

Header parameters

Parameter Description Required
accountId Account Id Yes
apiKey Api key Yes

Body Parameters

Parameter Description Required
requestedSendDate Sending date ISO (eg: "2019-04-25T08:31:43.280Z") No

URL parameters

Parameter Description Required
campaignId Campaign Id Yes

Errors

HTML Code Error message Description
401 NEED_ACCOUNT_ID No account ID specified in the request
401 NEED_API_KEY No API key is specified in the request
401 API_KEY_UNAUTHORIZED Invalid API key
404 SERVICE_*_UNREACHABLE The requested service is unavailable
500 INTERNAL_SERVER_ERROR Internal server error, please contact us

HTTP Authentification

Copied !

curl -X POST "https://sarbacaneapis.com/v1/campaigns/{campaignId}/send"
  -u "YOUR_ACCOUNTID:YOUR_API_KEY"

HTTP HEADER Authentification

Copied !

curl -X POST "https://sarbacaneapis.com/v1/campaigns/{campaignId}/send"
  -H "accountId: YOUR_ACCOUNTID"
  -H "apiKey: YOUR_API_KEY"
  -d '{ "requestedSendDate": "2019-04-25T08:31:43.280Z" }'

HTTP success code

Copied !

HTTP/2 200

Response

Copied !

{
    "webcopy": "http://eye.sarbinteg.com/"
}

Cancel campaign

Allows you to cancel a scheduled campaign

HTTP request

POST

https://sarbacaneapis.com/v1/campaigns/{campaignId}/cancel

Header parameters

Parameter Description Required
accountId Account Id Yes
apiKey Api key Yes

URL parameters

Parameter Description Required
campaignId Campaign Id Yes

Errors

HTML Code Error message Description
401 NEED_ACCOUNT_ID No account ID specified in the request
401 NEED_API_KEY No API key is specified in the request
401 API_KEY_UNAUTHORIZED Invalid API key
404 SERVICE_*_UNREACHABLE The requested service is unavailable
500 INTERNAL_SERVER_ERROR Internal server error, please contact us

HTTP Authentification

Copied !

curl -X POST "https://sarbacaneapis.com/v1/campaigns/{campaignId}/cancel"
  -u "YOUR_ACCOUNTID:YOUR_API_KEY"

HTTP HEADER Authentification

Copied !

curl -X POST "https://sarbacaneapis.com/v1/campaigns/{campaignId}/cancel"
  -H "accountId: YOUR_ACCOUNTID"
  -H "apiKey: YOUR_API_KEY"

HTTP success code

Copied !
HTTP/2 200

Response

Copied !
ICI VOTRE CODE

Manage campaign’s teams

Allows you to manage the sharing of a campaign

HTTP request

PUT

https://sarbacaneapis.com/v1/campaigns/{campaignId}/teams

Header parameters

Parameter Description Required
accountId Account Id Yes
apiKey Api key Yes

Body Parameters

Parameter Description Required
teams An array of team ids associated with the campaign Yes

URL parameters

Parameter Description Required
campaignId Id of a specific campaign Yes

Errors

HTML Code Error message Description
401 NEED_ACCOUNT_ID No account ID specified in the request
401 NEED_API_KEY No API key is specified in the request
401 API_KEY_UNAUTHORIZED Invalid API key
404 SERVICE_*_UNREACHABLE The requested service is unavailable
500 INTERNAL_SERVER_ERROR Internal server error, please contact us

HTTP Authentification

Copied !

curl -X PUT "https://sarbacaneapis.com/v1/campaigns/{campaignId}/teams"
  -u "YOUR_ACCOUNTID:YOUR_API_KEY"
  -d '{"teams": ["9cee994b1836fe00018126b1", "9cee994b1836fe00018126b2"]}'

HTTP HEADER Authentification

Copied !

curl -X PUT "https://sarbacaneapis.com/v1/campaigns/{campaignId}/teams"
  -H "accountId: YOUR_ACCOUNTID"
  -H "apiKey: YOUR_API_KEY"
  -d '{"teams": ["9cee994b1836fe00018126b1", "9cee994b1836fe00018126b2"]}'

HTTP success code

Copied !
HTTP/2 200

Delete campaign

Allows you to delete a campaign

HTTP request

DELETE

https://sarbacaneapis.com/v1/campaigns/{campaignId}

Header parameters

Parameter Description Required
accountId Account Id Yes
apiKey Api Key Yes

URL parameters

Parameter Description Required
campaignId Campaign Id Yes

Errors

HTML Code Error message Description
401 NEED_ACCOUNT_ID No account ID specified in the request
401 NEED_API_KEY No API key is specified in the request
401 API_KEY_UNAUTHORIZED Invalid API key
404 SERVICE_*_UNREACHABLE The requested service is unavailable
500 INTERNAL_SERVER_ERROR Internal server error, please contact us

HTTP Authentification

Copied !

curl -X DELETE "https://sarbacaneapis.com/v1/campaigns/{campaignId}"
  -u "YOUR_ACCOUNTID:YOUR_API_KEY"

HTTP HEADER Authentification

Copied !

curl -X DELETE "https://sarbacaneapis.com/v1/campaigns/{campaignId}"
  -H "accountId: YOUR_ACCOUNTID"
  -H "apiKey: YOUR_API_KEY"

HTTP success code

Copied !

HTTP/2 200

Response

Copied !