API Developer Portal: How to get the EntityUuid of custom field.
search cancel

API Developer Portal: How to get the EntityUuid of custom field.

book

Article ID: 217853

calendar_today

Updated On:

Products

CA API Developer Portal

Issue/Introduction

This article will discuss how to get the EnityUuid of a custom field for making PAPI calls to the API Portal.

Customer statement: "I need to create an application via PAPI call with the custom field value. To pass the custom field in the application creation input, I need EntityUuid value of the custom field. I know the entity type value which is APPLICATION, but how to get the corresponding EntityUuid. Even the custom field PAPI end points give 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 below - see the complete call 

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

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

Link for swagger file that describes what needs to be post for a new APP that has customer field

https://techdocs.broadcom.com/us/en/ca-enterprise-software/layer7-api-management/api-developer-portal/5-0/portal-apis/portal-api-papi/papi-swagger-file-5-0.html

I tested the values after creating the customer fields and GET on other meta-data needed  OrganationUuid, ApiIds, ApiPlanUuid, CustomFieldUuid

Used POSTMAN post PAPI

https://apim-ssg.t5.bpc.broadcom.net:9443/tenant45/Applications

 

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.t5.bpc.broadcom.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": []

    }

}