The API is secured via Basic Access Authentication
Basic Authentication requires that the username is appended with a colon and concatenated with the password, the resulting string should then be base64 encoded and sent to the API in the HTTP header Authorization.
The PFI API and Billing notifications use the Merchant Id and Merchant Token in the place of the username and password. These will be provided during account creation.
Example Code:
string header = Base64(“<merchantId>:<token>”);
Example Header:
Authorization: Basic PHVzZXJuYW1lPjo8cGFzc3dvcmQ+
If the merchant Id\merchant token are not authorised the API will return an ‘Access is Denied’ exception.
Example Headers:
Authorization: Basic MTpBRTdBMDdBOC1EMDg1LTQwQzYtQUNFNC1GRjg0RjE0RTMyNDc=
Accept: */*
Cache-Control: no-cache
Content-Type: application/Json
Endpoints
Live:
https://pfi.imimobile.net/api/
Staging:
https://pfi.imimobile.net/staging/api/
Formats
When using REST the request\response format of JSON\XML are determined by the Content-Type HTTP header specified in the HTTP request. The Content-Type should be one of the following:
- XML – text/xml
- JSON – application/Json