0
votes

Responses from Podio API returns an JSON array of items with a fields property. Each field carries its values and its config.

For example a category field for the Gender:

{
        "type": "category",
        "field_id": 219922852,
        "label": "Gender",
        "values": [
          {
            "value": {
              "status": "active",
              "text": "Prefer not to say",
              "id": 3,
              "color": "F7F0C5"
            }
          }
        ],
        "config": {
          "settings": {
            "multiple": true,
            "options": [
              {
                "status": "active",
                "text": "Male",
                "id": 1,
                "color": "DCEBD8"
              },
              {
                "status": "active",
                "text": "Female",
                "id": 2,
                "color": "F7F0C5"
              },
              {
                "status": "active",
                "text": "Prefer not to say",
                "id": 3,
                "color": "F7F0C5"
              }
            ],
            "display": "inline"
          },
          "mapping": null,
          "label": "Gender"
        },
        "external_id": "gender"
      },

  1. How can I fetch the config without having to query a specific item?
  2. Is there a way to get every field in the response? Because if the queried item does not have a field value set, Podio doesn't return it in the response.
  3. I would like to get the field config for ALL the fields. If possible, with a single API request. In particular I am interested in all the possible values (in case of Category or Relationship fields) so that I could match them with local values I have.

This way I can use the field structure to programmatically map some local values to the format required by the Podio API; and then generate a fields payload that to update/create Podio items via an API calls.

1

1 Answers

1
votes

You can request the Podio Get App method to get the app configuration.

Podio Doc Ref: https://developers.podio.com/doc/applications/get-app-22349