API JSON flow

Hi everyone, i have a project here which I am suppose to put an email body which I already have a value onto the json body of the API, Please help the flow of it.

@Anelisa_Bolosha

Can you please explain a little…the requirements are little unclear

Cheers

Please try deserializing the json to a datatable and you can use it in the email body as per your requirement from the table.

If its something else you are looking at please ellaborate.

@Anelisa_Bolosha

Hi @Anelisa_Bolosha

After you get the response from API call. You can use Deserialize Json Activity like this

sample json

{
  "ticket_id": "12345",
  "user_info": {
    "user_id": "user001",
    "name": "John Doe",
    "email": "johndoe@example.com"
  },
  "issue_details": {
    "subject": "Login Issue",
    "description": "Unable to login to the system since yesterday.",
    "priority": "High",
    "status": "Open"
  },
  "creation_date": "2023-11-29",
  "last_updated": "2023-11-29",
  "assigned_to": {
    "employee_id": "emp100",
    "name": "Jane Smith",
    "department": "IT Support"
  },
  "comments": [
    {
      "comment_id": "comm001",
      "author": "Jane Smith",
      "date": "2023-11-29",
      "text": "Initial assessment completed. Requesting further details."
    }
  ]
}

Let say you want to extract the issue_details > description Key , we can use

DeserializedResponse.SelectToken("issue_details").SelectToken("description").ToString

Cheers

Please use deserialize json activity with email body as input and pass on the output to the API call.

Hi guys thank you for all your responses,
So I need to insert an email body value under “inputs”…send a request then when the request result response come, they come like this:

On the response on “labels”: [“claims”,…]
I want the first one “claims”

Hi @Anelisa_Bolosha

Could you share the image again ? The upload didn’t work correctly

Oh okay apologies,i uploaded please check

Thank you @Anelisa_Bolosha

Could you share the sample json like in the image?

{
“inputs”: “Hi, kindly receive an attached request to cancel my policy.”
}

@Anelisa_Bolosha

oh I got it.

How about this

payload = "{
'inputs': '"+Mail.Body.ToString.Trim+"'
}"