RMS API Credits: Difference between revisions
no edit summary
No edit summary |
|||
(7 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 25: | Line 28: | ||
Once there, simply press Add new access token. | Once there, simply press Add new access token. | ||
[[File:RMS API Add new access token.png|none|thumb|850x850px]] | |||
Next, input a name for this access token and select the necessary Scopes. Scopes are basically permissions – what the access token will be capable of doing in your account. For this example, we will be selecting these scopes: | Next, input a name for this access token and select the necessary Scopes. Scopes are basically permissions – what the access token will be capable of doing in your account. For this example, we will be selecting these scopes: | ||
Line 47: | 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 75: | 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 97: | 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 111: | 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, | |||
''"amount": 4, | "comment": "Some example comment", | ||
"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. |