API Developer

API REST Nanomid Player

Using the API

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.

Send a playlist

Method: POST
Content type: application/json
Header: X-Api-Key: <your key>

Endpoint

https://nanomid.com/api/Partner/PlayList

Payload example

{ "licence": "CODICE_LICENZA", "title": "Sample List", "url": "https://example.com/list.m3u" }

POST /api/Partner/PlayList

FieldTypeRequiredDescription
licenceStringYesThe licence code, as shown in the dashboard. It must be one of your licences.
titleStringYesPlaylist name, 3 to 25 characters.
urlStringYesPlaylist 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.

Response codes

CodeDescription
200Playlist added: the response contains title, key (identifies the playlist), source, createdAt and hiddenInfo
400licence missing, or title or url not valid
401X-Api-Key missing, wrong, regenerated or deleted
404No licence with that code among yours
410Licence expired
429Too many requests: retry after the seconds given in Retry-After
500Server error (very rare)

With too many requests the response is 429: retry after the seconds given in Retry-After.

Request example

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"}'