{"activeVersionTag":"latest","latestAvailableVersionTag":"latest","collection":{"info":{"_postman_id":"aa422d88-dc0c-4601-b84c-02f51dbce22a","name":"Rasayel REST API","description":"Welcome to the Rasayel API Documentation!\n\nEmpowering sales teams to excel in the digital age, Rasayel offers a comprehensive suite of tools tailored to enhance communication and streamline operations over WhatsApp. Our API serves as the gateway to unlocking the full potential of Rasayel's platform, enabling seamless integration with your existing systems and empowering developers to craft innovative solutions tailored to your business needs.\n\n# Getting Started\n\nFirst thing you need to do before using our REST APIs is to create a new API key on Rasayel, to do this, you can head over to the API management page to create a new API key or use an existing one.\n\n<img src=\"https://content.pstmn.io/d3440972-da57-48f4-b749-b35db225ffd6/U2NyZWVuc2hvdCAyMDI0LTA0LTMwIGF0IDEzLjU1LjU3LnBuZw==\" width=\"534\" height=\"302\">\n\n## Creating a New API Key\n\nClick on \"Created your first key\", which will prompt you to give your API key a name and select the authorization scope you'd like to give to the API key holder\n\n### Authorization scopes\n\n- **Read:** will only be able to do read operations through the API (fetching a template, fetching a conversation, etc)\n- **Read/Write:** will be able to do any operation, either a read or a write (sending a message, fetching a template, etc)\n    \n\n<img src=\"https://content.pstmn.io/c642fa0c-f0f6-40f1-8253-a28ca310001b/U2NyZWVuc2hvdCAyMDI0LTA0LTMwIGF0IDEzLjU5LjQ4LnBuZw==\" width=\"528\" height=\"340\">\n\n<img src=\"https://content.pstmn.io/0d41e8cf-ea53-43b9-b66c-52afcce7982e/U2NyZWVuc2hvdCAyMDI0LTA0LTMwIGF0IDE0LjAxLjMxLnBuZw==\" width=\"530\" height=\"299\">\n\nAfter creating the key, you will be given the API info, copy the \"Basic Auth Value\" which is shown in the below image, this value will be needed to be sent in the **Authorization** header with the requests for authentication.\n\n<img src=\"https://content.pstmn.io/6ad270f9-64e3-4993-90cb-cda8d4aef503/U2NyZWVuc2hvdCAyMDI0LTA0LTMwIGF0IDE0LjA5LjA4ICgxKS5wbmc=\" width=\"534\" height=\"357\">\n\n## Use an Existing API Key\n\nIf you want to use an existing API key instead of creating a new one, you can follow the same instructions as the above by\n\n- Heading to the settings\n- Navigate to the API management page\n- You'll find the created API keys listed there\n- Click on the \"Reveal token\" to get the API info show up, then copy the \"Basic Auth Value\", similar to what we did above\n    \n\n<img src=\"https://content.pstmn.io/16000cb9-f2a0-429d-9ef2-53b66fbef218/U2NyZWVuc2hvdCAyMDI0LTA0LTMwIGF0IDE0LjE5LjE2LnBuZw==\" width=\"517\" height=\"293\">\n\n<img src=\"https://content.pstmn.io/b269e66a-d1b9-4ee0-9ae4-702e3ad584f2/U2NyZWVuc2hvdCAyMDI0LTA0LTMwIGF0IDE0LjA5LjA4LnBuZw==\" width=\"517\" height=\"293\">\n\n# Authentication\n\nTo authenticate your API requests, you'll need to provide the \"Basic Auth Value\" that we extracted above of the API key you want to use in the \\`Authorization\\` header when sending any request.\n\n``` bash\ncurl --location 'http://api.rasayel.io/v1/templates?page=1&per_page=20' \\\n--header 'Authorization: Basic {{your_token}}'\n\n ```\n\n# Identifying Yourself\n\nTo specify a user to be taking actions on his behalf using the API, you can specify the ID of the user in the `X_On_Behalf_Of` header along with the request\n\n```\ncurl --location 'http://api.rasayel.io/v1/templates?page=1&per_page=20' \\\n--header 'X_On_Behalf_Of: {{user_id}}' \\\n--header 'Authorization: Basic {{your_token}}'\n\n ```\n\n## Finding Your ID\n\nYou can find your ID by navigating to the settings followed by navigating to the profile page which you'll find your user ID in similar to the image shown below\n\n<img src=\"https://content.pstmn.io/77a5c960-cd6e-4800-a535-07064af636cd/U2NyZWVuc2hvdCAyMDI0LTA0LTMwIGF0IDE5LjA2LjQ1LnBuZw==\" width=\"516\" height=\"292\">\n\n# Pagination\n\n## Query Parameters\n\nAny Index request in our API is paginated, you can control the pagination using the following query parameters\n\n- **page:** specifies the page you want to fetch.\n    \n- **per_page**: specifies the amount of records returned in a single page.\n    \n\n## Pagination Object\n\nEvery paginated request will include a pagination object under the key `pagination` , you'll find an example below of the pagination object returned along with comments to specify what each field exactly indicate.\n\n``` json\n\"pagination\": {\n    \"total_count\": 1337, # The total count of the records\n    \"total_pages\": 45, # Total pages\n    \"current_page\": 1, # The current fetched page\n    \"next_page\": 2, # The index of the next page\n    \"previous_page\": null, # The index of the previous page\n    \"first_page\": true, # A boolean to specify whether this is the first page or not\n    \"last_page\": false # A boolean to specify whether this is the last page or not\n}\n\n ```\n\n# Rate Limit\n\nWe use rate limiting to ensure fair experience for all users of our API.\n\nIt prevents any user from overloading the system with too many requests in a short time.\n\n## How Rate Limiting Works at Rasayel\n\nWe use a method called the [Leaky Bucket](https://en.wikipedia.org/wiki/Leaky_bucket) approach. Imagine you're filling a bucket with water. If you add water too fast, it will overflow. But if you add water at a steady pace, it won't. The same principle applies to sending requests to our API.\n\n> The leaky bucket system rewards users who send requests at a steady rate. If you send too many requests too quickly, your \"bucket\" overflows, and you'll be temporarily blocked from sending more requests. \n  \n\n### Limits\n\nOur API implements rate limits using a leaky bucket algorithm as mentioned above, each client is allocated a bucket with a maximum capacity of 100 tokens. Tokens are replenished at a fixed rate of 20 requests per minute. When a client makes a request, tokens are consumed from the bucket, and if the bucket is empty, further requests will be delayed until more tokens are available.\n\n### Tracking Your Usage\n\nTo help you monitor your API usage, each response includes a header labeled `X_Rasayel_Api_Call_Capacity`, indicating the number of tokens consumed out of the maximum limit. This header is presented in the format `{{ tokens_used }}/{{ max_tokens_limit }}`. By parsing this header, you can easily track the consumption of tokens against your allotted capacity, allowing for efficient management of your API requests and ensuring compliance with the rate limits imposed by the system.\n\n### Reaching The Limits\n\nIn the event that you encounter rate limiting, the API will include a `Retry-After` header in the response. This header indicates the duration, in seconds, that you should wait before attempting further requests to successfully access the API. By referencing the value provided in the `Retry-After` header, you can implement appropriate backoff strategies within your application, ensuring that subsequent requests are made within the allowed timeframe and minimizing disruptions to your service.","schema":"https://schema.getpostman.com/json/collection/v2.0.0/collection.json","isPublicCollection":false,"owner":"34761025","collectionId":"aa422d88-dc0c-4601-b84c-02f51dbce22a","publishedId":"2sA3JJ9i7g","public":true,"publicUrl":"https://rest.developers.rasayel.io","privateUrl":"https://go.postman.co/documentation/34761025-aa422d88-dc0c-4601-b84c-02f51dbce22a","customColor":{"top-bar":"FFFFFF","right-sidebar":"303030","highlight":"FF6C37"},"documentationLayout":"classic-double-column","customisation":{"metaTags":[{"name":"description","value":""},{"name":"title","value":""}],"appearance":{"default":"light","themes":[{"name":"dark","logo":"https://content.pstmn.io/ca8572c9-1fb8-44a2-94b3-c587869a58ba/cmFzYXllbC1sb2dvLXJlbW92ZWJnLXByZXZpZXcucG5n","colors":{"top-bar":"212121","right-sidebar":"303030","highlight":"FF6C37"}},{"name":"light","logo":"https://content.pstmn.io/5cd717f0-63eb-4095-9e31-b1c13f160820/cmFzYXllbC1sb2dvLXJlbW92ZWJnLXByZXZpZXcucG5n","colors":{"top-bar":"FFFFFF","right-sidebar":"303030","highlight":"FF6C37"}}]}},"version":"8.11.6","publishDate":"2024-05-23T08:20:59.000Z","activeVersionTag":"latest","documentationTheme":"light","metaTags":{"title":"","description":""},"logos":{"logoLight":"https://content.pstmn.io/5cd717f0-63eb-4095-9e31-b1c13f160820/cmFzYXllbC1sb2dvLXJlbW92ZWJnLXByZXZpZXcucG5n","logoDark":"https://content.pstmn.io/ca8572c9-1fb8-44a2-94b3-c587869a58ba/cmFzYXllbC1sb2dvLXJlbW92ZWJnLXByZXZpZXcucG5n"}},"statusCode":200},"environments":[{"name":"Rasayel REST API","id":"e236d1a7-f50a-44f6-9f9c-37ccbdc8e9aa","owner":"34761025","values":[{"key":"base_url","value":"https://api.rasayel.io/v1","enabled":true,"type":"default"},{"key":"token","value":"Basic {{ token }}","enabled":true,"type":"default"}],"published":true}],"user":{"authenticated":false,"permissions":{"publish":false}},"run":{"button":{"js":"https://run.pstmn.io/button.js","css":"https://run.pstmn.io/button.css"}},"web":"https://www.getpostman.com/","team":{"logo":"https://res.cloudinary.com/postman/image/upload/t_team_logo_pubdoc/v1/team/72f25b28d7bc4813c3e1a6cfa27fa0693c1370e97fd6aba6348d56886189b7d4","favicon":"https://rasayel.io/favicon.ico"},"isEnvFetchError":false,"languages":"[{\"key\":\"csharp\",\"label\":\"C#\",\"variant\":\"HttpClient\"},{\"key\":\"csharp\",\"label\":\"C#\",\"variant\":\"RestSharp\"},{\"key\":\"curl\",\"label\":\"cURL\",\"variant\":\"cURL\"},{\"key\":\"dart\",\"label\":\"Dart\",\"variant\":\"http\"},{\"key\":\"go\",\"label\":\"Go\",\"variant\":\"Native\"},{\"key\":\"http\",\"label\":\"HTTP\",\"variant\":\"HTTP\"},{\"key\":\"java\",\"label\":\"Java\",\"variant\":\"OkHttp\"},{\"key\":\"java\",\"label\":\"Java\",\"variant\":\"Unirest\"},{\"key\":\"javascript\",\"label\":\"JavaScript\",\"variant\":\"Fetch\"},{\"key\":\"javascript\",\"label\":\"JavaScript\",\"variant\":\"jQuery\"},{\"key\":\"javascript\",\"label\":\"JavaScript\",\"variant\":\"XHR\"},{\"key\":\"c\",\"label\":\"C\",\"variant\":\"libcurl\"},{\"key\":\"nodejs\",\"label\":\"NodeJs\",\"variant\":\"Axios\"},{\"key\":\"nodejs\",\"label\":\"NodeJs\",\"variant\":\"Native\"},{\"key\":\"nodejs\",\"label\":\"NodeJs\",\"variant\":\"Request\"},{\"key\":\"nodejs\",\"label\":\"NodeJs\",\"variant\":\"Unirest\"},{\"key\":\"objective-c\",\"label\":\"Objective-C\",\"variant\":\"NSURLSession\"},{\"key\":\"ocaml\",\"label\":\"OCaml\",\"variant\":\"Cohttp\"},{\"key\":\"php\",\"label\":\"PHP\",\"variant\":\"cURL\"},{\"key\":\"php\",\"label\":\"PHP\",\"variant\":\"Guzzle\"},{\"key\":\"php\",\"label\":\"PHP\",\"variant\":\"HTTP_Request2\"},{\"key\":\"php\",\"label\":\"PHP\",\"variant\":\"pecl_http\"},{\"key\":\"powershell\",\"label\":\"PowerShell\",\"variant\":\"RestMethod\"},{\"key\":\"python\",\"label\":\"Python\",\"variant\":\"http.client\"},{\"key\":\"python\",\"label\":\"Python\",\"variant\":\"Requests\"},{\"key\":\"r\",\"label\":\"R\",\"variant\":\"httr\"},{\"key\":\"r\",\"label\":\"R\",\"variant\":\"RCurl\"},{\"key\":\"ruby\",\"label\":\"Ruby\",\"variant\":\"Net::HTTP\"},{\"key\":\"shell\",\"label\":\"Shell\",\"variant\":\"Httpie\"},{\"key\":\"shell\",\"label\":\"Shell\",\"variant\":\"wget\"},{\"key\":\"swift\",\"label\":\"Swift\",\"variant\":\"URLSession\"}]","languageSettings":[{"key":"csharp","label":"C#","variant":"HttpClient"},{"key":"csharp","label":"C#","variant":"RestSharp"},{"key":"curl","label":"cURL","variant":"cURL"},{"key":"dart","label":"Dart","variant":"http"},{"key":"go","label":"Go","variant":"Native"},{"key":"http","label":"HTTP","variant":"HTTP"},{"key":"java","label":"Java","variant":"OkHttp"},{"key":"java","label":"Java","variant":"Unirest"},{"key":"javascript","label":"JavaScript","variant":"Fetch"},{"key":"javascript","label":"JavaScript","variant":"jQuery"},{"key":"javascript","label":"JavaScript","variant":"XHR"},{"key":"c","label":"C","variant":"libcurl"},{"key":"nodejs","label":"NodeJs","variant":"Axios"},{"key":"nodejs","label":"NodeJs","variant":"Native"},{"key":"nodejs","label":"NodeJs","variant":"Request"},{"key":"nodejs","label":"NodeJs","variant":"Unirest"},{"key":"objective-c","label":"Objective-C","variant":"NSURLSession"},{"key":"ocaml","label":"OCaml","variant":"Cohttp"},{"key":"php","label":"PHP","variant":"cURL"},{"key":"php","label":"PHP","variant":"Guzzle"},{"key":"php","label":"PHP","variant":"HTTP_Request2"},{"key":"php","label":"PHP","variant":"pecl_http"},{"key":"powershell","label":"PowerShell","variant":"RestMethod"},{"key":"python","label":"Python","variant":"http.client"},{"key":"python","label":"Python","variant":"Requests"},{"key":"r","label":"R","variant":"httr"},{"key":"r","label":"R","variant":"RCurl"},{"key":"ruby","label":"Ruby","variant":"Net::HTTP"},{"key":"shell","label":"Shell","variant":"Httpie"},{"key":"shell","label":"Shell","variant":"wget"},{"key":"swift","label":"Swift","variant":"URLSession"}],"languageOptions":[{"label":"C# - HttpClient","value":"csharp - HttpClient - C#"},{"label":"C# - RestSharp","value":"csharp - RestSharp - C#"},{"label":"cURL - cURL","value":"curl - cURL - cURL"},{"label":"Dart - http","value":"dart - http - Dart"},{"label":"Go - Native","value":"go - Native - Go"},{"label":"HTTP - HTTP","value":"http - HTTP - HTTP"},{"label":"Java - OkHttp","value":"java - OkHttp - Java"},{"label":"Java - Unirest","value":"java - Unirest - Java"},{"label":"JavaScript - Fetch","value":"javascript - Fetch - JavaScript"},{"label":"JavaScript - jQuery","value":"javascript - jQuery - JavaScript"},{"label":"JavaScript - XHR","value":"javascript - XHR - JavaScript"},{"label":"C - libcurl","value":"c - libcurl - C"},{"label":"NodeJs - Axios","value":"nodejs - Axios - NodeJs"},{"label":"NodeJs - Native","value":"nodejs - Native - NodeJs"},{"label":"NodeJs - Request","value":"nodejs - Request - NodeJs"},{"label":"NodeJs - Unirest","value":"nodejs - Unirest - NodeJs"},{"label":"Objective-C - NSURLSession","value":"objective-c - NSURLSession - Objective-C"},{"label":"OCaml - Cohttp","value":"ocaml - Cohttp - OCaml"},{"label":"PHP - cURL","value":"php - cURL - PHP"},{"label":"PHP - Guzzle","value":"php - Guzzle - PHP"},{"label":"PHP - HTTP_Request2","value":"php - HTTP_Request2 - PHP"},{"label":"PHP - pecl_http","value":"php - pecl_http - PHP"},{"label":"PowerShell - RestMethod","value":"powershell - RestMethod - PowerShell"},{"label":"Python - http.client","value":"python - http.client - Python"},{"label":"Python - Requests","value":"python - Requests - Python"},{"label":"R - httr","value":"r - httr - R"},{"label":"R - RCurl","value":"r - RCurl - R"},{"label":"Ruby - Net::HTTP","value":"ruby - Net::HTTP - Ruby"},{"label":"Shell - Httpie","value":"shell - Httpie - Shell"},{"label":"Shell - wget","value":"shell - wget - Shell"},{"label":"Swift - URLSession","value":"swift - URLSession - Swift"}],"layoutOptions":[{"value":"classic-single-column","label":"Single Column"},{"value":"classic-double-column","label":"Double Column"}],"versionOptions":[],"environmentOptions":[{"value":"0","label":"No Environment"},{"label":"Rasayel REST API","value":"34761025-e236d1a7-f50a-44f6-9f9c-37ccbdc8e9aa"}],"canonicalUrl":"https://rest.developers.rasayel.io/view/metadata/2sA3JJ9i7g"}