Calls to API

How to make different calls to the API in the process for creating an experience in ATRIA

ATRIA use cases constructors

Introduction

Once your preset configuration is designed, whether for Generative AI or RAG, you can proceed to use the API to continue with the process of creating experiences in ATRIA.

The current document includes a specific procedure for calling APIs. You can access more detailed technical content in this document: Create and configure a preset

Prerequisites

These prerequisites are common for all the tasks included in the following sections.

  • Download the aura-configuration-api API swagger

  • Make sure you have available Postman or a similar tool to call the API.

  • Connect to the intended environment for your preset, by modifying the corresponding {{baseUrl}} and {{apiKey}}.

1. Create a new preset

  1. Open the Postman application and select the POST call:
    aura-services > v2 > configuration > presets > Adds a new preset

  2. Copy and paste the content of your configured preset (JSON file) in the body.

  3. Send the POST request.


2. Update an existing preset

  1. Do you have your preset on hand?
  • No: Go to step 2.
  • Yes: Go directly to step 3.
  1. Access your intended preset:
    2.1. Open the Postman application.
    2.2. Make a GET request to the API with the preset ID.
    aura-services > v2 > configuration > presets > {presetId} > Gets all the info associated to one preset
    This will show you the entire preset to be updated.


  1. Select the PATCH call:
    aura-services > v2 > configuration > presets > {presetId} > Updates some info associated to one preset

  2. Copy and paste the content of your preset (JSON file) with the required updates in the body.


  1. Copy and paste the ID of the preset in the params field.


  1. Send the PATCH request.

3. Create an application

Once your preset is created, it must be placed on an application to be used by an experience.

An application must always contain at least one preset, it cannot be empty.

  1. Configure the application JSON file

    1.1. Copy the application template below.

    Application template

       ```json
         {
             "brand": "10000",
             "id": "816bdab6-3ea3-4a77-bdea-12945d6d7052",
             "models": {
                 "level": "user",
                 "presets": [
                     "19c58923-6fc5-4459-8f9e-822af2136ab1"
                 ]
             },
             "name": "app"
         }    
       ```
    

    1.2. Modify the template below as required by defining the following fields:
    • brand: Identifier of the Telefónica Brand associated to the application. Available values in the document Telefónica brands management.
    • id: Unique identifier of the application in UUID format.
    • name: Unique application name.

    1.3. Include the required presets in your application (presets field in the application template above)

  2. Open the Postman application and select the POST call:
    aura-services > v2 > configuration > applications > Adds a new application

  3. Copy and paste the content of your new application (JSON file) in the body.

  4. Send the POST request.


4. Add a preset to an existing application

  1. Do you have your application on hand?
  • No: Go to step 2.
  • Yes: Go directly to step 3.
  1. Access your intended application
    2.1. Open Postman.
    2.2. Make a GET request to the API with the application ID:
    aura-services > v2 > configuration > applications > {applicationId} > Gets all the info associated to one application
    This will show you the entire application to be updated.


  1. Select the PATCH call:
    aura-services > v2 > configuration > applications > {applicationId} > Updates some info associated to one application

  2. Copy and paste the content of your application (JSON file) in the bodyand add the preset ID to be associated to the application.


  1. Copy and paste the ID of the application in the params field.


  1. Send the PATCH request.

5. Get info about available presets/applications

If you need to know which presets or applications are available in your environment, follow these steps:

  1. Open Postman and select the following GET calls:

    • For presets:
      aura-services > v2 > configuration > presets > Gets all presets info
    • For applications:
      aura-services > v2 > configuration > applications > Gets all application info
  2. In order to view all the parameters related to presets or applications, deselect the options excludeParams and includeParams.

  3. Send the corresponding GET request.



6. Delete a preset/application

  1. Open Postman and select the following DELETE calls:

    • For presets:
      aura-services > v2 > configuration > presets > {presetId} > Delete one preset
    • For applications:
      aura-services > v2 > configuration > applications > {applicationId} > Delete one application
  2. Send the corresponding DELETE request.