Genesys Cloud - Developer Community!

 View Only

Sign Up

  • 1.  API request for creating Work Item with custom attributes

    Posted 3 days ago

    Has anyone used the APIs to create work items with custom attributes?

    The documentation (https://developer.genesys.cloud/commdigital/taskmanagement/task-management-custom-attributes) shows they are added as a key value pair:
    {

     "name": "Workitem with custom attributes", 

     "customFields" : { "custom_attribute_text":"Text for custom attribute", "custom_attribute_2_integer":100 }

     }

    But when using the API explorer (create, patch or bulk add work items), custom attributes are added as a key object pair:
    {
      "name": "dumm",
      "customFields": {
        "custom_key": {
          "some_key": "some_value"
        }
      }
    }

    It's not clear how to format the object. Any ideas? Or is this a bug in the API explorer?


    #PlatformAPI

    ------------------------------
    Stuart Gielen
    IT Lead
    ------------------------------


  • 2.  RE: API request for creating Work Item with custom attributes

    Posted 2 days ago

    Hi Stuart

    Seems this is a known issues as I found threads in the community - https://community.genesys.com/discussion/post-workitem

    https://community.genesys.com/discussion/workitem-custom-fields-not-able-to-be-added-post-workitem.

    The main suggestion was to make use of Pro mode and create your JSON data directly in the text area.

    Regards



    ------------------------------
    Stephan Taljaard
    EMBEDIT s.r.o
    ------------------------------



  • 3.  RE: API request for creating Work Item with custom attributes

    Posted 2 days ago

    Olá!

    Nesse exemplo utilizava a API para carregar o resumo do copiloto nos atributos, quando ele era localizal apenas por API:


    {
      "name": "Update the attributes copilot",
      "integrationType": "purecloud-data-actions",
      "actionType": "custom",
      "config": {
        "request": {
          "requestUrlTemplate": "/api/v2/conversations/${input.conversationId}/participants/${input.participantId}/attributes",
          "requestType": "PATCH",
          "headers": {
            "Content-Type": "application/json"
          },
          "requestTemplate": "{\n   \"attributes\": \n{\n\"resumo\":\"${input.resumo}\",\n\"followup\": \"${input.followup}\",\n\"resolution\": \"${input.resolution}\",\n\"tabulacaoSugerida\": \"${input.tabulacaoSugerida}\"\n}\n}"
        },
        "response": {
          "translationMap": {},
          "translationMapDefaults": {},
          "successTemplate": "${rawResult}"
        }
      },
      "contract": {
        "input": {
          "inputSchema": {
            "type": "object",
            "properties": {
              "conversationId": {
                "type": "string"
              },
              "participantId": {
                "type": "string"
              },
              "resumo": {
                "default": "desconexaoDuplicidadeWhatsApp",
                "type": "string"
              },
              "followup": {
                "type": "string"
              },
              "resolution": {
                "type": "string"
              },
              "tabulacaoSugerida": {
                "type": "string"
              }
            },
            "additionalProperties": true
          }
        },
        "output": {
          "successSchema": {
            "type": "object",
            "properties": {},
            "additionalProperties": true
          }
        }
      },
      "secure": false
    }



    ------------------------------
    Augusto Aranha
    Gerente de Desenvolvimento de Sistemas e Planejamento
    ------------------------------



  • 4.  RE: API request for creating Work Item with custom attributes

    Posted 2 days ago

    In the API explorer if you add it into the window directly this format is working. Use the pro mode. 

    {

      "name": "Soknad",

      "priority": 300,

      "workbinId": "a54de182-7e57-4eb1-a71c-3df2a3de86be",

      "typeId": "bb857580-2f8f-491f-8d1b-72f103ff57c9",

      "customFields": {

       

          "cso_so_name_text": "Eystein",

    "cso_duedate_date":"2025-09-29",

    "cso_url_lookup_url":"https://www.vg.no"

       

      }

    }



    ------------------------------
    Eystein Kylland
    Systemutvikler Genesys Applikasjonsspesialist
    ------------------------------



  • 5.  RE: API request for creating Work Item with custom attributes

    Posted 2 days ago

    Another option would be to use Postman or some other REST client. I have a Postman workspace I'd be happy to share with you that has all of the API calls as requests.



    ------------------------------
    Steve Park
    Senior Principal Professional Services - Digital
    ------------------------------