Your first API request

Modified on: 2015-05-06 14:27:52 UTC


NOTE: If you haven't already read the previous articles, we suggest you start from the beginning of our API Basics section, which provides an overview and walks you through the process.

If you have already created an API Key, you're ready to submit your first test API request. Since we don't charge for TrueCNAM queries, we recommend starting with this basic query first, and seeing that it works for you, before you continue onto more advanced topics.

For this example, we're going to use the API Domain: api.truecnam.net , and we'll assume that your account API Key and Password are as follows:

API Key:  "APIkey" (without quotes)

API Password: "APIpassword" (without quotes)

Your own API Key and password will be different, can be found here, and should be substituted into the correct places below, specifically after "username=" (the API Key), and "password=" (the API Key Password).

The API query below is a test, and we'll also assume that this is a CNAM Lookup query (the most common), and that the number calling you is: "12125551212" (don't worry, we'll get into further details on this and other fields later).

Here's the test query we'll try first. You can copy the below (note the window below scrolls) to a plain text editor, substitute in your API Key & Password, and then paste the result into a web browser URL bar and hit enter/return:   

https://api.truecnam.net/api/v1?username=APIkey&password=APIpassword&resp_type=basic&resp_format=json&calling_number=12125551212&call_party=terminating

When you submit that API request (again, make sure you've substituted your API Key and Password, which are both CaSe SeNsItIvE), you'll get back the following:

{"calling_number": "12125551212", "error_msg": "", "err": "0", "name": “Directory Assis”}

Which includes the "calling_number" field, which is the Caller ID number of someone calling you (and that was requested above), any error messages and numbers (none in this case), and the "name" field which is the CNAM (Caller ID Name) associated with the telephone number 12125551212, in this case "Directory Assis".

So, now you've performed you're first test API call, and we suggest you continue onto:

Next, API In-depth



Did you find it helpful? Yes No

Can you please tell us how we can improve this article?