Skip to main content
Version: 3

Generating an API Key

The consumer requires to generate an API Key to access RESTful Web Service (authenticated by an API Key) for the Provider. Following table lists the reference values a consumer will use while generating an API Key.

| REST URL | https://<connect>:<port>/rest/apikey/generate?providerId=<provider entity id> | | Method Type | POST | | Authentication Type | Basic | | User ID & Password | As defined in Adeptia Connect | | Request headers | | Request content type | Content-Type: application/json | | Response content type | Accept: text/plain




| Information | You must specify the response content type as text/plainin the request header. Else, you will receive the following error message in the response.

HTTP 406 Not Acceptable. |
| --- | --- | |

Input ParametersInput Parameters
Provider IDWeb Service Provider Activity ID as a query parameter value. This query parameter value is important; as it is used for token authentication when consumer hits the actual endpoint created with Web Service Provider activity.

Perform the following steps to get providerId.

• Login to Adeptia Connect.
• Go to Configure > Web Services > REST Provider.
• Select the provider activity and click View to open the View Page from more menu.
• Locate the Entity Id from the view page and use it as a providerId.
Request Payload DataFor payload data, the parameters should be same as the key parameters defined while creating the security policy. Perform the following steps to get the parameters:

• Login to Adeptia Connect.
• Go to Configure > Web Services > Security Policy.
• Click the Security Policy activity used for the Provider.
• Expand Authentication Properties.
• Select Authentication check box and then select API Key as a value in Authentication Type drop-down list box.
• Use these key parameters as a form data or as a request body in JSON format as shown below.


Request Payload Data Example
{
  "customer_name" : "Loue",
  "order_id" : "12OR2016",
  "company" : "IBM"
}

|

ResponseResponse
SuccessYou will receive an API Key as shown below.

Return JWT Example

APIKey eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiIxMjM0NTY3ODkwIiwibmFtZS

I6IkpvaG4gRG9lIiwiYWRtaW4iOnRydWV9.TJVA95OrM7E2cBab30RMHrHDcEfxjoYZgeFON

Fh7HgQ
Errors400: Bad Request (if any of the required information in payload data or providerId is missing)

401: Unauthorized (if the user id and password are incorrect or not provided)

500: Internal Server Error

You may be interested in...

What's new​
Best practices​
Training guides​
Frequently asked questions​
Adeptia Connect APIs​
OAuth Authentication​
Kerberos Authentication​