# User Fields & Subtypes APIs https://link.orangelogic.com/Tasks/2I3LO ## User Fields ### Base URL ``` https://cortex-site/webapi/objectmanagement/metadata/userfield ``` ### Endpoints #### <strong style='color:orange; font-size:20px; background-color:#f7f7f7; padding:10px'>GET /list_xxx_v1</strong> List (to see all the existing fields) Request: empty Response: ```json= [ { "Key": "Namspace.Field1", "FieldID":"ND000xxx", ... }, { "Key": "Namspace.Field2", "FieldID":"ND000xxx", ... }, ] ``` #### <strong style='color:orange; font-size:20px; background-color:#f7f7f7; padding:10px'>GET /get_xxx_v1</strong> Get properties for a specific field for API name or ID Request: ```json= { "FieldID":"ND00xxx", "FieldAPIName": "Namespace.Field1" } ``` Response: ```json= { "Key": "Namespace.Field1", "FieldID":"ND000xxx", "Property1": "value" ... } ``` #### <strong style='color:orange; font-size:20px; background-color:#f7f7f7; padding:10px'>POST /createorupdate_xxx_v1</strong> Create or update a user field, support field id and API Key Request: ```json= { "FieldID":"ND00xxx", "FieldAPIName": "Namespace.Field1" } ``` Response: ```json= { "Key": "Namespace.Field1", "FieldID":"ND000xxx", "Property1": "value" ... } ``` #### <strong style='color:orange; font-size:20px; background-color:#f7f7f7; padding:10px'>POST /validate_xxx_v1</strong> Request: ```json= { "FieldID":"ND00xxx", "FieldAPIName": "Namespace.Field1" "Property1": "value" ... } ``` Response: Error ```json= { "Valid": true/false "Errors":[ { "Property name":"Property 1", "Error" : "Invalid value" } ] } ``` #### <strong style='color:orange; font-size:20px; background-color:#f7f7f7; padding:10px'>DELETE /delete_xxx_v1</strong> Delete a userfield (set enabled=0) Request ```json= { "FieldID":"ND00xxx", "FieldAPIName": "Namespace.Field1" } ``` Response: 200 - OK 400 - Field not valid