Please help to update currency rates by API.
I read the documentation, but I just can't implement getting the exchange rate using the API. Please show working examples, at least for the manual introduction of courses. If there are examples of receiving courses from a source, it will be great.
1.I found an example of how to make a similar solution through the PHP, but it will not work, because when I change the course directly in the database, it does not change in the CRM. Only if you change the course in the CRM will change in the database.
2. I created the EspoApiClient.php file on the hosting at the root folder. The CRM is located in the "/crm" folder.
Then I created a file reates.php with this code and placed it at the root. API User has rights to edit Currency Rates
<?php
require_once('EspoApiClient.php');
$url = 'https://my_site.com/crm/';
$apiKey = '2e5ca0f738***********9a6efc60684e9';
$client = new EspoApiClient($url);
$client->setApiKey($apiKey);
$response = $client->request('PUT', 'Currency', [
'EUR' => '7777',
'USD' => '9999',
]);
?>
I am trying to call by link but to no avail
https://my_site.com/reates.php
3. Request to update specific rates: PUT api/v1/CurrencyRate, with JSON payload.
Payload example:
{
"EUR": 1.11,
"UAH": 0.037
}
Are there any more detailed instructions on how to do this and where to insert this code ??
---------------------------------------------------
PUT api/v1/CurrencyRate HTTP/1.1
Content-Type: application/json; charset=UTF-8"
{
"EUR": 1.11,
"UAH": 0.037
}
-------------------------------------------------------
Is that how it should be?
I do not understand in what format the file with this code should be and where to place it for it to work correctly.
There is no Currency entity in the Workflow to make the PUT request. http://prntscr.com/v2lysi
I read the documentation, but I just can't implement getting the exchange rate using the API. Please show working examples, at least for the manual introduction of courses. If there are examples of receiving courses from a source, it will be great.
1.I found an example of how to make a similar solution through the PHP, but it will not work, because when I change the course directly in the database, it does not change in the CRM. Only if you change the course in the CRM will change in the database.
2. I created the EspoApiClient.php file on the hosting at the root folder. The CRM is located in the "/crm" folder.
Then I created a file reates.php with this code and placed it at the root. API User has rights to edit Currency Rates
<?php
require_once('EspoApiClient.php');
$url = 'https://my_site.com/crm/';
$apiKey = '2e5ca0f738***********9a6efc60684e9';
$client = new EspoApiClient($url);
$client->setApiKey($apiKey);
$response = $client->request('PUT', 'Currency', [
'EUR' => '7777',
'USD' => '9999',
]);
?>
I am trying to call by link but to no avail
https://my_site.com/reates.php
3. Request to update specific rates: PUT api/v1/CurrencyRate, with JSON payload.
Payload example:
{
"EUR": 1.11,
"UAH": 0.037
}
Are there any more detailed instructions on how to do this and where to insert this code ??
---------------------------------------------------
PUT api/v1/CurrencyRate HTTP/1.1
Content-Type: application/json; charset=UTF-8"
{
"EUR": 1.11,
"UAH": 0.037
}
-------------------------------------------------------
Is that how it should be?
I do not understand in what format the file with this code should be and where to place it for it to work correctly.
There is no Currency entity in the Workflow to make the PUT request. http://prntscr.com/v2lysi
Comment