The API is reserved for resellers: your management system can add a playlist to one of your licences. You need an API key, which you create in Settings → API key, and it only works for the licences on your account.
HTTPS is mandatory. Nanomid only responds to encrypted traffic so your data stays safe.
Keep the key on your server, never in an app or a web page. If you think someone knows it, regenerate it from Settings → API key: the old one stops working immediately.
Method: POST
Content type: application/json
Header: X-Api-Key: <your key>
Endpoint
https://nanomid.com/api/Partner/PlayList{
"licence": "CODICE_LICENZA",
"title": "Sample List",
"url": "https://example.com/list.m3u"
}| Field | Type | Required | Description |
|---|---|---|---|
| licence | String | Yes | The licence code, as shown in the dashboard. It must be one of your licences. |
| title | String | Yes | Playlist name, 3 to 25 characters. |
| url | String | Yes | Playlist address, http or https. |
Playlist information is always hidden from customers. If a device is already using the licence, it receives the playlist right away or at its next check; otherwise it receives it when the code is entered.
| Code | Description |
|---|---|
| 200 | Playlist added: the response contains title, key (identifies the playlist), source, createdAt and hiddenInfo |
| 400 | licence missing, or title or url not valid |
| 401 | X-Api-Key missing, wrong, regenerated or deleted |
| 404 | No licence with that code among yours |
| 410 | Licence expired |
| 429 | Too many requests: retry after the seconds given in Retry-After |
| 500 | Server error (very rare) |
With too many requests the response is 429: retry after the seconds given in Retry-After.
curl -X POST "https://nanomid.com/api/Partner/PlayList" \
-H "X-Api-Key: nmk_..." \
-H "Content-Type: application/json" \
-d '{"licence":"CODICE_LICENZA","title":"Sample List","url":"https://example.com/list.m3u"}'