Chilkat Online Tools

Swift3 / Plivo REST API / List all incoming carriers

Back to Collection Items

func chilkatTest() {
    // This example assumes the Chilkat API to have been previously unlocked.
    // See Global Unlock Sample for sample code.

    let http = CkoHttp()!
    var success: Bool

    http.basicAuth = true
    http.login = "{{auth_id}}"
    http.password = "password"

    let queryParams = CkoJsonObject()!
    queryParams.updateInt("limit", value: 5)
    queryParams.updateInt("offset", value: 0)

    var resp: CkoHttpResponse? = http.quickRequestParams("GET", url: "https://api.plivo.com/v1/Account/<auth_id>/IncomingCarrier/", json: queryParams)
    if http.lastMethodSuccess == false {
        print("\(http.lastErrorText!)")
        return
    }

    print("\(resp!.statusCode.intValue)")
    print("\(resp!.bodyStr!)")
    resp = nil

}

Curl Command

curl -G -d "limit=5"
	-d "offset=0"
	-u '{{auth_id}}:password'
https://api.plivo.com/v1/Account/<auth_id>/IncomingCarrier/

Postman Collection Item JSON

{
  "name": "List all incoming carriers",
  "request": {
    "method": "GET",
    "header": [
    ],
    "url": {
      "raw": "https://api.plivo.com/v1/Account/{{auth_id}}/IncomingCarrier/?limit=5&offset=0",
      "protocol": "https",
      "host": [
        "api",
        "plivo",
        "com"
      ],
      "path": [
        "v1",
        "Account",
        "{{auth_id}}",
        "IncomingCarrier",
        ""
      ],
      "query": [
        {
          "key": "name",
          "value": "carrier_name",
          "description": "Allows filtering by name",
          "disabled": true
        },
        {
          "key": "limit",
          "value": "5",
          "description": "Used to display the number of results per page. The maximum number of results that can be fetched is 20."
        },
        {
          "key": "offset",
          "value": "0",
          "description": "Denotes the number of value items by which the results should be offset."
        }
      ]
    }
  },
  "response": [
  ]
}