We are testing callback API, what we have observed is, it is creating 2 interactions - inbound interaction and outbound direction callback interaction once its created (without making any outbound call).
If we look at the callback creation from out-of-box functionality, it creates single callback interaction with inbound/outbound direction and callback media type.
Is there a way we can merge using callback API ? Similar like OOB ?
Sorry, I don't understand what you mean and what OOB is.
By interaction, do you mean conversation (and conversationId)?
When you create a callback using the POST /api/v2/conversations/callbacks enpoint, this will create a single conversation.
If it is this endpoint you are using, participants will initially have a single session of mediaType callback.
When the callback is distributed to a Contact Center Agent, the agent will have the ability to manually dial the customer's phone number.
This will result in adding session of mediaType voice for the corresponding participants.
If I am not mistaken, you are showing the Performance - Interactions view (it can be useful to mention it as we can't always guess what you are showing).
So you are having a look at all type of interactions that were generated in your Genesys Cloud org, not just callbacks.
The first conversation is the callback (if you hover the phone icon on the left, it will display Callback type).
The second conversation is an inbound call - same - if you hover the phone icon on the left side, it will display Voice type. I guess someone made a call in your org.
How can you be sure that this is coming from your callback request? Are you 100% sure that nobody in your Genesys org made a call (internal or inbound). It is not even the same start time (Date).
Yes correct, it is performance - interactions view.
When we invoke API in the response it gives the conversation id. We have captured that under inbound interaction. So we are sure that, it is generating 2 conversations.
Where have you invoked the Callback API endpoint from?
Testing a Genesys Cloud Data Action?
Or invoking a Data Action from an Architect flow?
I am assuming that it is a Data Action as I see the format you have posted above with ${input.scriptId}, ...
If you did this via Test button in a Data Action, are you saying that this data action returned the conversationId = 58303b06-112e-436e-b212-d47007c7892e ?
I just did a test via API with similar content and it works fine.
As I said, I tend to think you are catching another conversation in your view - something that is not linked to the call to your Platform API endpoint.
If you are saying that you do a POST /api/v2/conversations/callbacks that returns conversationId = 58303b06-112e-436e-b212-d47007c7892e (conversationId of the conversation that appears as Inbound Voice in yoru view), then open a ticket with Customer Care.
I would strongly suggest that you get the conversation context or conversation details of this conversationId, as I mentioned in my previous post, so you can really see who created it (if it was an internal user or external call/participant).
As a side note, regarding the body of your Data Action: you are not supposed to include attributes that you do no want to set. Remove all attributes that you left empty (routingData, scoredAgents, ...).
So your Inbound Voice conversation (in your screenshot) corresponds to the call that was made to the Architect flow and from where the request to create a clalback was made.
The second Outbound Callback conversation corresponds to the callback that was created from the Data Action request.
I am not sure I understand why you just don't use the Create Callback action in your Architect flow (as it appears to be an Architect Inbound Call flow).