Metadata endpoint

This endpoint provides information related to the entities/tables configured in the current set: “tenant-clientId-configurationId”.
This means that for the configuration set for the current credentials, you have access to the information of the entities/tables returned in this endpoint.
The metadata endpoint only shows by default the default configuration if no specific configuration is provided. If you specify an concrete configuration by parameter, it will only show that one. So it will always return just one configuration.

Url: https://data.youforce.com/data/v1/metadata

GET → /data/v1/metadata

Let’s start by explaining how pagination works in this endpoint. These are the pagination fields that you can find in the Metadata endpoint:

  • pageSize (integer): amount of configured mappings that the response will contain. The default value is 10.
  • totalCount (integer): total amount of configured mappings in the data base.
  • totalPages (integer): total amount of existing pages given the pageSize and totalCount values.
  • hasPreviousPage (boolean): indicate whether there is a page with more values before the current page.
  • hasNextPage (boolean): indicate whether there is a page with more values after the current page.
  • currentPage (integer): page number that you want to retrieve. It can be below or equal to the ‘totalPages’ value in the response. Values ‘hasPreviousPage’ and ‘hasNextPage’ will also indicate if there is a page with more values before or after the current page. The default value is 1.

And these are some case scenarios you can find while looping through the pages:

  • Send the first request without pagination parameters:
    - The currentPage is set to 1 (default value)
    - The pageSize is set to 10 (default value)
    Check the pagination metadata returned in the response:
    - totalPages will contain the total number of pages available
    - hasNextPage will contain whether another page exists after the current one
  • Send the first request with pagination parameters:
    - Choose the desired currentPage (by default is 1)
    - Choose an appropriate pageSize (by default is 10)
    Check the pagination metadata returned in the response:
    - totalPages will contain the total number of pages available
    - hasPreviousPage will contain whether another page exists before the current one
    - hasNextPage will contain whether another page exists after the current one
  • Loop through pages:
    - While hasNextPage is true, consumer can increment the currentPage value by 1 and make another request
    - When hasNextPage is false, you have reached the last page so consumer can stop the loop

Parameters

  • Header parameters: Authorization (Bearer)
  • Path parameters: None
  • Query parameters:
    • EntityName: Explicit name of the entity which configuration needs to be retrieved. There might be several entities configured through different configurations.
    • EntityVersion: In case of existing several versions for the entities, this parameter will retrieve the configurations with entities for that version alone.
    • ConfigurationId: Id of a certain configuration for that clientId. If this parameter is not provided, the endpoint will return only the default configuration.
  • Body parameters: None
curl --location 'https://data.youforce.com/data/v1/metadata?EntityName=sickness-case&EntityVersion=1&ConfigurationId=testing-default-4028868' \
--header 'Authorization: Bearer abc’

Response

If all went well it will return an OK response code → 200 OK

Explanation of the fields:

  • Name: name of the entity
  • Version: version of the entity
  • odsName: name of the table from which you want to extract the information
  • Fields: different fields that are configured along with some information about them:
    • Name: name of the field that will be shown
    • odsName: name of the field in the table from which you want to extract the information
    • Type: type of data (like string or integer)
    • isKey: it indicates whether the field is part of the key of the entity
    • isSelected: where the field is selected to be shown in the output.
{
    "items": [
        {
            "name": "person",
            "version": 1,
            "odsName": "TBL_Person",
            "fields": [
                {
                    "name": "Id",
                    "odsName": "ID",
                    "type": "Int32",
                    "isKey": true,
                    "isSelected": true
                },
                {
                    "name": "PersonBK",
                    "odsName": "Person_BK",
                    "type": "String",
                    "isKey": false,
                    "isSelected": true
                },
                {
                    "name": "FirstName",
                    "odsName": "PersonFirstName",
                    "type": "String",
                    "isKey": false,
                    "isSelected": true
                },
                {
                    "name": "LastName",
                    "odsName": "PersonLastName",
                    "type": "String",
                    "isKey": false,
                    "isSelected": true
                },
                {...}
            ],
            "configurationId": "testing-default-4028868"
        },
        {...}
    ],
    "totalCount": 7,
    "currentPage": 1,
    "pageSize": 10,
    "totalPages": 1,
    "hasPreviousPage": false,
    "hasNextPage": false
}