SMSGatewaySerializer

class apirest.sms_gateway_serializers.SMSGatewaySerializer(instance=None, data=None, files=None, context=None, partial=False, many=False, allow_add_remove=False, **kwargs)

Create:

CURL Usage:

curl -u username:password --dump-header - -H "Content-Type:application/json" -X POST --data '{"name": "My_Gateway", "description": "", "addprefix": "", "removeprefix": "", "gateways": "user/,user", "gateway_codecs": "PCMA,PCMU", "gateway_timeouts": "10,10", "gateway_retries": "2,1"}' http://localhost:8000/rest-api/gateway/

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
Allow: GET, POST, HEAD, OPTIONS

Read:

CURL Usage:

curl -u username:password -H 'Accept: application/json' http://localhost:8000/rest-api/gateway/

curl -u username:password -H 'Accept: application/json' http://localhost:8000/rest-api/gateway/%gateway-id%/

Response:

{
    "count": 1,
    "next": null,
    "previous": null,
    "results": [
        {
            "url": "http://127.0.0.1:8000/rest-api/gateway/1/",
            "name": "Default_Gateway",
            "status": 1,
            "description": "",
            "addprefix": "",
            "removeprefix": "",
            "gateways": "user/,user",
            "gateway_codecs": "PCMA,PCMU",
            "gateway_timeouts": "10,10",
            "gateway_retries": "2,1",
            "originate_dial_string": "",
            "secondused": null,
            "created_date": "2011-06-15T00:28:52",
            "updated_date": "2013-06-14T17:54:24.130",
            "failover": null,
            "addparameter": "",
            "count_call": 1,
            "count_in_use": null,
            "maximum_call": null
        }
    ]
}