Numberly
Content

Retrieve email contents

This technical guide details the methods for programmatically retrieving HTML content resources stored on the Numberly Martech Platform (NMP). The API provides access to this content either via a paginated list or individually using a specific identifier.

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

ParameterTypeDescriptionDefault
limitIntegerMaximum number of items to return (max 20).10
pageIntegerCurrent 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

ParameterTypeRequiredDescription
content_idStringYesThe 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
  }
}