Returns a list of all CNAM records on your account by default. You can apply search filters using any of the available query parameters.
Endpoint
GET /cnamsQuery Parameters
-
limit
integerLimits the number of CNAM records to retrieve. There is no max limit currently enforced.
-
offset
integerOffsets the list of CNAM records to retrieve by your specified value. For example, if you have 4 CNAM records and you entered 1 as your offset value, then only 3 of your CNAM records will be displayed in the response.
-
is_approved
booleanFilters results to CNAM records that are either approved or not approved.
-
value
stringFilters results to CNAM records that include this string (case insensitive)."
Response Fields
On success, the HTTP status code in the response header is 200 OK and the response body contains an array of cnam objects in JSON format. On error, the header status code is an error code and the response body contains an array of error objects.
-
data
arrayAn array of cnam objects in your account that satisfy your query.
-
attributes
objectDifferent attributes of a cnam object:
approval_datetime datetime- Date and time, to the second, on which the CNAM record was approved. This field displays date and time in UTC following the complete date plus hours, minutes, seconds and a decimal fraction of a second ISO 8601 format.
creation_datetime datetime- Date and time, to the second, on which the CNAM record was created. This field displays date and time in UTC following the complete date plus hours, minutes, seconds and a decimal fraction of a second ISO 8601 format.
is_approved boolean- Boolean indicating whether the CNAM record is approved or not.
rejection_reason string- Reason stating why the CNAM record has been rejected.
value string- The caller ID that will be displayed when associated with a long-code phone number on your Flowroute account.
-
id
integerUnique identifier of the cnam object.
-
links
objectLinks object pointing to the CNAM record's URI. For example, https://api.flowroute.com/v2/cnams/20430.
-
type
stringThis will always be cnam.
-
links
objectLinks object pointing to your cnam query and a link to the next page if any. For example, https://api.flowroute.com/v2/cnams?is_approved=True&limit=10&offset=0.
Example Request
GET /v2/cnams?is_approved=true HTTP/1.1
Content-Type: application/vnd.api+json
Accept: application/vnd.api+json
Example Request
curl -X GET https://api.flowroute.com/v2/cnams?is_approved=true -u accessKey:secretKey
Example Request
This assumes that you have the Python API Wrapper installed and set up. The following example is from cnam_demo.py. Please make sure to use neutral (vertical) quotes in your request. Smart quotes are known to cause errors.
# Instantiate the API client and create a controller for CNAMs
client = FlowroutenumbersandmessagingClient(basic_auth_user_name, basic_auth_password)
cnams_controller = client.cnams
print("\n--List Approved CNAM Records")
result = cnams_controller.list_cnams(limit, offset, is_approved=True)
pprint.pprint(result)
Example Responses
200 OK
{
"data": [
{
"attributes": {
"approval_datetime": null,
"creation_datetime": null,
"is_approved": true,
"rejection_reason": "",
"value": "TEST, MARIA"
},
"id": "17604",
"links": {
"self": "https://api.flowroute.com/v2/cnams/17604"
},
"type": "cnam"
},
{
"attributes": {
"approval_datetime": "2018-04-16 16:20:32.939166+00:00",
"creation_datetime": "2018-04-12 19:08:39.062539+00:00",
"is_approved": true,
"rejection_reason": null,
"value": "REGENCE INC"
},
"id": "22671",
"links": {
"self": "https://api.flowroute.com/v2/cnams/22671"
},
"type": "cnam"
},
{
"attributes": {
"approval_datetime": "2018-04-23 17:04:30.829341+00:00",
"creation_datetime": "2018-04-19 21:03:04.932192+00:00",
"is_approved": true,
"rejection_reason": null,
"value": "BROWN BAG"
},
"id": "22790",
"links": {
"self": "https://api.flowroute.com/v2/cnams/22790"
},
"type": "cnam"
}
],
"links": {
"self": "https://api.flowroute.com/v2/cnams?is_approved=True&limit=100&offset=0"
}
}
422 UNPROCESSABLE ENTITY
{
"errors": [
{
"detail": {
"limit": [
"Invalid value."
]
},
"id": "07f2df99-f31d-45ce-93d3-1512f81ab27d",
"status": 422
}
]
}