Documentation

Documentation

Receiving HTTP requests: webhook / postback

These are ordinary server-to-server HTTP requests. In some services they may be called HTTP notifications, as in the case of CoMagic. They are supported universally:

  • CRM systems: AmoCRM, PipeDrive...
  • Call tracking: CoMagic, CallTouch...
  • CPA trackers: Affise, HasOffers...
  • Mobile trackers: Yandex Metrika, AppsFlyer...
  • And many others

Endpoint#

POST https://yourdomain/<service>/<event_name>/<project_id>
GET  https://yourdomain/<service>/<event_name>/<project_id>?param=values&...

or without a project id (0 will be recorded)

POST https://yourdomain/<service>/<event_name>

some values can be passed as GET parameters, including the event name and the project id

GET  https://yourdomain/<service>/<event_name>?param=values&...
GET  https://yourdomain/<service>/<event_name>?projectId=<project_id>&...
GET  https://yourdomain/<service>?name=<event_name>&projectId=<project_id>&...

even for a POST request

POST https://yourdomain/<service>?name=<event_name>&projectId=<project_id> <<< {data: "mydaa"}

Incoming data format#

  • GET requests
  • POST with data in JSON or URLEncoded
  • You can use POST and url parameters at the same time

Example using Curl#

A regular GET request

$ curl https://test.rstat.org/calltrack/call/99?param=myparamvalue
{"key":"in.gen.calltrack.call","id":"6462462774336290816"}

The name and projectId values can be passed as GET parameters

$ curl https://test.rstat.org/calltrack?name=call
{"key":"in.gen.calltrack.call","id":"6462463595723620353"}

A POST request passing data as JSON

$ curl -X POST -H "Content-Type: application/json" https://yourdomain/calltrack/call \\
    -d '{"key1":"value1", "key2":"value2"}'
{"key":"in.gen.calltrack.call","id":"6462462774336290816"}

A POST request passing data as urlencoded

$ curl -X POST -H "Content-Type: application/x-www-form-urlencoded" https://yourdomain/calltrack/call \\
    -d "param1=value1&param2=value26"
{"key":"in.gen.calltrack.call","id":"6462462774336290816"}

The services will receive the message

{ 
  "key": "in.gen.calltrack.call", 
  "channel": "http", 
  "service": "calltrack", 
  "name": "call", 
  "projectId": 0, 
  "uid": "6462464730849083392", 
  "td": { "ip": "109.252.93.158", "ua": "curl/7.60.0" }, 
  "data": { 
    "param1": "value1", 
    "param2": "value26" 
  }, 
  "id": "6462464730849083393", 
  "time": 1540771658623 
}