I want to upload a CSV file for suppression list using API. but facing "400 bad request" error
https://developer.adobe.com/journey-optimizer-apis/references/suppression/
Solved! Go to Solution.
Views
Replies
Total Likes
You can validate with the following curl by selecting the file
curl --location 'https://platform.adobe.io/ajo/config/suppression/uploads' \
--header 'Authorization: Bearer <token>' \
--header 'x-api-key: <x-api-key>' \
--header 'x-gw-ims-org-id: <x-gw-ims-org-id>' \
--header 'x-sandbox-name: <x-sandbox-name>' \
--form 'file=@"LbHFcFaS6/sampleCsvTemplate.csv"'
Also, download the sample file from the UI by clicking on 'Add email or domain'
Views
Replies
Total Likes
Getting a '400 Bad Request' usually means the server couldn't understand what you sent because the request's format was a bit off. This often happens if there's a typo or mistake in things like the headers, the stuff you put in the URL (query parameters), or the body of the request (like wrong keys, organization ID, access tokens, or just messed-up JSON). Double-check those parts and give it another try!
Views
Replies
Total Likes
@SatheeskannaK Facing issue while adding file path in the parameters. Which is why seeing the uploads error.
Views
Replies
Total Likes
Can you share the curl you are using ?
Hopefully, you have set the content-type to multipart/form-data in headers and included the file path as part of the multipart form data.
Views
Replies
Total Likes
curl --request POST \
--header "Authorization: Bearer <ACCESS_TOKEN>" \
--header "x-api-key: <CLIENT_ID>" \
--header "x-gw-ims-org-id: <IMS_ORG_ID>" \
--header "x-sandbox-name: <SANDBOX_NAME>" \
--header "Accept: application/json" \
—header “Content-Type: multipart/form-data”\
--body "file=@/full/path/to/csv"
Views
Replies
Total Likes
You can validate with the following curl by selecting the file
curl --location 'https://platform.adobe.io/ajo/config/suppression/uploads' \
--header 'Authorization: Bearer <token>' \
--header 'x-api-key: <x-api-key>' \
--header 'x-gw-ims-org-id: <x-gw-ims-org-id>' \
--header 'x-sandbox-name: <x-sandbox-name>' \
--form 'file=@"LbHFcFaS6/sampleCsvTemplate.csv"'
Also, download the sample file from the UI by clicking on 'Add email or domain'
Views
Replies
Total Likes
Thank you. It is working now. The csv template was the issue.
Thanks @AkshithaPo for sharing the update! 🙂
Views
Replies
Total Likes
Views
Likes
Replies
Views
Likes
Replies