Expand my Community achievements bar.

SOLVED

Curl command for deleting orphaned XF offers

Avatar

Level 2

Hi guys ,

I have a requirement to delete experience-fragments from Adobe Target  exported from an AEM instance which has been wiped-out now . But exported XFs are still present as offers in Target dashboard and there is no option in dashboard to delete them . 

I have been following this documentation -- https://developers.adobetarget.com/api/#delete-offer-by-id  ,but url given here is giving 404 and bearer token  I am not able to find it in Adobe Target project . 

Could you please help me on it ?

 

Sincerely ,

Rahul Kumar

1 Accepted Solution

Avatar

Correct answer by
Community Advisor

Hi @RahulKu8 

I think first you've to get the list of all offers using the api called List Offers ..  

Adobe Target Admin API Target API v1.0 (adobetarget.com) 

in response you can see the Offer ID and Offer name .. based on the response, you can find the name of the offer along with ID that you want to delete it. 

View solution in original post

9 Replies

Avatar

Community Advisor

Hi @RahulKu8  

The page is working and I can able to delete the offer by Id. 

Did you try this https://www.postman.com/api-evangelist/adobe/request/hl87a8r/delete-offer-by-id  in postman. provide the request headers like token, tenant ID etc 

Hope this helps. 

 

Avatar

Community Advisor

@RahulKu8 bearer token have to generated before even accessing API, here goes the high level steps.

 

1) You have setup developer access/serviceuser access through Adobe I/O in order to interact with experience or creative cloud platforms. Refer the How to Configure Authentication for Adobe Target APIs | Adobe Target for detailed steps before accessing  Target Admin API's (Start using OAuth2 authentication instead JWT which is going to be decommissioned)

2) Once you were to setup developer access and generate bearer token you should be good to proceed further.

 

I hope this is helpful. If you still need help, please let me know what you've tried so far and what you've failed at.

 

~cheers,

NN

 

Avatar

Community Advisor

Hi @RahulKu8  

Agree with @nnakirikanti  you have to generate the bearer token before accessing the API. Links below 

Also here is the updated Target API link for delete a content offer by ID. https://developer.adobe.com/target/administer/admin-api/#tag/Offers/operation/deleteOffer_1_2 

Thanks

Avatar

Level 2

Hi @Gokul_Agiwal ,

I am trying to follow the instructions given in https://developer.adobe.com/target/administer/admin-api/#tag/Offers/operation/deleteOffer_1_2   in postman , but how can I find offer ID for XFs which has been exported ?

 

Thanks

Avatar

Correct answer by
Community Advisor

Hi @RahulKu8 

I think first you've to get the list of all offers using the api called List Offers ..  

Adobe Target Admin API Target API v1.0 (adobetarget.com) 

in response you can see the Offer ID and Offer name .. based on the response, you can find the name of the offer along with ID that you want to delete it. 

Avatar

Level 2

Thank you @Gokul_Agiwal  for your help , I am able to list and delete XFs using cURL and Postman . 

Avatar

Community Advisor

Hi @RahulKu8  

Glad to know that issues resolved and you can able to make it. 

As request, Is it possible for you to post the sample cURL command and postman call you've used (mask the auth code and other credentials) in this thread so others also get benefit. 

Thanks

Avatar

Level 2

Hi @Gokul_Agiwal  , I will add steps which I have followed .

Steps are --> 

 

1) To delete an  experience-fragment using cURL we need offer ID which we can get from using below command → 

 

curl -X GET "https://mc.adobe.io/<tenant-Id>/target/offers" -H "authorization: Bearer <Oauth access token>" -H "cache-control: no-cache" -H "Accept: application/vnd.adobe.target.v2+json" -H "x-api-key: <Client ID>"

 

 

2) cURL command to delete will be based of the exported type → 

 

a) If XF has been exported as HTML  → 

curl -X DELETE "https://mc.adobe.io/<tenant-Id>/target/offers/content/<Offer ID >" -H "authorization: Bearer <Oauth access token>" -H "cache-control: no-cache" -H "Accept: application/vnd.adobe.target.v2+json" -H "x-api-key: <Client ID>"

 

b) If XF has been exported as JSON  → 

curl -X DELETE "https://mc.adobe.io/<tenant-Id>/target/offers/json/<Offer ID >" -H "authorization: Bearer <Oauth access token>" -H "cache-control: no-cache" -H "Accept: application/vnd.adobe.target.v2+json" -H "x-api-key: <Client ID>"

 

Note : Above commands are present here -  https://developers.adobetarget.com/api/#list-offers  but I have made some adjustments like --

--> not using multiline commands

--> using double quotes

 

Thanks , Happy Learning