Create a ticket with a particular email id

Can we create a ticket with a particular email id.

Note : we will get agents email id from the the API.

Hey @Pulkit_Jangid Can you pls elaborate what do you mean by ticket with particular email id? Do you want to create a live chat or an email ticket? Whose email id are we talking about here? Do explain the problem statement for us to better help you

Hi @Sandeep_Rajaram

It is for live chat.
It is like we would hit an client’s api and in response we will get the email id… Then the ticket should be assigned to the agent with that particular email id which we recieved from the api response.

Hey @Pulkit_Jangid You can get the agent id and email id using the below API

curl --location 'https://cloud.yellow.ai/api/agents/reps/getAgentAvailabilities?bot={{bot-Id}}' \
--header 'x-api-key: {{x-api-key}}'

And you can use this API to create a ticket.

curl --location -g --request POST 'https://cloud.yellow.ai/api/agents/tickets/create-ticket?bot={{botId}}' \
--header 'x-api-key: {{x-api-key}}' \
--data-raw '{
    "ticketData": {
        "botId": "{{botId}}",
        "uid": "{{uuid}}",
        "source": "yellowmessenger",
        "issue": "call with agent",
        "priority": "MEDIUM",
        "contact": {
            "phone": "0939482821938",
            "name": "Anik Das",
            "email": "s@y.com"
        },
        "voiceCall": false,
        "sipCall": false,
        "customFields": {},
        "category": "test",
        "assignedTo": "karishnuyellowai",
        "preferredAgent": true,
        "preferredAgentFallback": false
    }
}'

I hope this will work.

1 Like