function whoami

func.list

THis function tells you basic information about your API account.

Arguments:

argrequired?syntaxinfo
optfieldsNset:env|env.loaded|apimode|permissions|billcompIDs_readable|billcompIDs_writable|urloptional additional info to fetch

Return Values

A list of available function names.

Example 1

A simple request just fetching the default information.

JSON example request:

POST https://live.apicontrol.co.uk/1/json
{
    "auth" : {
        "username" : "YOURUSERNAME",
        "password" : "YOURPASSWORD",
    },
   "func" : "whoami",
   "args" : {}
}

JSON example response:

{
   "results" : {
      "userID" : 123454,
      "username" : "YOURUSERNAME",
      "custID" : 12345
   },
   "success" : 1
}

Here you can see your custID (which is the same as your account number), your userID which relates to your API logins (an account can have multiple logins with differing permissions) and the username used to log in to your API account (which ideally you should have known anyway given that you supplied it to call the API in the first place.

Example 2

Requesting some optional extras.

JSON example request:

POST https://live.apicontrol.co.uk/1/json
{
    "auth" : {
        "username" : "YOURUSERNAME",
        "password" : "YOURPASSWORD",
    },
   "func" : "whoami",
   "args" : {
      "optfields" : "env,apimode,url,billcompIDs_readable"
   }
}

JSON example response:

{
   "results" : {
      "userID" : 123454,
      "username" : "YOURUSERNAME",
      "custID" : 12345,
      "apimode" : "test",
      "url" : "https://test.apicontrol.co.uk/0.1/json",
      "env" : {
         "telecoms_num_format_output" : "e164"
      },
      "billcompIDs_readable" : [
         2
      ]
   },
   "success" : 1
}

Here you can see some other info, including your environment settings (in env). This particular environment setting would ensure that all phone numbers are returned by the API in E.164 format. Note that for the other examples in this documentation, this setting is not enabled. See number-formatting for more info.