Opt-ins
Retrieving Opt-ins
The GET endpoint allows you to list all available opt-ins for a group, with the option to filter by communication channel.
Technical Definition
- HTTP Method:
GET - Endpoint:
{subdomain}.api.numberly.com/v1/settings/groups/{id}/optins - Security: Bearer Token (OAuth2)
Parameters
| Location | Name | Required | Type | Description |
|---|---|---|---|---|
| Path | id | Yes | string | The group identifier (e.g., 65df0637...). |
| Query | channel | No | string | Filter by channel (email, sms, push_notification). |
| Query | limit | No | integer | Pagination: number of items per page (default: 20). |
| Query | page | No | integer | Pagination: page number (default: 1). |
Request Example
This example retrieves consents for the SMS channel within the specified group.
curl -X GET "https://{subdomain}.api.numberly.com/v1/settings/groups/65df06372b43d70716133716/optins?channel=sms" \
-H "Authorization: Bearer <VOTRE_TOKEN>" \
-H "Content-Type: application/json"
Response Structure
The response contains a list of Optin objects. The key element to retrieve is the id, which will serve as a reference in your campaign creations.
{
"objects": [
{
"id": 945,
"name": "Consentement SMS Marketing",
"channel": "sms",
"group_id": "65df06372b43d70716133716"
},
{
"id": 946,
"name": "Consentement Alertes SMS",
"channel": "sms",
"group_id": "65df06372b43d70716133716"
}
],
"metadata": {
"timestamp": 1744375392.0
},
"pagination": {
"total": 2,
"limit": 20,
"page": 1
}
}
STOP Mentions
Creating SMS Marketing campaigns via the NMP API necessitates compliance with legal opt-out regulations. This requires the mandatory inclusion of a 'STOP' mention at the end of the message. Unlike a simple string manually appended to the text, the NMP API treats these mentions as independent resources. To create a valid SMS campaign, you must retrieve the identifier (id) of the 'STOP' mention configured for your group and inject it into the creation payload.
Targeting procedures
The GET endpoint retrieves the comprehensive list of targeting procedures available for an organization (group). These definitions contain the necessary metadata (fields, types, options) to dynamically build the user interface or the campaign creation payload.