Authentication

How to use the different CALLR authentication mechanisms


The CALLR API has two authentication mechanisms available for use, either Basic Authentication, or Api-Key Authentication

Basic Authentication


For more information please look at the following wiki article Basic HTTP Authentication.


Login credentials are sent base64 encoded in a "Authorization" HTTP header.
Like this:

Authorization: Basic bG9naW46cGFzc3dvcmQ=


bG9naW46cGFzc3dvcmQ= is login:password base64 encoded.


When you subscribed to our products, you should have received your credentials (login and password). If that's not the case, please contact the support.

Your API credentials are the ones you use with the customer portal - https://sso.callr.com


  • Sample HTTP JSON-RPC 2.0 Request:
  • http
    POST /json-rpc/v1.1/ HTTP/1.1
    Authorization: Basic ZG9ub3R0cnl0aGlzYXRob21lOml0c2Zha2U=
    Host: api.callr.com
    Accept: */*
    Content-Type: application/json-rpc; charset=utf-8
    Content-Length: 143
    
    {
       "jsonrpc":"2.0",
       "id":42,
       "method":"sms.send",
       "params":[
          "SMS",
          "+33612345678",
          "Hello, world",
          null
       ]
    }
    

  • Response:
  • http
    HTTP/1.1 200 OK
    Content-Type: application/json-rpc; charset=utf-8
    Transfer-Encoding: chunked
    Date: Sun, 28 Aug 2011 16:04:28 GMT
    
    2d
    {"jsonrpc":"2.0","id":42,"result":"8242D945"}
    0
    

Api-Key Authentication


You are also able to authenticate using an API Key. API keys can be generated and managed using the methods found here

Once generated, the api key must be sent in the http request using the Authorization: Api-Key header as the example below illustrates.

  • Sample HTTP JSON-RPC 2.0 Request using an API key:
  • http
    POST /json-rpc/v1.1/ HTTP/1.1
    Host: api.callr.com
    Accept: */*
    Content-Type: application/json-rpc; charset=utf-8
    Authorization: Api-Key 987654321abcdef987654321abcdef987654321abcdef987654321abcdef987654321abcdef987654321abcdef987654321a
    Content-Length: 70
    
    {
       "jsonrpc":"2.0",
       "id":42,
       "method":"system.get_timestamp",
       "params":[]
    }

  • Response
  • http
    HTTP/1.1 200 OK
    Content-Type: application/json-rpc; charset=utf-8
    Transfer-Encoding: chunked
    Date: Sun, 28 Aug 2011 16:04:28 GMT
    
    2d
    {"jsonrpc":"2.0","id":42,"result":3213213211}
    0