Expand my Community achievements bar.

SOLVED

How can I insert/update data to custom resource that is linked to profile via API using custom key?

Avatar

Level 2

I have tried several ways, but can't find a proper configuration.

Idea is to insert orders and update the order status afterwards by the order id.

Does anyone know how to configure it properly?

 

1 Accepted Solution

Avatar

Correct answer by
Community Advisor

You will have to make a PATCH request to update the existing profile. The flow would be something make a GET request on the profileAndServicesExt endpoint and if there's no profile exists then make a POST request to create a record with relevant attributes.

If the profile exists then your response will include a reference to the custom resource. Use that on the PATCH request to update the existing one.

Thanks, Sathees

View solution in original post

5 Replies

Avatar

Community Advisor

@raultorga Have a look at this documentation on how to interact with custom resources linked with profile resource via API.

https://experienceleague.adobe.com/en/docs/campaign-standard/using/working-with-apis/global-concepts...

Thanks, Sathees

Avatar

Level 2

@SatheeskannaK unfortunately that documentation did not get me closer to the solution I'm looking for.

I can send POST request when using the https://mc.adobe.io/<ORGANIZATION>/campaign/profileAndServicesExt/<resourceName>/ endpoint, but it will create a new row for every request. My aim is to use a custom key to insert a new record or update already existing one.

Avatar

Correct answer by
Community Advisor

You will have to make a PATCH request to update the existing profile. The flow would be something make a GET request on the profileAndServicesExt endpoint and if there's no profile exists then make a POST request to create a record with relevant attributes.

If the profile exists then your response will include a reference to the custom resource. Use that on the PATCH request to update the existing one.

Thanks, Sathees

Avatar

Level 2

So as I understand, the only way is to first make a GET request by using a filter and if the  record does not exists, I will make a POST request. If the record exists, I will make a PATCH request with the PKey as the identifier that the GET request returned?