Retrieve email contents
Retrieving a Content List
The GET {subdomain}.api.numberly.com/v1/contents endpoint retrieves a paginated collection of content available on your account. This method is ideal for catalog synchronization or displaying selection lists in a third-party interface.
Query Parameters
| Parameter | Type | Description | Default |
|---|---|---|---|
limit | Integer | Maximum number of items to return (max 20). | 10 |
page | Integer | Current page number. | 1 |
Request Example
curl -X GET "https://{subdomain}.api.numberly.com/v1/contents?limit=10&page=1" \
-H "Authorization: Bearer <VOTRE_ACCESS_TOKEN>" \
-H "Content-Type: application/json"
Response Example
The API returns a JSON object containing an objects array, as well as pagination metadata.
{
"objects": [
{
"id": 101,
"name": "Campagne Soldes Hiver",
"content": "<html><body><h1>Soldes!</h1></body></html>",
"type": "html",
"usage": "email",
"group_id": "65df06372b43d70716133716",
"created_at": "2023-12-01T10:00:00Z"
},
{
"id": 102,
"name": "Newsletter Janvier",
"content": "<html><body><h1>Actus</h1></body></html>",
"type": "html",
"usage": "email",
"group_id": "65df06372b43d70716133716",
"created_at": "2024-01-15T09:30:00Z"
}
],
"metadata": {
"timestamp": 1744375392.0
},
"pagination": {
"total": 50,
"limit": 10,
"page": 1
}
}
Retrieving a Single Content
To obtain full details of specific content, including its raw HTML code for direct integration, use the GET {subdomain}.api.numberly.com/v1/contents/{content_id} endpoint.
Path Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
content_id | String | Yes | The unique identifier of the content. |
Request Example
curl -X GET "https://{subdomain}.api.numberly.com/v1/contents/101" \
-H "Authorization: Bearer <VOTRE_ACCESS_TOKEN>" \
-H "Content-Type: application/json"
Response Example
The response body contains the complete Content object. The HTML code is found in the content property.
{
"id": 101,
"name": "Campagne Soldes Hiver",
"content": "<!DOCTYPE html><html><head><title>Soldes</title></head><body><div>Contenu HTML complet...</div></body></html>",
"type": "html",
"usage": "email",
"group_id": "65df06372b43d70716133716",
"created_at": "2023-12-01T10:00:00Z"
}
Error Handling
In case of retrieval failure (e.g., if the ID does not exist), the API will return a standardized error code.
- 404 Not Found: The requested resource does not exist.
- 401 Unauthorized: The authentication token is missing or invalid.
- 403 Forbidden: You do not have the necessary permissions to access this content.
Example 404 error response:
{
"errors": [
{
"code": "NOT_FOUND",
"message": "Content not found."
}
],
"metadata": {
"timestamp": 1742294105
}
}
Create an email content
The NMP (Numberly Martech Platform) enables the automation of email content creation via its API. This technical guide details the process of creating HTML content, managing hosted images, and integrating this content into your campaigns.
Create a campaign
This technical guide details the process for programmatically creating and managing campaigns via the Numberly Martech Platform (NMP) API. It covers retrieving prerequisites and creating campaigns (Email and SMS).