Authentiction with Gmail

Step 1: Obtain Password

If you choose to register to Opentact with your Gmail account, Opentact will send you an email with your password. Here is how the email looks like:

Step 2: Generate Base64 Key

Next, you will take your gmail and password above to generate a base64 key using the following command in Linux:

echo -n 'testuser@gmail.com:18aec2c0-1e9c-48d9-b7a2-363063a153ff' | base64 

You should obtain from the above command a token like this:

dGVzdHVzZXJAZ21haWwuY29tOjE4YWVjMmMwLTFlOWMtNDhkOS1iN2EyLTM2MzA2M2ExNTNmZg==

You can revert the token with the following command:

echo -n 'dGVzdHVzZXJAZ21haWwuY29tOjE4YWVjMmMwLTFlOWMtNDhkOS1iN2EyLTM2MzA2M2ExNTNmZg==' | base64 -d

testuser@gmail.com:18aec2c0-1e9c-48d9-b7a2-363063a153ff%

Step 3: Generate API Token

You can use the following command to generate API token which you can use to execute Openatct APIs:

curl https://api.opentact.org/rest/auth --header 'Authorization: Basic aW5oZXJpdGVkYXJ0c0BnbWFpbC5jb206MThhZWMyYzAtMWU5Yy00OGQ5LWI3YTItMzYzMDYzYTE1M2Zm'

Here is an example output:

{
  "success": true,
  "payload": {
    "created_on": "2020-10-19T05:32:33.415Z",
    "modified_on": "2024-02-27T07:41:48.945Z",
    "uuid": "4521f972-dcc7-4755-be99-dacc1892abb4",
    "email": "alexey.matvienko@gmail.com",
    "phone_number": "343434334",
    "first_name": "Алексей",
    "wss_online": false,
    "last_name": "М",
    "avatar": "https://s3.opentact.org/avatar/4521f972-dcc7-4755-be99-dacc1892abb4.png",
    "dob": null,
    "role": "User",
    "gender": null,
    "deleted_on": null,
    "token": "eyJhbGciOiJIUzR5cCI6IkpXVCJ9.eyJ1dWlkIjoiNDUyMWY5Ny00NzU1LWJlOTktZGFjYzE4OTJhYmI0Iiwicm9sZSI6IkFkbWluIiwiZG9tYWluIjoib3BlbnRhY3Qub3JnIiwixNzA5NTM0OTc1LCJleHA2MjEzNzQeUPpllWBc7hyvpt063VuVJMOeFPFmbFq4k",
    "account": {
      "created_on": "2020-09-28T09:20:22.830Z",
      "modified_on": "2020-10-02T05:59:55.196Z",
      "uuid": "4c1645f4-8be8-4f6d-a4ff-f0ac33ed6ada",
      "email": "info@denovolab.com",
      "name": "DENOVOLAB",
      "phone": 87015260731,
      "level": "Level2",
      "address1": null,
      "address2": null,
      "zip_code": null,
      "city": null,
      "deleted_on": null,
      "disabled_on": null,
      "balance": 0
    }
  }
}// Some code

The token you used above can be used for executing Opentact API.

"token": "eyJhbGciOiJIUzR5cCI6IkpXVCJ9.eyJ1dWlkIjoiNDUyMWY5Ny00NzU1LWJlOTktZGFjYzE4OTJhYmI0Iiwicm9sZSI6IkFkbWluIiwiZG9tYWluIjoib3BlbnRhY3Qub3JnIiwixNzA5NTM0OTc1LCJleHA2MjEzNzQeUPpllWBc7hyvpt063VuVJMOeFPFmbFq4k",// Some code

Last updated