I am attempting to differentiate incoming interactions as our application needs to know whether or not the interaction was being held by another agent previously. I am trying to use the addTransferContext method to add a variable hasTranferred, a boolean that will be true if the category of the interaction is 'blindTransfer' or 'consultTransfer'. I have added this variable to the CustomInteractionAttributes portion of my framework.js file, but in my testing I have not seen it come anywhere.
The transfer context must be delivered while the transfer screen is open, and then a checkbox to add the transfer context to the interaction. You will be notified of the agent going to the transfer screen by subscribing the userEvent topic: https://developer.mypurecloud.com/api/embeddable-framework/actions/subscribe.html. When you receive this notification, you'll fire your method, and the agent can select the checkbox, then the attribute should appear on the other end of the transfer. Generally it's been intended as a mechanism to override the original screenpop with new information, essentially transferring the first agent's workspace to the second agent.
An alternative approach would be to update an attribute that indicates the call has been handled by an agent at the point the interaction is connected. This attribute would indicate that a person has already touched this interaction, so any subsequent agents would know this call originated from a transfer instead of ACD. In that case you'd want to use the interaction.addCustomAttributes method, which can be fired at any time the interaction is connected to the user: https://developer.mypurecloud.com/api/embeddable-framework/actions/Interaction/Interaction.addCustomAttributes.html