Currency API

This section describes the API method to obtain the details of a currency or the list of all currencies. The currency list is typically only retrieved once, stored internally to your application for use.

Note: The sample requests contained in this document are for reference only. You will not be able to run the examples as is. Please construct your requests based on your authorization token and data requests with your own data values.

Generating the Request

As an example, request the following request will return the list of currencies.

				// Example Request
curl -v -X GET 'https://lclxchange.com/api/currency' -H "Content-Type: application/json" -H "Authorization: Bearer <access_token>"

On a successful authentication the result will look something like:

				//Example Result
{
"currencies": {
"0": {
"index": 784,
"name": "United Arab Emirates dirham",
"code": "AED"
},
"1": {
"index": 971,
"name": "Afghan afghani",
"code": "AFN"
},
"2": {
"index": 8,
"name": "Albanian lek",
"code": "ALL"
}
}
}

As another example, the request specifying an index will return one currency result.

				// Example Request
curl -v -X GET 'https://lclxchange.com/api/currency' -H "Content-Type: application/json" -H "Authorization: Bearer <access_token>" -d '{ "index" : "<index_value>" }'

On a successful authentication the result will look something like:

				//Example Result
{
"currencies": {
"0": {
"index": 32,
"name": "Argentine peso",
"code": "ARS"
}
}
}

An error or invalid credentials will return:

				{
    "Unauthorized": "Access denied."
}
				

API REQUEST DETAILS

This section provides information about what is required to generate a currency API Request. These fields populate the JSON request.

Component Description
index

The index of the currency type

The URL of the API Services

https://lclxchange.com/api/currency

Query Parameters

None

HTTP Request Body

A JSON formatted POST request.