Expand my Community achievements bar.

Looking for a way to upsert the non-user profile data

Avatar

Level 3

Hello,

 

We have a requirement to update the b2b_opportunity data using the HTTP API Source. It seems that there are two ways to do it:
1. Include the payload header "msgType". Both the allowed values (xdmEntityCreate, xdmEntityUpdate) actually overwrites the data and thus we always need to send the complete payload.

2. Adding the payload header "payload.data". This doesn't work for non-profile entities.

 

Is there a way to achieve what we are trying to do here?

 

Regards

Abhishek

2 Replies

Avatar

Level 5

 Hey Abhishek, 

Yes, there is a way to achieve what you are trying to do. You can use the xdmEntityUpdate message type with the payload.data header. This will allow you to update the b2b_opportunity data without overwriting the entire payload.

Try this:

1. Create a new HTTP API Source.
2. Set the message type to xdmEntityUpdate.
3. In the payload, add the b2b_opportunity object with the fields you want to update.
4. Send the request to the HTTP API.

The HTTP API Source will update the b2b_opportunity data without overwriting the payload.

Here is an example of how to do it in JSON:

{
  "msgType": "xdmEntityUpdate",
  "payload": {
    "b2b_opportunity": {
      "name": "New name",
      "amount": 1000
    }
  }
}
I hope this answers your question.
 
Thanks
Madhan

Avatar

Level 3

Thanks, @adobechat!

 

I tried using the msgType: xdmEntityUpdate. It seems to be deleting all the fields that are already there in the entity but not sent in the payload. I mean, it's behaving like a PUT instead of a PATCH.

 

Also, my use case is to send raw data and not XDM-compliant data. I am sorry, should have cleared that earlier.

 

Regards

Abhishek