Examples

Two steps are enough: log in with your API key, then use the returned Auth token to call any function.

Language
1

Log in with your API key

Call the Login function and send your API key as a Bearer token. The response contains the Auth token that you use in every other request.

GET https://rest.crmango.com/api/Login

Request

curl --request GET \
  --url 'https://rest.crmango.com/api/Login' \
  --header 'Authorization: Bearer your-api-key'

Response

HTTP 200
{
  "code": 200,
  "auth_token": "7f23e6csdf231f91d572458sd2283Df097a1f14ed011e4a9520a8dd10aa3ef82789"
}
2

Call a function with the Auth token

Send the Auth token as a Bearer token and call any function. This example gets all activities and prints them.

GET https://rest.crmango.com/api/GetAllActivities

Request

curl --request GET \
  --url 'https://rest.crmango.com/api/GetAllActivities' \
  --header 'Authorization: Bearer your-auth-token'

Response

HTTP 200
{
  "code": 200,
  "response": [
    {
      "id": 48213,
      "note": "Phone call - offer follow-up",
      "timefrom": 1792398600,
      "timeto": 1792399800,
      "date": 1792368000,
      "source": "",
      "type_id": 1,
      "userid": 7,
      "company_id": 1204,
      "orderid": 0,
      "person_id": 311,
      "company_name": "Alfa Stav s.r.o.",
      "updated_at": 1792399920
    },
    {
      "id": 48214,
      "note": "Site visit, Bratislava",
      "timefrom": 1792404000,
      "timeto": 1792412100,
      "date": 1792368000,
      "source": "GPS tracker",
      "type_id": 4,
      "userid": 7,
      "company_id": 1187,
      "orderid": 5521,
      "person_id": 298,
      "company_name": "Bytservis Plus a.s.",
      "updated_at": 1792412400
    },
    {
      "id": 48230,
      "note": "Contract preparation",
      "timefrom": 1792501200,
      "timeto": 1792506600,
      "date": 1792454400,
      "source": "",
      "type_id": 2,
      "userid": 12,
      "company_id": 1204,
      "orderid": 5530,
      "person_id": 311,
      "company_name": "Alfa Stav s.r.o.",
      "updated_at": 1792506660
    }
  ]
}