Add two separate messages with circuit rest api in the same subject box

34 Views Asked by At

I am trying to write two different messages to the same subject bot after each other. But any time a new subject with the same title is posted.

I use the rest api post call and tried this:

curl --insecure -X POST https://yourcircuit.com/rest/v2/webhooks/incoming/xxxx -d '{"text": "foobar1", "subject": "My fancy title"}'
curl --insecure -X POST https://yourcircuit.com/rest/v2/webhooks/incoming/xxxx -d '{"text": "foobar2", "subject": "My fancy title"}'

I assumed two messages under the same title box inside the circuit conversation.

What is shows:
enter image description here

What I want to achive:
enter image description here

Does anybody know how to achive this?

2

There are 2 best solutions below

1
Roger Urscheler On

That is not supported with webhooks. This could be done with the regular REST API /conversations/{convId}/messages/{itemId}. See https://circuitsandbox.net/rest/v2/swagger/ui/index.html

4
Roger Urscheler On

You can try this using the swagger ui at https://circuitsandbox.net/rest/v2/swagger/ui/index.html

enter image description here

Here is the corresponding http request:

curl -X POST "https://circuitsandbox.net/rest/v2/conversations/05bd75f1-a8d5-40c0-b24a-28710ec1a57f/messages/cde0b57e-7f1d-4ffb-b2af-a1b7c7c9fa06" \
-H "accept: application/json" \
-H "authorization: Bearer ot-4f70c19edc6f43c4b89b4d39b4440000" \
-H "content-type: application/x-www-form-urlencoded" \
-d "content=hello"

Note that the token above has been invalidated. You need to use your own conversation ID, parent item ID and access token.

And here is how it looks in Circuit: enter image description here