List users
Allows to recover all users
HTTP request
GET https://api.sarbacane.com/v1/teams/{teamId}
Header parameters
Parameter | Description | Required |
---|---|---|
accountID | Account ID | yes |
apiKey | API key | yes |
URL parameters
Parameter | Description | Required |
---|---|---|
offset | Start position | false |
limit | Maximum number of returned elements - Max: 100 000 | false |
search | Filter users by name or email | false |
desc | Descendant sorting by users creation date - Possible values : true or false | false |
Errors
HTML Code | Error message | Description |
---|---|---|
401 | NEED_ACCOUNT_ID | No account ID is specified in the request |
401 | NEED_API_KEY | No API key is specified in the request |
400 | API_KEY_UNAUTHORIZED | Invalid API key |
404 | SERVICE_*_UNREACHABLE | The requested service is unavailable |
500 | INTERNAL_SERVER_ERROR | Internal error, please contact support |
HTTP Authentication
curl -X GET "https://api.sarbacane.com/v1/users?offset=0&limit=2&desc=true&search=user"
-u "YOUR_ACCOUNTID:YOUR_API_KEY"
HTTP Headers Authentication
curl -X GET "https://api.sarbacane.com/v1/users?offset=0&limit=2&desc=true&search=user"
-H "accountId: YOUR_ACCOUNTID"
-H "apiKey: YOUR_API_KEY"
HTTP success response code
HTTP/2 200
Response body
{
"users": [
{
"userId": "54fez56f4ez65fez465fez4e",
"email": "user1@email.com",
"firstName": "Firstname",
"lastName": "Lastname",
"type": "OWNER",
"groupId": "re4g984eg89r4g894fez984a",
"validated": true
}
],
"invitations": [
{
"email": "user2@email.com",
"firstName": "Firstname",
"lastName": "Lastname",
"type": "USER",
"groupId": "",
"validated": false
}
]
}
Invite a user
Invite a user to your account
HTTP request
POST https://api.sarbacane.com/v1/users/invite
Header parameters
Parameter | Description | Required |
---|---|---|
accountID | Account ID | yes |
apiKey | API key | yes |
Body Parameters
Parameter | Description | Required |
---|---|---|
firstname | User firstname | yes |
lastname | User lastname | yes |
User email | yes | |
role | User role, possible values : "USER" or "ADMIN" | yes |
teamId | Team id to link with the user (only if role is "USER") | no |
Errors
HTML Code | Error message | Description |
---|---|---|
401 | NEED_ACCOUNT_ID | No account ID is specified in the request |
401 | NEED_API_KEY | No API key is specified in the request |
400 | API_KEY_UNAUTHORIZED | Invalid API key |
404 | SERVICE_*_UNREACHABLE | The requested service is unavailable |
500 | INTERNAL_SERVER_ERROR | Internal error, please contact support |
HTTP Authentication
curl -X POST "https://api.sarbacane.com/v1/users/invite"
-u "YOUR_ACCOUNTID:YOUR_API_KEY"
-d '{"teamId":"576244e06cc68528289e0b0d","firstname":"john","lastname":"doe","email":"john@doe.com","role":"USER"}'
HTTP Headers Authentication
curl -X POST "https://api.sarbacane.com/v1/users/invite"
-H "accountId: YOUR_ACCOUNTID"
-H "apiKey: YOUR_API_KEY"
-d '{"teamId":"576244e06cc68528289e0b0d","firstname":"john","lastname":"doe","email":"john@doe.com","role":"USER"}'
HTTP success response code
HTTP/2 200
Delete users or invitations
Delete users or invitations linked to your account
HTTP request
DELETE https://api.sarbacane.com/v1/users
Header parameters
Parameter | Description | Required |
---|---|---|
accountID | Account ID | yes |
apiKey | API key | yes |
Body Parameters
Parameter | Description | Required |
---|---|---|
invitations | Array containing invited emails to delete | no |
userIds | Array containing user ids to delete | no |
Errors
HTML Code | Error message | Description |
---|---|---|
401 | NEED_ACCOUNT_ID | No account ID is specified in the request |
401 | NEED_API_KEY | No API key is specified in the request |
400 | API_KEY_UNAUTHORIZED | Invalid API key |
404 | SERVICE_*_UNREACHABLE | The requested service is unavailable |
500 | INTERNAL_SERVER_ERROR | Internal error, please contact support |
HTTP Authentication
curl -X DELETE "https://api.sarbacane.com/v1/users"
-u "YOUR_ACCOUNTID:YOUR_API_KEY"
-d '{"invitations":["john@doe.com"],"userIds":["9cee994b1836fe00018126b4"]}'
HTTP Headers Authentication
curl -X DELETE "https://api.sarbacane.com/v1/users"
-H "accountId: YOUR_ACCOUNTID"
-H "apiKey: YOUR_API_KEY"
-d '{"invitations":["john@doe.com"],"userIds":["9cee994b1836fe00018126b4"]}'
HTTP success response code
HTTP/2 200
Update user rights
Update user rights.
HTTP request
PUT https://api.sarbacane.com/v1/users/{userId}/rights
Header parameters
Parameter | Description | Required |
---|---|---|
accountID | Account ID | yes |
apiKey | API key | yes |
Body Parameters
Parameter | Description | Required |
---|---|---|
send_campaigns | Right to send campaigns | false |
export_contacts | Right to export contacts | false |
teams_visibility | Right to share resources to other teams of the same account | false |
send_tests | Right to send tests | false |
transfer_templates | Right to transfer templates to other accounts | false |
URL parameters
Parameter | Description | Required |
---|---|---|
userId | User id | yes |
Errors
HTML Code | Error message | Description |
---|---|---|
400 | USER_IS_ADMIN | Unable to update admin rights |
400 | INVALID_BODY | Invalid body |
401 | NEED_ACCOUNT_ID | No account ID is specified in the request |
401 | NEED_API_KEY | No API key is specified in the request |
400 | API_KEY_UNAUTHORIZED | Invalid API key |
404 | USER_NOT_FOUND | User doesn't exist |
500 | INTERNAL_SERVER_ERROR | Internal error, please contact support |
HTTP Authentication
curl -X PUT "https://api.sarbacane.com/v1/users/{userId}/rights"
-u "YOUR_ACCOUNTID:YOUR_API_KEY"
-d '{"send_campaigns": true, "export_contacts": true, "teams_visibility": true, "send_tests": true, "transfer_templates": true}'
HTTP Headers Authentication
curl -X PUT "https://api.sarbacane.com/v1/users/{userId}/rights"
-H "accountId: YOUR_ACCOUNTID"
-H "apiKey: YOUR_API_KEY"
-d '{"send_campaigns": true, "export_contacts": true, "teams_visibility": true, "send_tests": true, "transfer_templates": true}'
HTTP success response code
HTTP/2 200
Get user rights
Get all user rights
HTTP request
GET https://api.sarbacane.com/v1/users/{userId}/rights
Header parameters
Parameter | Description | Required |
---|---|---|
accountID | Account ID | yes |
apiKey | API key | yes |
URL parameters
Parameter | Description | Required |
---|---|---|
userId | User id | yes |
Errors
HTML Code | Error message | Description |
---|---|---|
401 | NEED_ACCOUNT_ID | No account ID is specified in the request |
401 | NEED_API_KEY | No API key is specified in the request |
400 | API_KEY_UNAUTHORIZED | Invalid API key |
404 | SERVICE_*_UNREACHABLE | The requested service is unavailable |
500 | INTERNAL_SERVER_ERROR | Internal error, please contact support |
HTTP Authentication
curl -X GET "https://api.sarbacane.com/v1/users/{userId}/rights"
-u "YOUR_ACCOUNTID:YOUR_API_KEY"
HTTP Headers Authentication
curl -X GET "https://api.sarbacane.com/v1/users/{userId}/rights"
-H "accountId: YOUR_ACCOUNTID"
-H "apiKey: YOUR_API_KEY"
HTTP success response code
HTTP/2 200
Response body
{
"rights": {
"export_contacts": true,
"send_campaigns": true,
"send_tests": true,
"teams_visibility": true,
"transfer_templates": true
}
}
Update a user
Update a user role or team
HTTP request
PUT https://api.sarbacane.com/v1/users/{userId}/role
Header parameters
Parameter | Description | Required |
---|---|---|
accountID | Account ID | yes |
apiKey | API key | yes |
Body Parameters
Parameter | Description | Required |
---|---|---|
role | User role, possible values : "USER" or "ADMIN" | yes |
teamId | Team id to link with the user (only if role is "USER") | no |
URL parameters
Parameter | Description | Required |
---|---|---|
userId | User id | yes |
Errors
HTML Code | Error message | Description |
---|---|---|
401 | NEED_ACCOUNT_ID | No account ID is specified in the request |
401 | NEED_API_KEY | No API key is specified in the request |
400 | API_KEY_UNAUTHORIZED | Invalid API key |
404 | SERVICE_*_UNREACHABLE | The requested service is unavailable |
500 | INTERNAL_SERVER_ERROR | Internal error, please contact support |
HTTP Authentication
curl -X PUT "https://api.sarbacane.com/v1/users/{userId}/role"
-u "YOUR_ACCOUNTID:YOUR_API_KEY"
-d '{"role":"ADMIN","teamId":"4dee994b1836fe00018126b4"}'
HTTP Headers Authentication
curl -X PUT "https://api.sarbacane.com/v1/users/{userId}/role"
-H "accountId: YOUR_ACCOUNTID"
-H "apiKey: YOUR_API_KEY"
-d '{"role":"ADMIN","teamId":"4dee994b1836fe00018126b4"}'
HTTP success response code
HTTP/2 200
Get a team
Get a team
HTTP request
GET https://api.sarbacane.com/v1/teams/{teamId}
Header parameters
Parameter | Description | Required |
---|---|---|
accountID | Account ID | yes |
apiKey | API key | yes |
URL parameters
Parameter | Description | Required |
---|---|---|
teamID | Team id | yes |
Errors
HTML Code | Error message | Description |
---|---|---|
401 | NEED_ACCOUNT_ID | No account ID is specified in the request |
401 | NEED_API_KEY | No API key is specified in the request |
400 | API_KEY_UNAUTHORIZED | Invalid API key |
404 | SERVICE_*_UNREACHABLE | The requested service is unavailable |
500 | INTERNAL_SERVER_ERROR | Internal error, please contact support |
HTTP Authentication
curl -X GET "https://api.sarbacane.com/v1/teams/{teamId}"
-u "YOUR_ACCOUNTID:YOUR_API_KEY"
HTTP Headers Authentication
curl -X GET "https://api.sarbacane.com/v1/teams/{teamId}"
-H "accountId: YOUR_ACCOUNTID"
-H "apiKey: YOUR_API_KEY"
HTTP success response code
HTTP/2 200
Response body
{
"team": {
"id": "7eee994b1836fe00018126b3",
"accountId": "6953a148b85b537094a0515de",
"name": "Default team",
"users": [
"606744e06cc68528289e0b00",
"2382e26b6cc6852828d47a4e"
],
"creationDate": "2017-08-22T15:39:56Z"
}
}
Create a team
Create a new team related to your account
HTTP request
POST https://api.sarbacane.com/v1/teams
Header parameters
Parameter | Description | Required |
---|---|---|
accountID | Account ID | yes |
apiKey | API key | yes |
Body Parameters
Parameter | Description | Required |
---|---|---|
name | Team name | yes |
Errors
HTML Code | Error message | Description |
---|---|---|
401 | NEED_ACCOUNT_ID | No account ID is 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 error, please contact support |
HTTP Authentication
curl -X POST "https://api.sarbacane.com/v1/teams"
-u "YOUR_ACCOUNTID:YOUR_API_KEY"
-d '{"name":"TEAN_NAME"}'
HTTP Headers Authentication
curl -X POST "https://api.sarbacane.com/v1/teams"
-H "accountId: YOUR_ACCOUNTID"
-H "apiKey: YOUR_API_KEY"
-d '{"name":"TEAN_NAME"}'
HTTP success response code
HTTP/2 200
List teams
Get all teams linked to your account
HTTP request
GET https://api.sarbacane.com.com/v1/teams
Header parameters
Parameter | Description | Required |
---|---|---|
accountID | Account id | yes |
apiKey | API key | yes |
URL parameters
Parameter | Description | Required |
---|---|---|
offset | Start position | false |
limit | Maximum number of returned elements - Max: 100 000 | false |
search | Filter teams by name | false |
desc | Descendant sorting by teams creation date - Possible values : true or false | false |
Errors
HTML Code | Error message | Description |
---|---|---|
401 | NEED_ACCOUNT_ID | No account ID is 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 error, please contact support |
HTTP Authentication
curl -X GET "https://api.sarbacane.com/v1/teams?offset=0&limit=2&desc=true&search=team"
-u "YOUR_ACCOUNTID:YOUR_API_KEY"
HTTP Headers Authentication
curl -X GET "https://api.sarbacane.com/v1/teams?offset=0&limit=2&desc=true&search=team"
-H "accountId: YOUR_ACCOUNTID"
-H "apiKey: YOUR_API_KEY"
HTTP success response code
HTTP/2 200
Response body
{
"teams": [
{
"id": "6eee994b1836fe00018126e2",
"accountId": "6953a148b85b537094a0512d",
"name": "Default team",
"users": [
"777744e06cc68528289e0b0d",
"88882e26b6cc6852828d47a4d"
],
"creationDate": "2017-08-22T15:39:56Z"
},
{
"id": "7d02496a6bffc901012ecd5d",
"accountId": "2953a148b85b537094a0515d",
"name": "The best team",
"creationDate": "2017-08-23T15:39:56Z"
}
]
}
Update team users
Update team users.
HTTP request
PUT https://api.sarbacane.com/v1/teams/{teamId}/users/team
Header parameters
Parameter | Description | Required |
---|---|---|
accountId | Account id | Yes |
apiKey | API key | yes |
Body Parameters
Parameter | Description | Required |
---|---|---|
userIds | Array containing user ids | yes |
URL parameters
Parameter | Description | Required |
---|---|---|
teamId | Team id | yes |
Errors
HTML Code | Error message | Description |
---|---|---|
401 | NEED_ACCOUNT_ID | No account ID is specified in the request |
400 | 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 error, please contact support |
HTTP Authentication
curl -X PUT "https://api.sarbacane.com/v1/teams/{teamId}/users/team"
-u "YOUR_ACCOUNTID:YOUR_API_KEY"
-d '{"userIds":["576744e06cc68528289e0b0e"]}'E
HTTP Headers Authentication
curl -X PUT "https://api.sarbacane.com/v1/teams/{teamId}/users/team"
-H "accountId: YOUR_ACCOUNTID"
-H "apiKey: YOUR_API_KEY"
-d '{"userIds":["576744e06cc68528289e0b0e"]}'
HTTP success response code
HTTP/2 200
Update team name
Update team name.
HTTP request
PUT https://api.sarbacane.com/v1/teams/{teamId}
Header parameters
Parameter | Description | Required |
---|---|---|
accountID | Account ID | yes |
apiKey | API key | yes |
Body Parameters
Parameter | Description | Required |
---|---|---|
name | Team name | yes |
URL parameters
Parameter | Description | Required |
---|---|---|
teamID | Team id | yes |
Errors
HTML Code | Error message | Description |
---|---|---|
401 | NEED_ACCOUNT_ID | No account ID is 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 error, please contact support |
HTTP Authentication
curl -X PUT "https://api.sarbacane.com/v1/teams/{teamId}"
-u "YOUR_ACCOUNTID:YOUR_API_KEY"
-d '{"name":"TEAM_NAME"}'
HTTP Headers Authentication
curl -X PUT "https://api.sarbacane.com/v1/teams/{teamId}"
-H "accountId: YOUR_ACCOUNTID"
-H "apiKey: YOUR_API_KEY"
-d '{"name":"TEAM_NAME"}'
HTTP success response code
HTTP/2 200
Delete a team
Delete a team.
HTTP request
DELETE https://api.sarbacane.com/v1/teams/{teamId}
Header parameters
Parameter | Description | Required |
---|---|---|
accountID | Account id | yes |
apiKEY | API key | yes |
URL parameters
Parameter | Description | Required |
---|---|---|
teamId | Team id | yes |
Errors
HTML Code | Error message | Description |
---|---|---|
401 | NEED_ACCOUNT_ID | No account ID is 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 error, please contact support |
HTTP Authentication
curl -X DELETE "https://api.sarbacane.com/v1/teams/{teamId}"
-u "YOUR_ACCOUNTID:YOUR_API_KEY"E
HTTP Headers Authentication
curl -X DELETE "https://api.sarbacane.com/v1/teams/{teamId}"
-H "accountId: YOUR_ACCOUNTID"
-H "apiKey: YOUR_API_KEY"
HTTP success response code
HTTP/2 200
Update team invitations
Update team invitations.
HTTP request
PUT https://api.sarbacane.com/v1/teams/{teamId}/invitations/team
Header parameters
Parameter | Description | Required |
---|---|---|
accountId | Account id | yes |
apiKey | Team id | yes |
Body Parameters
Parameter | Description | Required |
---|---|---|
invitations | Array containing email addresses to send invitation | yes |
URL parameters
Parameter | Description | Required |
---|---|---|
teamId | Team id | yes |
Errors
HTML Code | Error message | Description |
---|---|---|
401 | NEED_ACCOUNT_ID | No account ID is 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 error, please contact support |
HTTP Authentication
curl -X PUT "https://api.sarbacane.com/v1/teams/{teamId}/invitations/team"
-u "YOUR_ACCOUNTID:YOUR_API_KEY"
-d '{"invitations":["johndoe@johndoe.com"]}'
HTTP Headers Authentication
curl -X PUT "https://api.sarbacane.com/v1/teams/{teamId}/invitations/team"
-H "accountId: YOUR_ACCOUNTID"
-H "apiKey: YOUR_API_KEY"
-d '{"invitations":["johndoe@johndoe.com"]}'
HTTP success response code
HTTP/2 200
Get credits limits
Get credits limits
HTTP request
GET https://api.sarbacane.com/v1/teams/{teamId}/creditLimits
Header parameters
Parameter | Description | Required |
---|---|---|
accountID | Account id | yes |
apiKey | API key | yes |
URL parameters
Parameter | Description | Required |
---|---|---|
teamId | Team id | yes |
Errors
HTML Code | Error message | Description |
---|---|---|
401 | NEED_ACCOUNT_ID | No account ID is 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 error, please contact support |
HTTP Authentication
curl -X GET "https://api.sarbacane.com/v1/teams/{teamId}/creditLimits"
-u "YOUR_ACCOUNTID:YOUR_API_KEY"
HTTP Headers Authentication
curl -X GET "https://api.sarbacane.com/v1/teams/{teamId}/creditLimits"
-H "accountId: YOUR_ACCOUNTID"
-H "apiKey: YOUR_API_KEY"
HTTP success response code
HTTP/2 200
Response body
{
"creditLimits": [
{
"creditType": "EMAIL",
"count": 10000,
"period": "MONTH"
},
{
"creditType": "SMS",
"count": 12500,
"period": "YEAR"
}
]
}
Update credits limits
Update credits limits of a team.
HTTP request
PUT https://api.sarbacane.com/v1/teams/{teamId}/creditLimits
Header parameters
Parameter | Description | Required |
---|---|---|
accountId | Account id | yes |
apiKey | API key | yes |
Body Parameters
Parameter | Description | Required |
---|---|---|
creditLimits | Array containing Json data as credit limit. The Json parameters "creditType", "count" and "period" are explained below | true |
creditType | Parameter of a Json item from creditLimits array, credit type, possible values : "EMAIL" or "SMS" | true |
count | Parameter of a Json item from creditLimits array, numerical value as credit limit | true |
period | Parameter of a Json item from creditLimits array, limit period, possible values : "MONTH" or "YEAR" | true |
URL parameters
Parameter | Description | Required |
---|---|---|
teamId | Team id | yes |
Errors
HTML Code | Error message | Description |
---|---|---|
401 | NEED_ACCOUNT_ID | No account ID is 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 error, please contact support |
HTTP Authentication
curl -X PUT "https://api.sarbacane.com/v1/teams/{teamId}/creditLimits"
-u "YOUR_ACCOUNTID:YOUR_API_KEY"
-d '{"creditLimits":[{"creditType":"EMAIL","count":100,"period":"MONTH"},{"creditType":"SMS","count":200,"period":"YEAR"}]}'E
HTTP Headers Authentication
curl -X PUT "https://api.sarbacane.com/v1/teams/{teamId}/creditLimits"
-H "accountId: YOUR_ACCOUNTID"
-H "apiKey: YOUR_API_KEY"
-d '{"creditLimits":[{"creditType":"EMAIL","count":100,"period":"MONTH"},{"creditType":"SMS","count":200,"period":"YEAR"}]}'
HTTP success response code
HTTP/2 200
Delete credits limits
Delete all credits limits of a team.
HTTP request
DELETE https://api.sarbacane.com/v1/teams/{teamId}/creditLimits
Header parameters
Parameter | Description | Required |
---|---|---|
accountID | Account id | yes |
apiKey | API key | yes |
URL parameters
Parameter | Description | Required |
---|---|---|
teamId | Team id | yes |
Errors
HTML Code | Error message | Description |
---|---|---|
401 | NEED_ACCOUNT_ID | No account ID is 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 error, please contact support |
HTTP Authentication
curl -X DELETE "https://api.sarbacane.com/v1/teams/{teamId}/creditLimits"
-u "YOUR_ACCOUNTID:YOUR_API_KEY"
HTTP Headers Authentication
curl -X DELETE "https://api.sarbacane.com/v1/teams/{teamId}/creditLimits"
-H "accountId: YOUR_ACCOUNTID"
-H "apiKey: YOUR_API_KEY"
HTTP success response code
HTTP/2 200
List credit use
List users or teams credit use
HTTP request
POST https://sarbacaneapis.com/v1/settings/transactions/search
Header parameters
Parameter | Description | Required |
---|---|---|
accountID | Accound id | yes |
apiKey | API Key | yes |
Body Parameters
Parameter | Description | Required |
---|---|---|
sort | Json containing "orderBy" and "asc" parameters explained below | yes |
sort.orderBy | Credit use order, possible values : "TRANSACTION_DATE", "USER_NAME", "TEAM_NAME" and "CREDITS" | yes |
sort.asc | Ascendant or descendant sorting, possible values : true or false | yes |
filter | Json containing "minDate", "maxDate", "range", "search", "users", "teamIds", "includeTags" and "excludeTags" parameters explained below | yes |
filter.minDate | Start date filter (Date ISO: 2019-04-25T08:31:43.280Z) | yes |
filter.maxDate | End date filter (Date ISO: 2019-04-25T08:31:43.280Z) | yes |
filter.range | Json containing "origin" and "length" parameters explained below | yes |
filter.range.origin | First item index - Min: 0 | yes |
filter.range.length | Maximum number of returned elements - Max: 10 000 | yes |
filter.users | Array containing user ids, the search is done by users or but teamsIds, one of those is required | yes |
filter.teamIds | Array containing team ids, the search is done by users or but teamsIds, one of those is required | yes |
filter.includeTags | Array containing tags to include in the search, possible values : "EMAIL", "SMS", "TRANSACTIONAL" (Automatic campaigns and "TEST". A tag must not be included and excluded at the same time. Default value : all tags are included. | no |
filter.excludeTags | Array containing tags to exclude in the search, possible values : "EMAIL", "SMS", "TRANSACTIONAL" (Automatic campaigns and "TEST". A tag must not be included and excluded at the same time. Default value : no tag is excluded. | no |
filter.search | Search for a campaign name or automatic campaign name message which contains the input string value | no |
HTTP Authentication
curl -X POST "https://sarbacaneapis.com/v1/settings/transactions/search"
-u "YOUR_ACCOUNTID:YOUR_API_KEY"
-d '{"sort":{"orderBy":"TRANSACTION_DATE","asc":false},"filter":{"minDate":"2019-01-01T23:00:00.000Z","maxDate":"2020-01-01T22:59:59.999Z","range":{"origin":0,"length":100},"search":"Campaign name","users":["V6UDRB2TRVKnCxwDqdQgrg","W6UDRB2TRVKnCxwDqdQgrw"],"teamIds":[],"includeTags":["EMAIL","TEST"],"excludeTags":["TRANSACTIONAL","SMS"]}}'
HTTP Headers Authentication
curl -X POST "https://sarbacaneapis.com/v1/settings/transactions/search"
-H "accountId: YOUR_ACCOUNTID"
-H "apiKey: YOUR_API_KEY"
-d '{"sort":{"orderBy":"TRANSACTION_DATE","asc":false},"filter":{"minDate":"2019-01-01T23:00:00.000Z","maxDate":"2020-01-01T22:59:59.999Z","range":{"origin":0,"length":100},"search":"Campaign name","users":["V6UDRB2TRVKnCxwDqdQgrg","W6UDRB2TRVKnCxwDqdQgrw"],"teamIds":[],"includeTags":["EMAIL","TEST"],"excludeTags":["TRANSACTIONAL","SMS"]}}'
HTTP success response code
HTTP/2 200
Response body
{
"totalEmailConsumption": 1,
"totalSmsConsumption": 1,
"count": 1,
"transactions": [
{
"accountId": "A6UdRB2TRVKnCxwDqdQgra",
"userId": "W6UDRB2TRVKnCxwDqdQgrw",
"campaignId": "C6UdRB2TRVKnCxwDqdQgrc",
"type": "ROUTING",
"date": "2019-12-23T11:14:18.331Z",
"username": "John Doe",
"creditType": "EMAIL",
"credits": -1,
"creditsLeft": 50896,
"campaignName": "Campaign Name",
"tags": [
"TEST",
"EMAIL"
]
},
{
"accountId": "A6UdRB2TRVKnCxwDqdQgra",
"userId": "W6UDRB2TRVKnCxwDqdQgrw",
"campaignId": "d6UdRB2TRVKnCxwDqdQgrc",
"type": "ROUTING",
"date": "2019-12-23T11:14:17.331Z",
"username": "John Doe",
"creditType": "SMS",
"credits": -1,
"creditsLeft": 20896,
"campaignName": "SMS Campaign Name",
"tags": [
"TEST",
"SMS"
]
}
]
}