AEP - Upsert | Community
Skip to main content
Level 2
January 23, 2024
Solved

AEP - Upsert

  • January 23, 2024
  • 1 reply
  • 3765 views

Hi, 

 

My data is: Email: abc@test.com, Firstname: abc, Lastname: xyz

I want to change it to:  Email: abc@test.com, Firstname: abc, Lastname: xyz, City:Pune, Address:Halli

 

Steps i followed:

1)Created a dataset.

2) Disabled for profiling

3) Enabled for profiling and upsert.

 

When i want to create a new record, i send through API. Second time i sent through Batch, Upsert works perfect.

 

But when i create a new record through api, and try to update data through api by using below,

        "operations": {

            "data": "merge"

}

It does not work. Please note that  I have only 1 identity which is email so i did not create identity dataset.

Please let me know where I am going wrong ?

 

This post is no longer active and is closed to new replies. Need help? Start a new post to ask your question.
Best answer by brekrut

I am always getting the following error - 

"detail": "The value supplied for the 'body' field does not match your input schema. Update the 'body' value and try again.",
 
@arijitg  @abhinavbalooni - any idea on this?

Hello 

 

using upsert via an API should us the following format.

 

curl --location 'https://dcs.adobedc.net/collection/<collectionid>?synchronousValidation=true' \
--header 'Authorization: Bearer <token>' \
--header 'x-api-key: <API-KEY>' \
--header 'x-gw-ims-org-id: <org>' \
--header 'x-sandbox-name: sandbox \
--header 'x-adobe-flow-id: <flowid>' \
--header 'Content-Type: application/json' \
--data-raw '{
"header": {
"flowId" : "<flowid>",
"imsOrgId": "<oprgiID",
"datasetId": "<dataSetID>",
"operations": {
"data": "merge"
}
},
"body": {
"_<tenant>": {
<profile details>
}
}
}
}

1 reply

arpan-garg
Community Advisor
Community Advisor
January 24, 2024

Hi @anujabh - Does your connection url has multiple datasets associated with it? Are you already passing flowid and dataset in the header?

 

AnujaBhAuthor
Level 2
January 24, 2024

Hi @arpan-garg ,

 

I am using only 1 dataset. And yes my header does have flowid and dataset id. Below is what is not working for me:

"operations":{
        "data": "merge"
    }
Example:
 
When i send email, firstname, lastname to create a record, i used "data":"create" 
then i used "data":"merge" to send, email, firstname, lastname, City. City got appended.
But when i used merge, and sent email and Zip, all other details like firstname, lastname, city got deleted and only email and zip stayed.
 
arpan-garg
Community Advisor
Community Advisor
February 28, 2024

Hi @anujabh - I also face the same issue now.  Seems like something recently changed @abhinavbalooni  - You have any idea on why the upsert is not working?