Getting started
-
General considerations prior to using the API:
- The company that is going to use the API must have a valid username and password in the DANAConnect platform.
- For security reasons, the user who is going to use the API must have a special permission. Your DANAConnect Account Manager must ensure that this permission is enabled.
- Some of DANAConnect API work on Conversations (flows) that have previously been created and are active in the platform. This means that you must have the Conversation ID (conversationID) for this flow. You can see how to find this ID below, in point 4.
- The specific considerations for each API are included in the API specification
-
Authentication to the API
The API uses the same user credential system that is used to enter the DANAConnect platform. The method used for all DANAConnect APIs is HTTP BASIC AUTH, which is based on login and password authentication.
Login: The login consists of the username concatenated with an @ and followed by the company code.
Login example:
- Platform username : myuser
- Company code : mycompanycode
- Login for DANAConnect API : myuser@mycompanycode
- Password : The password you should use for API authentication is the same as you use for login to the DANAConnect platform.
-
Authentication to the API v2 (OAuth2)
The API v2 uses OAuth2 authentication with the Client Credentials grant type. This method is designed for server-to-server communication where no user interaction is required.
Prerequisites
- You must have a valid client application registered with DANAConnect
-
Your DANAConnect Account Manager will provide you with:
- Client ID : A unique identifier for your application
- Client Secret : A confidential key used to authenticate your application
Obtaining an Access Token
To authenticate, you need to request an access token from the OAuth2 token endpoint:
Token Endpoint:
https://auth.danaconnect.com/oauth2/tokenRequest:
curl -X POST https://auth.danaconnect.com/oauth2/token \ -H "Content-Type: application/x-www-form-urlencoded" \ -d "grant_type=client_credentials" \ -u "YOUR_CLIENT_ID:YOUR_CLIENT_SECRET"Response:
{ "access_token": "eyJhbGciOiJSUzI1NiIsInR5cCI6IkpXVCJ9...", "token_type": "Bearer", "expires_in": 3600 }Using the Access Token
Once you have obtained an access token, include it in the
Authorizationheader of your API requests:curl -X GET https://appserv.danaconnect.com/api/2.0/your-endpoint \ -H "Authorization: Bearer YOUR_ACCESS_TOKEN" \ -H "Content-Type: application/json"Token Expiration and Renewal
-
Access tokens expire after the time specified in
expires_in(in seconds) - When a token expires, request a new one using the same client credentials
- It is recommended to implement token caching and refresh logic in your application to avoid unnecessary token requests
Security Best Practices
- Never expose your Client Secret in client-side code or public repositories
- Store credentials securely using environment variables or a secrets manager
- Use HTTPS for all API communications
- Implement proper error handling for authentication failures
-
Finding the Conversation ID
For most DANAConnect API requests, you will need to send the Conversation ID as a parameter
This conversation ID refers to the number assigned to the activation of the flow and can be found by logging into the DANAConnect platform and looking in the activation report for the conversation you need to refer to.
It is important to mention that every time a conversation is reactivated, a new Conversation ID will be generated.
Here is a video explaining how to find the conversation ID: -
Finding the tableCode
When using the Contact Bulk Load API you will need to pass the parameter tableCode in order to make a request. This parameter tableCode corresponds to the logical code of the database that should have been previously created in the DANAConnect platform where you wish to import the data. This code can be found by entering the Contact Manager module inside the DANAConnect platform and looking for the database to be used in the database list.
Here is a video explaining how to find the tableCode: