Perform your first request
Here is an API call example with Ruby language
Last updated
Here is an API call example with Ruby language
Last updated
Firstly, you will need to get a token :
require "rest-client"
require "json"
login = "Login"
password = "Password"
response = RestClient.post(
"https://api.idol.io/oauth/token",
{
grant_type: "password",
username: login,
password: password
}
)
token = JSON.parse(response)["access_token"] # => 'c90450...'
Once you get a token you can call any endpoint of our API, here is an example to retrieve your products :
response = RestClient.get(
"https://api.idol.io/api/v2/products",
"Content-Type": 'application/vnd.api+json',
"Authorization": "Bearer <token>"
)
JSON.parse(response)['data'] # => '[{ "id": "<ID>", "type": "products",' .. }]'