DID API¶
-
DIDSerializer
¶ DID API to view and create new DIDs.
Create:
CURL Usage:
curl -u username:password --dump-header - -H "Content-Type:application/json" -X POST --data '{"did_number": "300112344", "user": "/rest-api/users/1/", "campaign": "/rest-api/campaigns/94/"}' http://HOSTNAME_IP/rest-api/did/
Response:
HTTP/1.0 201 Created Date: Wed, 29 Jul 2020 16:04:58 GMT Server: WSGIServer/0.1 Python/2.7.15rc1 Content-Length: 279 Content-Language: en Vary: Accept, Accept-Language, Cookie Location: http://127.0.0.1:8000/rest-api/did/4/ Allow: GET, POST, HEAD, OPTIONS X-Frame-Options: SAMEORIGIN Content-Type: application/json {"url":"http://127.0.0.1:8000/rest-api/did/4/","did_number":"300112344","created_date":"2020-07-29T18:04:57.951292+02:00","updated_date":"2020-07-29T18:04:57.951354+02:00","user":"http://127.0.0.1:8000/rest-api/users/1/","campaign":"http://127.0.0.1:8000/rest-api/campaigns/94/"}
Read:
CURL Usage:
curl -u username:password -H 'Accept: application/json' http://HOSTNAME_IP/rest-api/did/
Response:
{ "count": 2, "next": null, "previous": null, "results": [ { "url":"http://127.0.0.1:8000/rest-api/did/1/", "did_number":"804445454", "created_date":"2018-09-05T17:13:01.123429+02:00", "updated_date":"2018-09-05T17:18:48.055658+02:00", "user":"http://127.0.0.1:8000/rest-api/users/1/", "campaign":null }, { "url":"http://127.0.0.1:8000/rest-api/did/2/", "did_number":"55555555500", "created_date":"2020-07-29T17:58:01.953773+02:00", "updated_date":"2020-07-29T17:58:01.953798+02:00", "user":"http://127.0.0.1:8000/rest-api/users/2/", "campaign":"http://127.0.0.1:8000/rest-api/campaigns/94/" } ] }