v1
Guide

First call

Create an API key in the panel, store the credentials and make your first call: list and create a contact.

1. Create the API key

  1. Open the API keys

    In the panel, go to Settings → API keys (open).

  2. Create a key

    Give it a name that says what it is for, such as Website integration.

  3. Pick the scopes

    For this guide, pick View contacts and Create contacts. The key reaches only what its scopes cover.

  4. Copy the key and the secret

    The secret is shown only once. If you lose it, revoke the key and create another.

2. Store the credentials

The examples in this documentation read the credentials from environment variables, so the secret never shows up in code:

Terminal
export GURIA_API_KEY="sua_api_key"
export GURIA_API_SECRET="sua_api_secret"

3. List the contacts

Request
curl "https://api.guria.io/api/v1/contacts?page=1&pageSize=2" \
  -H "X-API-KEY: $GURIA_API_KEY" \
  -H "X-API-SECRET: $GURIA_API_SECRET"

The response carries the contacts on the page and the total. If you get 401, check both headers; if you get 403, the key is missing the scope.

4. Create a contact

Request
curl -X POST "https://api.guria.io/api/v1/contacts" \
  -H "X-API-KEY: $GURIA_API_KEY" \
  -H "X-API-SECRET: $GURIA_API_SECRET" \
  -H "Content-Type: application/json" \
  -d '{
    "name": "Fulano de Tal",
    "phoneNumber": "5511988887777",
    "email": "[email protected]"
  }'

The API answers 201 with the contact created. Its id is what you use in the next calls: open a deal, apply a tag, read the conversations.

Next steps