Manage Applications through API

You, as an administrator or a super user, have an option to manage registered applications through an API. Using the API, you can:

  • Fetch the information for all the registered applications from the Applications tab.
  • Review applications' details.
  • Check the applications' status (if the client ID and the secret key need to be assigned to these applications).
  • Update the issued client ID and secret key of the registered applications (against each unique Application ID).
  • Update credentials for applications.

Get Token

To access the registered applications, you have to get the authorization token first by sending the following request to the Authorization service:

POST https://auth.edifecsfedcloud.com/auth/realms/main/protocol/openid-connect/token

The request body must contain the following data in the format x-www-form-urlencoded:

Key Sample Value Description
grant_type password Authorization client grant type
username your_email@mail.com The user name you use to sign in to the Directory
password Abcd123$ The password you use to sign in to the Directory
client_id fdp-service-frontend Authorization client ID

Add the following script to the request, for the access token to be used as a global variable:

Copy
var jsonData = pm.response.json();
console.log(jsonData);
postman.setGlobalVariable("access_token", jsonData.access_token); 

Fetch the details of the registered applications through the API

You can fetch the details of the registered applications through the API from the Applications tab based on the following items:

  • Redirect or callback URLs

    Note You can enter only one redirect URL for search at one time.

  • A client ID's and secret key's status (Assigned or Not Assigned)
  • Payer Account ID (Portal ID)

Use the following APIs to access the application information, add/update the client ID and the secret key, and update credentials for applications:

  • To access the application, send the following request:

    https://fdp.edifecsfedcloud.com/api/fdp/portal/applications?SearchParameter = value

  • To add/update the client ID and the secret key, send the following request:

    https://fdp.edifecsfedcloud.com/api/fdp/portal/(portalId)/applications/{applicationID}/credentials

  • To update credentials for applications, send the following request:

    PUT https://fdp.edifecsfedcloud.com/api/fdp/portal/{YourPortalId}/application/{ApplicationID}/credentials

    The request body must contain the following data in the format x-www-form-urlencoded:

    Key Sample Value Description
    clientId test Update the Client ID and the Client Secret credentials.
    clientSecret test key
    version 2 The current version of your application.

If the operation is successful, you receive a response in the JSON format. When a failure occurs, a JSON object with the error code and error message are returned.

Search for Registered Applications

To get applications of a certain organization from the Applications tab, send the following request:

GET https://fdp.edifecsfedcloud.com/api/fdp/portal/search/applications

Curl request:

curl -X GET "https://fdp.edifecsfedcloud.com/api/fdp/portal/search/applications" -H "accept: application/json"

To get applications based on the organization type (payer, provider, logistics, employer, retailer, vendor, and other) from the Applications tab, send the following request:

GET https://fdp.edifecsfedcloud.com/api/fdp/portal/search/applications?organizationtype = value

Curl request:

curl -X GET "https://fdp.edifecsfedcloud.com/api/fdp/portal/applications?organizationtype = value" -H "accept: application/json"

Callback URL/Redirect URL

You can also search for applications by Callback URL or Redirect URL, to do this, send the following requests:

GET https://fdp.edifecsfedcloud.com/api/fdp/portal/applications?callbackUrl=value

GET https://fdp.edifecsfedcloud.com/api/fdp/portal/applications?redirectUrl=value

Curl requests:

curl -X GET "https://fdp.edifecsfedcloud.com/api/fdp/portal/applications?callbackUrl=value" -H "accept: application/json"

curl -X GET "https://fdp.edifecsfedcloud.com/api/fdp/portal/applications?redirectUrl=value" -H "accept: application/json"

Client ID's and Secret Key's status

You can also search for applications by a client ID's and secret key's status (Assigned or Not Assigned), to do this, send the following requests:

GET https://fdp.edifecsfedcloud.com/api/fdp/portal/applications?status = Assigned

GET https://fdp.edifecsfedcloud.com/api/fdp/portal/applications?status = NotAssigned

Curl requests:

curl -X GET "https://fdp.edifecsfedcloud.com/api/fdp/portal/applications?status=Assigned" -H "accept: application/json"

curl -X GET "https://fdp.edifecsfedcloud.com/api/fdp/portal/applications?status=NotAssigned" -H "accept: application/json"

Portal ID

You can also search for applications by Portal ID, to do this, send the following requests:

GET https://fdp.edifecsfedcloud.com/api/fdp/portal/applications?portalId = value

Curl request:

curl -X GET "https://fdp.edifecsfedcloud.com/api/fdp/portal/applications?portalId = value" -H "accept: application/json"

Use the following request parameters:

Key Sample Value Parameter description
searchText app Text in the application's name or description to search by
organizationName best hospital Organization that published the application
organizationIds bh_1234 ID of the organization that published the application

Add the following request header with the access token as a global variable:

Key Value
Authorization Bearer {{access_token}}

If the operation is successful, you receive a response in the JSON format.

The response from the API can contain the following details.

When a failure occurs, a JSON object with the error code and error message are returned.

Access API using an application user

Application users registered in Smart Trading Cloud and added to specific user groups can access APIs with any application and automate the process.

Note Application users are not the developers who registered their applications in the Developer Portal. They are the pseudo users created by account administrators and used for automated systems, which means any application on the payer's side that may need access to data submitted to the Developer Portal.

To access an API using an application user, complete the following steps:

  1. Create an application user.
  2. Get application user credentials.
  3. Access an API using the application user.

To access an API using an application user:

  1. Start Postman or any other API Client to access the API.
  2. Add a request (GET or POST).
  3. On the Authorization tab, from Type, select No Auth.
  4. On the Headers tab, in KEY, enter Authorization, and then in VALUE, enter CLAPP <key extracted from the credentials.stcc file>.
  5. In Enter request URL, paste the link to the application endpoint, for example, https://fdp.edifecsfedcloud.com/api/fdp/portal/applications?<YourRequestValue>.
  6. Click Send. The API Client should receive a 200 Ok response.