All URIs are relative to https://api.sendx.io/api/v1/rest
Method | HTTP request | Description |
---|---|---|
createList | POST /list | Create List |
deleteList | DELETE /list/{listId} | Delete List |
getAllLists | GET /list | Get All Lists |
getListById | GET /list/{listId} | Get List |
updateList | PUT /list/{listId} | Update List |
CreateResponse createList(listRequest)
Create List
Create a new list.
import sendx from 'sendx-javascript-sdk';
let defaultClient = sendx.ApiClient.instance;
// Configure API key authorization: apiKeyAuth
let apiKeyAuth = defaultClient.authentications['apiKeyAuth'];
apiKeyAuth.apiKey = 'YOUR API KEY';
// Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null)
//apiKeyAuth.apiKeyPrefix = 'Token';
let apiInstance = new sendx.ListApi();
let listRequest = new sendx.ListRequest(); // ListRequest |
apiInstance.createList(listRequest).then((data) => {
console.log('API called successfully. Returned data: ' + data);
}, (error) => {
console.error(error);
});
Name | Type | Description | Notes |
---|---|---|---|
listRequest | ListRequest |
- Content-Type: application/json
- Accept: application/json
DeleteResponse deleteList(listId)
Delete List
Deletes a specific list by its ID.
import sendx from 'sendx-javascript-sdk';
let defaultClient = sendx.ApiClient.instance;
// Configure API key authorization: apiKeyAuth
let apiKeyAuth = defaultClient.authentications['apiKeyAuth'];
apiKeyAuth.apiKey = 'YOUR API KEY';
// Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null)
//apiKeyAuth.apiKeyPrefix = 'Token';
let apiInstance = new sendx.ListApi();
let listId = "sendx123"; // String | The ID of the list you want to delete
apiInstance.deleteList(listId).then((data) => {
console.log('API called successfully. Returned data: ' + data);
}, (error) => {
console.error(error);
});
Name | Type | Description | Notes |
---|---|---|---|
listId | String | The ID of the list you want to delete |
- Content-Type: Not defined
- Accept: application/json
[ListModel] getAllLists(opts)
Get All Lists
Retrieve all lists for the account.
import sendx from 'sendx-javascript-sdk';
let defaultClient = sendx.ApiClient.instance;
// Configure API key authorization: apiKeyAuth
let apiKeyAuth = defaultClient.authentications['apiKeyAuth'];
apiKeyAuth.apiKey = 'YOUR API KEY';
// Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null)
//apiKeyAuth.apiKeyPrefix = 'Token';
let apiInstance = new sendx.ListApi();
let opts = {
'offset': 0, // Number | Offset for pagination.
'limit': 10, // Number | Limit the number of results returned.
'search': "Marketing" // String | Search term to filter lists.
};
apiInstance.getAllLists(opts).then((data) => {
console.log('API called successfully. Returned data: ' + data);
}, (error) => {
console.error(error);
});
Name | Type | Description | Notes |
---|---|---|---|
offset | Number | Offset for pagination. | [optional] |
limit | Number | Limit the number of results returned. | [optional] |
search | String | Search term to filter lists. | [optional] |
- Content-Type: Not defined
- Accept: application/json
ListModel getListById(listId)
Get List
Retrieve a specific list by its ID.
import sendx from 'sendx-javascript-sdk';
let defaultClient = sendx.ApiClient.instance;
// Configure API key authorization: apiKeyAuth
let apiKeyAuth = defaultClient.authentications['apiKeyAuth'];
apiKeyAuth.apiKey = 'YOUR API KEY';
// Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null)
//apiKeyAuth.apiKeyPrefix = 'Token';
let apiInstance = new sendx.ListApi();
let listId = "sendx123"; // String | The ID of the list you want to retrieve
apiInstance.getListById(listId).then((data) => {
console.log('API called successfully. Returned data: ' + data);
}, (error) => {
console.error(error);
});
Name | Type | Description | Notes |
---|---|---|---|
listId | String | The ID of the list you want to retrieve |
- Content-Type: Not defined
- Accept: application/json
Response updateList(listRequest, listId)
Update List
Update an existing list by its ID.
import sendx from 'sendx-javascript-sdk';
let defaultClient = sendx.ApiClient.instance;
// Configure API key authorization: apiKeyAuth
let apiKeyAuth = defaultClient.authentications['apiKeyAuth'];
apiKeyAuth.apiKey = 'YOUR API KEY';
// Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null)
//apiKeyAuth.apiKeyPrefix = 'Token';
let apiInstance = new sendx.ListApi();
let listRequest = new sendx.ListRequest(); // ListRequest |
let listId = "listId_example"; // String | The ID of the list to be updated.
apiInstance.updateList(listRequest, listId).then((data) => {
console.log('API called successfully. Returned data: ' + data);
}, (error) => {
console.error(error);
});
Name | Type | Description | Notes |
---|---|---|---|
listRequest | ListRequest | ||
listId | String | The ID of the list to be updated. |
- Content-Type: application/json
- Accept: application/json