RMS API Credits: Difference between revisions
no edit summary
No edit summary |
|||
(5 intermediate revisions by 2 users not shown) | |||
Line 1: | Line 1: | ||
__TOC__ | __TOC__ | ||
== Introduction == | |||
Using the RMS API allows users to automate tasks and integrate RMS into their own solutions. In this guide, an example will be provided which step-by-step shows a way to apply the RMS API to manage your RMS credit balance, as well as create a credit code used for transferring credits between different accounts. | |||
Such an application of the RMS API could be used in solutions where transferring credits is an automated process, not requiring any manual input. | |||
All documentation of the RMS API can be found here - https://developers.rms.teltonika-networks.com/ | |||
This example only includes using Personal Access Tokens to use the API. The RMS API also allows for Application Authentication, used specifically in applications that can use RMS as an OAuth provider. | |||
===Two-Factor Authentication=== | ===Two-Factor Authentication=== | ||
Line 48: | Line 51: | ||
==Using the API with Postman to gather information about credit balance== | ==Using the API with Postman to gather information about credit balance== | ||
To get the general information about your current RMS credit balance, we can use the '''GET /credits/summary''' endpoint: | To get the general information about your current RMS credit balance, we can use the '''[https://developers.rms.teltonika-networks.com/pages/api.html#/credits/creditsSummary GET /credits/summary]''' endpoint: | ||
1. Select the GET option and input the endpoint URL into the necessary field - <nowiki>https://rms.teltonika-networks.com/api/credits/summary</nowiki>. | 1. Select the GET option and input the endpoint URL into the necessary field - <nowiki>https://rms.teltonika-networks.com/api/credits/summary</nowiki>. | ||
Line 76: | Line 79: | ||
==Using the API with postman to manage RMS credit codes== | ==Using the API with postman to manage RMS credit codes== | ||
To get general information about your RMS credit codes, you can use the '''GET /credits/codes''' endpoint: | To get general information about your RMS credit codes, you can use the '''[https://developers.rms.teltonika-networks.com/pages/api.html#/credits%20codes/creditsTokensAll GET /credits/codes]''' endpoint: | ||
1. Select the GET option and input the endpoint URL into the necessary field – <nowiki>https://rms.teltonika-networks.com/api/credits/codes</nowiki>; | 1. Select the GET option and input the endpoint URL into the necessary field – <nowiki>https://rms.teltonika-networks.com/api/credits/codes</nowiki>; | ||
Line 98: | Line 101: | ||
===Generate a new credit code=== | ===Generate a new credit code=== | ||
---- | ---- | ||
To generate a new credit code, you can use the '''POST /credits''/''codes''' endpoint: | To generate a new credit code, you can use the '''[https://developers.rms.teltonika-networks.com/pages/api.html#/credits%20codes/creditsTokensAdd POST /credits''/''codes]''' endpoint: | ||
1. Select the POST option and input the endpoint URL into the necessary field – <nowiki>https://rms.teltonika-networks.com/api/credits/codes</nowiki>; | 1. Select the POST option and input the endpoint URL into the necessary field – <nowiki>https://rms.teltonika-networks.com/api/credits/codes</nowiki>; | ||
Line 112: | Line 115: | ||
3. In the Body tab, input the necessary Request body (many POST requests require request bodies). For example: | 3. In the Body tab, input the necessary Request body (many POST requests require request bodies). For example: | ||
{ | |||
{ | ''"amount": 4, | ||
"comment": "Some example comment", | |||
''"amount": 4, | "company_id": 458'' | ||
} | |||
"comment": "Some example comment", | |||
"company_id": 458'' | |||
} | |||
* Amount – The number of credits you wish the credit code to contain. This cannot exceed the maximum credits that your RMS company currently owns. | * Amount – The number of credits you wish the credit code to contain. This cannot exceed the maximum credits that your RMS company currently owns. |