Graspil APi
  • Other languages
  • Change log
  • Connecting the bot
    • Connecting the getUpdates bot
    • Connecting a Bot via API
    • Outgoing Data Connection
    • Connecting a Mini App
    • Connecting the bot on the constructor
  • API
    • Authorization
    • Sending a target event/achieving a goal
    • Connecting the bot via the API
  • Platform
    • Processing of “start” (UTM) parameters
      • Configuring the “start” Parameter Processing
    • Commands/Actions
    • Attribution Models
Powered by GitBook
On this page
  1. API

Authorization

PreviousAPINextSending a target event/achieving a goal

Last updated 1 year ago

Graspil API uses keys to provide API access. You can get the key in your personal account.

To get the key, go to the “My bots” section, select the appropriate bot and click on the key icon.

Each bot has its own unique key.

Graspil API expects the key to be included in all API requests in the header, which looks like this:

Api-Key: meowmeowmeow

Replace the meowmeowmeow meow with your API key.

$ch = curl_init($url);
curl_setopt($ch, CURLOPT_HTTPHEADER, ['Api-Key: ' . $api_key]);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
$response = curl_exec($ch);
curl_close($ch);
import requests

headers = {"Api-Key": api_key}
response = requests.get(url, headers=headers)
fetch(url, {
  method: "GET",
  headers: {
    "Api-Key": api_key
  }
}).then();

.

Where to find the api key