Generation of embedded components for external pages

Tabla de contenidos

Athento allows you to generate external components to use on external pages.

To do so, we must go to Athento’s embedded components page. It can be accessed from:

https://mycompany.athento.com/embed-components

Replace mycompany with your company name.

On this page we will see two sections:

  • Configuration section (Section 1): In this section you must specify the configuration of the component we want to generate, selecting a type and the data needed to configure a component of that type. We will have documentation available for each component, so that we can know how to configure each of the data.

Select the spaces, the forms, the default field values, or those that you want to be editable when creating a document.

  • Generation section (Section 2): In this section we will be able to see the code of the embedded component to copy it and use it on an external page, and we can also see a preview of the component, with the aim of seeing whether we have configured it correctly and the data that will be seen on the external page. It has three tabs: Code, Preview and API.

With this, we will be able to have an Athento component embedded in another external page.

**Note: This page is accessible only to superusers.

How to generate the component from another application (API tab)

The API tab in the generation section shows you how to request the same component from Athento from another application, without going through this page.

  1. Fill in the configuration section and click Generate.
  2. Open the API tab in the generation section.
  3. Review the information it displays:
    • Endpoint: the URL of your instance to which the request is sent (POST).
    • Request payload: the request body with the data you have filled in, including the client ID and the client secret.
    • Example response: the response returned by Athento, with the HTML of the generated component.
    • cURL: the full command to make the request.
  4. Click Copy cURL to copy the command to the clipboard, replace <ACCESS_TOKEN> with a valid access token and run it.

If you haven’t generated any component yet, the tab shows a generic example with the values <CLIENT_ID> and <CLIENT_SECRET>.

Keep the following in mind:

  • The request must be made by a team administrator user.
  • The cURL includes your real client secret. Treat it like a password: do not share it or paste it into tickets or screenshots.
  • Each call generates a new access token, which is included inside the returned HTML, so each generated component has its own token.
  • In document table components, if the client ID or the client secret do not correspond to an Athento OAuth application, the component is not generated and the error Invalid client_id or client_secret. is shown.

Document table component

See how this type of component works here:

https://help.athento.com/es/docs/como-embeber-una-tabla-de-documentos-de-athento-en-una-web-o-aplicacion-externa/