Endpoint

An endpoint, also known as SIP endpoint, can be any IP phone, mobile phone, wireless device or PDA, a laptop or desktop PC, that uses the Session Initiation Protocol (SIP) to perform communications operations.

The following actions can be performed using the Endpoint API:

BaseURI: https://api.plivo.com/v1/Account/{auth_id}/Endpoint/

Retrieve a List of All Endpoints

  URI: https://api.plivo.com/v1/Account/{auth_id}/Endpoint/
  Method: GET

Parameters

None

Response

HTTP status: 200

JSON:
{
  meta: {
    limit: 20,
    next: null,
    offset: 0,
    previous: null,
    total_count: 1
  },
  objects: [
    {
      alias: "plivotest",
      endpoint_id: "19712437976554",
      password: "eb0a191797624dd3a48fa681d3061212",
      resource_uri: "/v1/Account/MAC4NMQ3YJVHYJM0N2Y1/Endpoint/19712437976554/",
      sip_uri: "sip:mandarin@phone.plivo.com",
      username: "mandarin"
    },
  ]
}
>

Create an Endpoint

  URI: https://api.plivo.com/v1/Account/{auth_id}/Endpoint/
  Method: POST

Parameters

The following parameters are required to create a SIP endpoint:

Required Parameters

Parameter Description
username The username for the endpoint to be created.
password The password for your endpoint username.
alias Alias for this endpoint

Optional Parameters

The following optional parameters can be specified when playing sounds during a call:

Parameter Description
app_id The app_id of the application that is to be attached to this endpoint. If this is not provided the default_endpoint_app is attached to this endpoint.

Response

HTTP status: 201

JSON:
{
'username': 'abcdmn131031145958', 
'alias': 'abcd', 
'message': 'created', 
'endpoint_id': '37371860103666', 
'api_id': '1c13de4c-423d-11e3-9899-22000abfa5d5'
}

Get Details of a Particular Endpoint

  URI: https://api.plivo.com/v1/Account/{auth_id}/Endpoint/{endpoint_id}/
  Method: GET

Parameters

None

Response

HTTP status: 200

JSON:
{
  alias: "plivotest",
  endpoint_id: "19712437976554",
  password: "eb0a191797624dd3a48fa681d3061212",
  resource_uri: "/v1/Account/MAC4NMQ3YJVHYJM0N2Y1/Endpoint/19712437976554/",
  sip_uri: "sip:mandarin@phone.plivo.com",
  username: "mandarin"
}

Get Details of All Endpoints

  URI: https://api.plivo.com/v1/Account/{auth_id}/Endpoint/
  Method: GET

Parameters

None

Response

HTTP status: 200

JSON:
{
  "username":"mandarin",
  "application":"/v1/Account/MAODQ0YZG2ZTRJMWMZNJ/Application/32156873357358339/",
  "sip_uri":"sip:mandarin@phone.plivo.com",
  "alias":"plivotest",
  "endpoint_id":"10341720475150",
  "password": "eb0a191797624dd3a48fa681d3061212",
  "resource_uri":"/v1/Account/MAC4NMQ3YJVHYJM0N2Y1/Endpoint/19712437976554/"
}

Modify an Endpoint

  URI: https://api.plivo.com/v1/Account/{auth_id}/Endpoint/{endpoint_id}/
  Method: POST

Parameters

There are no mandatory parameters required for this API. The following optional parameters can be specified when modifying an endpoint:

Optional Parameters

Parameter Description
password The password for your endpoint username.
alias Alias for this endpoint
app_id The app_id of the application that is to be attached to this endpoint. If app_id is not specified, then the endpoint does not point to any application.

Response

HTTP status: 202

JSON:
{
  "message": "changed",
  "api_id": "d8f9ea6c-58cc-11e1-86da-adf28403fe48"
}

Delete an Endpoint

  URI: https://api.plivo.com/v1/Account/{auth_id}/Endpoint/{endpoint_id}/
  Method: DELETE

Parameters

None

Response

HTTP Status: 204

Asynchronous Mode

All Plivo APIs can be invoked in asynchronous mode with the inclusion of the callback_url parameter. Note: In asynchronous mode, you will only get back a response with the api_id. The response is sent to the callback_url which is fired immediately after execution of the Plivo API. See API Request and API Response for more information.

Asynchronous Parameters

Parameter Description
callback_url The URL that is notified by the API when the response is available and to which the response is sent.
callback_method The method used to notify the callback_url URL. Defaults to POST.

Asynchronous Response

The Asynchronous Response is sent in json format in the response field.

See the API Response section for more information.