Lists
Create, delete, and view lists. Use lists to store groups of contacts.
POST List
https://api.app.message2give.com/2019-01-23/organisations/{workspace_id}/listsAuthentication Required: Yes
Description
Creates an empty list that you can store contacts in.
Note: this endpoint only works with token authentication.
Path Parameters
| Property | Description |
|---|---|
| workspace_id | The ID of the workspace to create the list in. |
Body Properties
| Property | Required | Type | Default | Description |
|---|---|---|---|---|
| name | Yes | String | The display name of the list. |
Code Snippet
DELETE List
https://api.app.message2give.com/2019-01-23/organisations/{workspace_id}/lists/{list_id}Authentication Required: Yes
Description
Deletes the nominated list and all of its items.
Note: this endpoint only works with token authentication.
Path Parameters
| Property | Description |
|---|---|
| workspace_id | The ID of the workspace the list belongs to. |
| list_id | The ID of the list being deleted. |
Code Snippet
GET Lists
https://api.app.message2give.com/2019-01-23/organisations/{workspace_id}/listsAuthentication Required: Yes
Description
Retrieves an array of all the lists in your workspace. It includes the lists' ID and name.
Note: this endpoint only works with token authentication.
Path Parameters
| Property | Description |
|---|---|
| workspace_id | The ID of the workspace to retrieve lists from. |
{
"lists": [
{
"id": "1234",
"name": "My First List",
},
{
"id": "5678",
"name": "My Second List",
}
]
}Code Snippet
GET List
https://api.app.message2give.com/2019-01-23/organisations/{workspace_id}/lists/{list_id}Authentication Required: Yes
Description
Retrieves details about a list in your workspace.
Path Parameters
| Property | Description |
|---|---|
| workspace_id | The ID of the workspace the list belongs to. |
| list_id | The ID of the list being retrieved. |
{
"lists" : [
{
"created" : "2022-06-01T02:03:22.198Z",
"id" : "list_12345678",
"name" : "Test List"
}
],
"status" : "OK"
}Code Snippet
GET List Items
https://api.app.message2give.com/2019-01-23/organisations/{workspace_id}/lists/{list_id}/items?offset={offset}&limit={limit}Authentication Required: Yes
Description
Retrieves an array of the items in a nominated list.
Path Parameters
| Property | Description |
|---|---|
| workspace_id | The ID of the workspace the list belongs to. |
| list_id | The ID of the list being retrieved. |
Query Parameters
-
offset*: location in the list where the response will start. E.g. 40 will return the list items starting at the 40th item. Used for pagination
-
limit*: number of list items to return. Used for pagination.
{
"items": [
{
"key": "example.email@domain.com"
"created": "2021-07-29T02:32:00.701Z",
"type": "email",
},
{
"key": "61400000000"
"created": "2021-07-29T02:32:00.701Z",
"type": "pstn",
},
...
],
"moreItems": true
}Code Snippet
POST List Items
https://api.app.message2give.com/2019-01-23/organisations/{workspace_id}/lists/{list_id}/itemsAuthentication Required: No
Description
Create/Delete Items in a List. This endpoint supports bulk creation/deletion of key:value pairs.
Path Parameters
-
workspace_id: the ID of your workspace.
-
list_id: the ID of the list you are editing.
Body Properties
-
put: an array of objects. Each object details an item to add to the list.
-
key*: the contact you are storing in the list. Must be a Valid Message2Give Destination.
-
type*: the contact type - "pstn" (phone), or "email" (Email).
-
see the code snippet for an example.
-
-
delete: as above, but will delete the item from the list instead. The request will be rejected if the contact is not in the list.
Code Snippet
How is this guide?