Billing » API » Carrier

This endpoint is responsible for handling carriers.

Get all carriers

Request headers

Content-Type application/json
Authorization Bearer <token>

Request parameters

_allCarriersMeta.page int page number, starting from zero
_allCarriersMeta.perPage int number of items returned per
_allCarriersMeta.sortField str field used to sort the returned items, defaults to id
_allCarriersMeta.sortOrder str asc or desc, defaults to asc
POST

/graphql

Example request with curl
$ curl "https://api.canyan.io/graphql" \
  -X POST \
  -H "Content-Type: application/json" \
  -H "Authorization: Bearer <your-token-here>" \
  --data @- <<EOF
{"query": "{
    allCarriers {
      id
      tenant
      carrier_tag
      host
      port
      protocol
      active
    }
    meta: _allCarriersMeta(page: 0, perPage: 10, sortField: \"id\", sortOrder: \"asc\") {
      count
  }
}" }
EOF

Response

allCarriers.id objectid Identifier of the carrier
allCarriers.tenant string The associated tenant of the carrier
allCarriers.carrier_tag string The tag of the carrier
allCarriers.host string The carriers's host (hostname or IP)
allCarriers.port int The communication endpoint port
allCarriers.protocol CarrierProtocol TCP or UDP protocol
allCarriers.active int Is this carrier enabled?
meta.count int Results count
Example response
HTTP/1.1 200 OK
Content-Type: application/json
{
  "data": {
    "allCarriers": [
      {
        "id": "40419d91-23af-43db-a54a-3744d4f8fb8f",
        "tenant": "alex",
        "carrier_tag": "carrier1",
        "host": "carrier1.alex.com",
        "port": 5060,
        "protocol": "TCP",
        "active": true
      },
      {
        "id": "6dd0fdee-000d-43ce-9678-821a3ef5f97f",
        "tenant": "alex",
        "carrier_tag": "carrier2",
        "host": "carrier2.alex.com",
        "port": 5060,
        "protocol": "UDP",
        "active": true
      }
    ],
    "meta": {
      "count": 2
    }
  }
}

Get specific carrier

Request headers

Content-Type application/json
Authorization Bearer <token>

Request parameters

allCarriers.filter.id id id of the carrier
allCarriers.filter.ids array array of ids to fetch
allCarriers.filter.tenant array filter carriers by tenant
allCarriers.filter.carrier_tag array get a carrier by it's tag
POST

/graphql

Example request with curl
$ curl "https://api.canyan.io/graphql" \
  -X POST \
  -H "Content-Type: application/json" \
  -H "Authorization: Bearer <your-token-here>" \
  --data @- <<EOF
{"query": "{
    allCarriers(filter: {tenant: \"alex\"} ) {
      id
      tenant
      carrier_tag
      host
      port
      protocol
      active
    }
}" }
EOF

Response

allCarriers.id objectid Identifier of the carrier
allCarriers.tenant string The associated tenant of the carrier
allCarriers.carrier_tag string The tag of the carrier
allCarriers.host string The carriers's host (hostname or IP)
allCarriers.port int The communication endpoint port
allCarriers.protocol CarrierProtocol TCP or UDP protocol
allCarriers.active int Is this carrier enabled?
meta.count int Results count
Example response
HTTP/1.1 200 OK
Content-Type: application/json
{
  "data": {
    "allCarriers": [
      {
        "id": "40419d91-23af-43db-a54a-3744d4f8fb8f",
        "tenant": "alex",
        "carrier_tag": "carrier1",
        "host": "carrier1.alex.com",
        "port": 5060,
        "protocol": "TCP",
        "active": true
      },
      {
        "id": "6dd0fdee-000d-43ce-9678-821a3ef5f97f",
        "tenant": "alex",
        "carrier_tag": "carrier2",
        "host": "carrier2.alex.com",
        "port": 5060,
        "protocol": "UDP",
        "active": true
      }
    ]
  }
}

Create a new carrier

Request headers

Content-Type application/json
Authorization Bearer <token>

Request parameters

createCarrier.id identifyer Unique identifyer of the carrier (if not provided an uuid4 will be generated automatically - best option)
createCarrier.carrier_tag string The tag of the carrie
createCarrier.tenant string tenant of the carrier
createCarrier.host string The carriers's host (hostname or IP)
createCarrier.port int The communication endpoint port
createCarrier.protocol CarrierProtocol TCP or UDP protocol
createCarrier.active boolean Should this carrier be enabled?
POST

/graphql

Example request with curl
$ curl "https://api.canyan.io/graphql" \
  -X POST \
  -H "Content-Type: application/json" \
  -H "Authorization: Bearer <your-token-here>" \
  --data @- <<EOF
{"query": "mutation {
  createCarrier(tenant: \"alex\", carrier_tag: \"alex-carrier1\", host: \"alex.canyan.io\", port: 5060, protocol: TCP, active: true) {
    id
    tenant
    carrier_tag
    host
    port
    protocol
    active
  }
}
"
}
EOF

Response

createCarrier.id objectid Identifier of the carrier
createCarrier.tenant string The associated tenant of the carrier
createCarrier.carrier_tag string The tag of the carrier
createCarrier.host string The carriers's host (hostname or IP)
createCarrier.port int The communication endpoint port
createCarrier.protocol CarrierProtocol TCP or UDP protocol
createCarrier.active int Is this carrier enabled?
Example response
HTTP/1.1 200 OK
Content-Type: application/json
{
  "data": {
    "createCarrier": {
      "id": "48deac88-1d1b-4680-8b2a-c9af38ae7136",
      "tenant": "alex",
      "carrier_tag": "alex-carrier1",
      "host": "alex.canyan.io",
      "port": 5060,
      "protocol": "TCP",
      "active": true
    }
  }
}

Update a carrier

Request headers

Content-Type application/json
Authorization Bearer <token>

Request parameters

updateCarrier.id identifyer Unique identifyer of the carrier
updateCarrier.carrier_tag string The tag of the carrie
updateCarrier.tenant string tenant of the carrier
updateCarrier.host string The carriers's host (hostname or IP)
updateCarrier.port int The communication endpoint port
updateCarrier.protocol CarrierProtocol TCP or UDP protocol
updateCarrier.active boolean Should this carrier be enabled?
POST

/graphql

Example request with curl
$ curl "https://api.canyan.io/graphql" \
  -X POST \
  -H "Content-Type: application/json" \
  -H "Authorization: Bearer <your-token-here>" \
  --data @- <<EOF
{"query": "mutation {
  updateCarrier(tenant: \"alex\", carrier_tag: \"alex-carrier1\", host: \"alexcarrier.canyan.io\", port: 5061, protocol: UDP, active: false) {
    id
    tenant
    carrier_tag
    host
    port
    protocol
    active
  }
}"
}
EOF

Response

updateCarrier.id objectid Identifier of the carrier
updateCarrier.tenant string The associated tenant of the carrier
updateCarrier.carrier_tag string The tag of the carrier
updateCarrier.host string The carriers's host (hostname or IP)
updateCarrier.port int The communication endpoint port
updateCarrier.protocol CarrierProtocol TCP or UDP protocol
updateCarrier.active int Is this carrier enabled?
Example response
HTTP/1.1 200 OK
Content-Type: application/json
{
  "data": {
    "updateCarrier": {
      "id": "48deac88-1d1b-4680-8b2a-c9af38ae7136",
      "tenant": "alex",
      "carrier_tag": "alex-carrier1",
      "host": "alexcarrier.canyan.io",
      "port": 5061,
      "protocol": "UDP",
      "active": false
    }
  }
}

Delete a carrier

Request headers

Content-Type application/json
Authorization Bearer <token>

Request parameters

deleteCarrier.id identifyer Unique identifyer of the carrier
deleteCarrier.carrier_tag string The tag of the carrier
deleteCarrier.tenant string The tenant of the carrier
POST

/graphql

Example request with curl
$ curl "https://api.canyan.io/graphql" \
  -X POST \
  -H "Content-Type: application/json" \
  -H "Authorization: Bearer <your-token-here>" \
  --data @- <<EOF
{"query": "mutation {
  deleteCarrier(tenant: \"alex\", carrier_tag: \"alex-carrier1\") {
    id
    tenant
    carrier_tag
    host
    port
    protocol
    active
  }
}"
}
EOF

Response

deleteCarrier.id objectid Identifier of the carrier.
deleteCarrier.name string Name of the carrier.
Example response
HTTP/1.1 200 OK
Content-Type: application/json
{
  "data": {
    "deleteCarrier": {
      "id": "48deac88-1d1b-4680-8b2a-c9af38ae7136",
      "tenant": "alex",
      "carrier_tag": "alex-carrier1",
      "host": "alexcarrier.canyan.io",
      "port": 5061,
      "protocol": "UDP",
      "active": false
    }
  }
}
Stay updated

By registering with us you will receive right in your inbox all new features and updates

Check your email

We sent you an email with a link to get started. You’ll be in your account in no time.