Skip to main content
Version: 2.0.0

Ejento API Access Guide

Overview

This guide outlines the steps required to authenticate and integrate with Ejento's APIs. Users must follow the authentication process to obtain access tokens, which are necessary for making API requests.

Authentication Process

To access Ejento’s APIs, users must complete the following steps:

  1. Register on the Authentication App

    • Use the registration API to create an account.
  2. Login and Obtain Tokens

    • Authenticate with your credentials to receive:
      • Authentication App Access Token (used for token refresh)
      • Ejento Access Token (used to access Ejento APIs)
  3. Token Refresh

    • When tokens expire, use the Authentication App Access Token to generate new ones without re-logging in.

Using Ejento APIs

Once authenticated, users can access Ejento’s APIs. Detailed endpoint documentation is available at docs.ejento.ai.

API Base URL

https://idejento.onedigital.com

Authorization Requirement

All API requests should include the Ejento Access Token as the authorization type Bearer Token in the request header.

API Endpoints

1. Create New Chat Thread

  • Endpoint: POST /api/agent/{agent_id}/chat-thread
  • Usage: This API initiates a new chat thread.

2. Create Agent Response

  • Endpoint: POST /api/agent/{agent_id}/response
  • Usage: This API is used to provide agent responses.
  • Important: The id field from the Create Chat Thread response should be used as chat_thread_id in Create Agent Response to maintain the session.

Users API Guide

Read All Users

Retrieve the list of registered users using the following API call:

curl -X 'GET'   'https://webapp-idamigo-od-eastus2-001.azurewebsites.net/api/users/?skip=0&limit=100'   -H 'accept: application/json'   -H 'Authorization: Bearer <token>'

Update User Information

Update a user’s details using their user_id.

Endpoint

PATCH /api/users/{user_id}

Example Request

curl -X 'PATCH'   'https://webapp-idamigo-od-eastus2-001.azurewebsites.net/api/users/<user_id>'   -H 'accept: application/json'   -H 'Authorization: Bearer <token>'   -H 'Content-Type: application/json'   -d '{
"email": "exampleuser@onedigital.com",
"is_active": true,
"is_superuser": false,
"full_name": "Pro Dev",
"password": "stringst"
}'

User Registration & Authentication Guidelines

  • User Registration:

    • Every user must be registered using the API. There is no alternative registration method.
  • Password Management:

    • You are responsible for securely storing user passwords.
    • User passwords do not expire, but access tokens expire after 2 days by default.
    • To prevent users from needing to log in frequently, a refresh token API is available to generate new tokens.
  • Token Generation:

    • Each user requires a unique access token to interact with the API.
    • Tokens are necessary for authentication and must be included in API requests.
  • Credential Storage:

    • Since the login process requires an email and password, you must securely store these credentials for user authentication.

By following this guide, users can successfully authenticate, register, and interact with Ejento’s APIs. For more details, visit docs.ejento.ai.