DNCContactSerializer

class apirest.dnc_contact_serializers.DNCContactSerializer(instance=None, data=<class rest_framework.fields.empty>, **kwargs)

Create:

CURL Usage:

curl -u username:password --dump-header - -H "Content-Type:application/json" -X POST --data '{"phone_number": "12345", "dnc": "/rest-api/dnc-list/1/"}' http://HOSTNAME_IP/rest-api/dnc-contact/

Response:

HTTP/1.0 201 CREATED
Date: Fri, 14 Jun 2013 09:52:27 GMT
Server: WSGIServer/0.1 Python/2.7.3
Vary: Accept, Accept-Language, Cookie
Content-Type: application/json; charset=utf-8
Content-Language: en-us
Location: http://HOSTNAME_IP/rest-api/dnc_contact/1/
Allow: GET, POST, HEAD, OPTIONS

Read:

CURL Usage:

curl -u username:password -H 'Accept: application/json' http://HOSTNAME_IP/rest-api/dnc-contact/

Response:

{
    "count": 1,
    "next": null,
    "previous": null,
    "results": [
        {
            "url": "http://HOSTNAME_IP/rest-api/dnc-contact/1/",
            "dnc": "http://HOSTNAME_IP/rest-api/dnc-list/1/",
            "phone_number": "12345"
        }
    ]
}

Update:

CURL Usage:

curl -u username:password --dump-header - -H "Content-Type: application/json" -X PUT --data '{"phone_number": "54353432"}' http://HOSTNAME_IP/rest-api/dnc-contact/%dnc-contact-id%/

Response:

HTTP/1.0 202 NO CONTENT
Date: Fri, 23 Sep 2011 06:46:12 GMT
Server: WSGIServer/0.1 Python/2.7.1+
Vary: Accept-Language, Cookie
Content-Length: 0
Content-Type: text/html; charset=utf-8
Content-Language: en-us
get_fields(*args, **kwargs)

filter survey field