How to get the EntityUuid of custom field?
search cancel

How to get the EntityUuid of custom field?

book

Article ID: 217853

calendar_today

Updated On:

Products

CA API Developer Portal

Issue/Introduction

Creating an application via PAPI call with the custom field value requires the EntityUuid value of the custom field. The custom field PAPI endpoints will provide only the entity type value and not the entity uuid.

Environment

This article was validated on version 5.0 of the API Developer Portal.

Resolution

Uuid can be auto generated as noted in the swagger file sample provided in the document: swagger file in Portal 5.2

Here is a sample code that was tested with portal 5.0:

Body JSON 

{  

     "Uuid": "{{GENERATED_GUID}}",

     "Name": "TestAPPP-CusField",

     "OrganizationUuid": "a6d03c5b-b293-40bb-a59f-d1c68578b016",

     "Description": "Sample APP ",

     "Status": "ENABLED",

    "ApiIds":  {

        "results":  [

                "26d6f3da-db72-4de1-a7fa-697a19a08d3a"

        ]

    },

  "ApiApiPlanIds": {

    "results": [

      {

        "ApiUuid": "c31b46ee-3ae1-4a4f-8040-91c0064ead89",

        "ApiPlanUuid": "19adddf2-c27f-4790-bcfa-c79803890ede"

      }

    ]

  },

    "CustomFieldValues": {

    "results": [

    {

        "Uuid": "{{GENERATED_UUID}}",

        "EntityUuid": "{{GENERATED_UUID}}",

        "CustomFieldUuid": "ae26350b-00b3-4090-98ad-68ab18e7b84b",

        "Value": "Staging"

      }

    ]

  }      

}

 

Results Successful {POST PAPI Application with Customer fields 

 

{

    "__metadata": {

        "uri": "https://apim-ssg.mydomain.net:9443/tenant45/Applications('7aa57982-7138-4e52-94df-4cc979445375')"

    },

    "OrganizationName": null,

    "Description": "Sample APP ",

    "ApiKey": "l72551feb0c9794d49955ea6fbb8ca87d5",

    "MagMasterKey": "f0539949-1a0f-458a-bf48-ec4d2294414a",

    "Reason": null,

    "Name": "TestAPPP-CusField",

    "OauthScope": null,

    "KeySecret": "c7f523c568324e42a6c2f2c393a08fa1",

    "OauthCallbackUrl": null,

    "MagScope": null,

    "Status": "ENABLED",

    "DisabledByType": null,

    "ShouldHash": null,

    "OauthType": null,

    "OrganizationUuid": "a6d03c5b-b293-40bb-a59f-d1c68578b016",

    "Uuid": "7aa57982-7138-4e52-94df-4cc979445375",

    "ApiIds": {

        "results": [

            "26d6f3da-db72-4de1-a7fa-697a19a08d3a"

        ]

    },

    "CustomFieldValues": {

        "results": [

            {

                "Status": "ENABLED",

                "Options": "[]",

                "TenantId": "tenant45",

                "Type": "TEXT",

                "EntityUuid": "7aa57982-7138-4e52-94df-4cc979445375",

                "Uuid": "670ed3f6-cbad-453c-a2fd-c6db32bbb306",

                "Required": true,

                "Value": "Staging",

                "CustomFieldUuid": "ae26350b-00b3-4090-98ad-68ab18e7b84b",

                "Name": "SteveCustom"

            }

        ]

    },

    "ApiApiPlanIds": {

        "results": [

            {

                "ApiUuid": "c31b46ee-3ae1-4a4f-8040-91c0064ead89",

                "ApiPlanUuid": "19adddf2-c27f-4790-bcfa-c79803890ede"

            }

        ]

    },

    "ApiGroupIds": {

        "results": []

    }

}