Edit in GitHubLog an issue

API callbacks

The multiple steps of the EQP process take time to complete. The results of these steps can impact the availability or status of data that was previously submitted. Rather than having to continuously poll for updates, you can register an API callback URL in the user profile.

Whenever an update occurs to a product or a file, a JSON API request will be sent to the registered callback URL.

Register a callback#

Callbacks are registered using the User Profile API.

FieldTypeDescription
namestringOptional: name for this callback
urlstringURL that will receive callback JSON requests
usernamestringBasic authorization username
passwordstringBasic authorization password - never returned in the GET response
Copied to your clipboard
1curl -X PUT \
2 -H 'Authorization: Bearer baGXoStRuR9VCDFQGZNzgNqbqu5WUwlr.cAxZJ9m22Le7' \
3 -H 'Content-Type: application/json' \
4 -d '{"api_callbacks": [{"name": "My 1st EQP Callback","url": "https://developer.example.com/rest/v1/callback","username": "key","password": "secret"}]}' \
5 https://developer-stg-api.magento.com/rest/v1/users/MAG123456789

Authentication#

API callbacks are authenticated using a Basic Authorization header. Callbacks are only sent using HTTPS to ensure the security and integrity of the request.

For the callback registered in the example above, the following header will be constructed and sent in every callback request:

Copied to your clipboard
Authorization: Basic a2V5OnNlY3JldA==

Callback structures#

Each event has a unique code provided in the callback_event field. The update_info object has a different structure, depending on the event code. Resource IDs are provided in the update_info structure so that additional information can be requested using the API endpoints for those resources.

File upload callbacks#

Malware scan results are sent out for File resources when the asynchronous scan completes.

Copied to your clipboard
1{
2 "callback_event": "malware_scan_complete",
3 "update_info": {
4 "file_upload_id": "2309480238.238475.0",
5 "tool_result": "passed"
6 }
7}

Package callbacks#

EQP status updates are sent out for Package resources when the product's EQP state is modified.

Copied to your clipboard
1{
2 "callback_event": "eqp_status_update",
3 "update_info": {
4 "submission_id": "s5w9k703ru",
5 "item_id": "user_upload_version_1",
6 "eqp_flow": "marketing",
7 "current_status": "approved"
8 }
9}
  • Privacy
  • Terms of Use
  • Do not sell my personal information
  • AdChoices
Copyright © 2022 Adobe. All rights reserved.