GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Overview
  • Amazon Data Portability workflow
  • User transfer preferences
  • Developer data handling practices
  • Configure the Amazon Data Portability service
  • Step 1. Create a developer account
  • Step 2. Identity and security assessment
  • Step 3. Create an LWA security profile
  • Step 4. Set up LWA based on your use case
  • Step 5. Get allowlisted
  • Sandbox Testing (Optional)
  • Step 1. Generate LWA tokens with OAuth2 code
  • Step 2. Use the refresh token to get new tokens
  • Step 3. Construct URI and authorize request

This view

  • Original page
  • New address

GeezerVison is showing developer.amazon.com — Sample Queries | Amazon Data Portability

Amazon Developer
Alexa
Amazon Appstore
Ring
AWS
Documentation

Console

as

Settings
Sign out
Notifications
Alexa
Amazon Appstore
Ring
AWS
Documentation
Support
Contact Us
My Cases

Console

as

No results found

Try a different or more specific query.
Amazon Data Portability

Collapse All | Expand All

  • Overview
  • Amazon Data Portability workflow
    • User transfer preferences
    • Developer data handling practices
  • Configure the Amazon Data Portability service
    • Step 1. Create a developer account
    • Step 2. Identity and security assessment
    • Step 3. Create an LWA security profile
    • Step 4. Set up LWA based on your use case
    • Step 5. Get allowlisted
    • Sandbox Testing (Optional)
  • Authorize your Application to connect with Amazon Data Portability API
    • Step 1. Generate LWA tokens with OAuth2 code
    • Step 2. Use the refresh token to get new tokens
    • Step 3. Construct URI and authorize request
  • Connect with Amazon Data Portability API
    • Step 1. Call Create Query for each scope
    • Step 2. Wait for notification
    • Step 3. Call List Query Records
    • Step 4. Import customer data
  • Related Resources
    • Available Amazon Data Portability LWA Scopes
      • Category-1 Scopes
      • Category-2 Scopes
      • Category-3 Scopes
    • Upcoming Amazon Data Portability LWA Scopes
    • Changes to Available Amazon Data Portability LWA Scopes
    • Amazon Data Portability API References
    • Sample Queries

Other Resources
  • LWA Product Overview

Sample Queries

  • Create Data Query
  • List Data Query Records
  • Response Notification

Create Data Query

Sample queries are provided using curl to enable flexibility over the client configuration. Assumption on configuration setup:

  • ACCESS_TOKEN - stores the LWA access token for the request.
  • API_ENDPOINT - stores the API endpoint selected by your Application.
  • SCOPE_ID - stores the Amazon Data Portability scope id for your request (example: portability-physical-orders)

Sample request:

curl --request POST 'https://$API_ENDPOINT/$SCOPE_ID/data-queries' -H 'authorization: Bearer $ACCESS_TOKEN' -l

Sample successful response:

{
   "id":"a1111111-b222-c333-d444-e55555555555"
}

Sample response with error:

{
  "category":"CONFLICT",
  "type":"REQUEST_CONFLICT",
  "message":"There is a conflicting request in progress"
}

List Data Query Records

Sample queries are provided using curl to enable flexibility over the client configuration. Assumption on configuration setup:

  • ACCESS_TOKEN - stores the LWA access token for the request.
  • API_ENDPOINT - stores the API endpoint selected by your Application.
  • SCOPE_ID - stores the Amazon Data Portability scope id for your request (example: portability-physical-orders).
  • QUERY_ID - stores the queryId of your request.
  • NEXT_PAGE_TOKEN - the value for the next page token.

Sample request: Default call, no parameters:

curl --request GET 'https://$API_ENDPOINT/$SCOPE_ID/data-queries/$QUERY_ID/records' -H 'authorization: Bearer $ACCESS_TOKEN' -l

Call with parameters:

  • using the maxResults and the nextPageToken parameters
curl --request GET 'https://$API_ENDPOINT/$SCOPE_ID/data-queries/$QUERY_ID/records' -H 'authorization: Bearer $ACCESS_TOKEN' -l -G -d 'maxResults=3' -d 'nextPageToken=$NEXT_PAGE_TOKEN'
  • with the maxResults parameter
curl --request GET 'https://$API_ENDPOINT/$SCOPE_ID/data-queries/$QUERY_ID/records' -H 'authorization: Bearer $ACCESS_TOKEN' -l -G -d 'maxResults=1'
  • with the nextPageToken parameter
curl --request GET 'https://$API_ENDPOINT/$SCOPE_ID/data-queries/$QUERY_ID/records' -H 'authorization: Bearer $ACCESS_TOKEN' -l  -G -d 'nextPageToken=$NEXT_PAGE_TOKEN'

Sample response without next page:

{
   "records":[
      {
         "schema":"schema_presigned_url_1",
         "file":"file_presigned_url_1"
      },
      {
         "schema":"schema_presigned_url_2",
         "file":"file_presigned_url_2"
      }
   ],
   "nextPageToken":""
}     

Sample response without next page result:

{
   "records":[],
   "nextPageToken":""
} 

Sample response with next page result:

{
   "records":[
      {
         "schema":"schema_presigned_url_1",
         "file":"file_presigned_url_1"
      },
      {
         "schema":"schema_presigned_url_2",
         "file":"file_presigned_url_2"
      }
   ],
   "nextPageToken":"token"
}     

Sample response with error:

{
  "category":"BAD_REQUEST",
  "type":"INVALID_MAX_RESULTS",
  "message":"Max results value is outside limits"
}

Response Notification

Completed Data Query:

{
    "Type": "Notification",
    "MessageId": "message-id",
    "TopicArn": "arn:aws:sns:region:account:topicId",
    "Subject": "Data Portability Notification 1.0",
    "Message": "{\"id\": \"dataQueryId1\",\"version\": \"1.0\",\"status\": \"COMPLETED\"}",
    "Timestamp": "2023-08-08T00:54:06.655Z",
    "Signature": "EXAMPLEw6JRN...", 
    "SigningCertURL": "<signature_cert_url>", 
    "UnsubscribeURL": "<unsubscribe_url>"
}

Canceled Data Query:

{
    "Type": "Notification",
    "MessageId": "message-id",
    "TopicArn": "arn:aws:sns:region:account:topicId",
    "Subject": "Data Portability Notification 1.0",
    "Message": "{\"id\": \"dataQueryId2\",\"version\": \"1.0\",\"status\": \"CANCELED\"}",
    "Timestamp": "2023-08-08T00:54:06.655Z",
    "Signature": "EXAMPLEw6JRN...", 
    "SigningCertURL": "<signature_cert_url>", 
    "UnsubscribeURL": "<unsubscribe_url>"
}

Last updated: Mar 07, 2024

Follow us:

Resources

  • Appstore developer blog

  • Technical documentation

  • Amazon Developer Huddle

Supported devices

  • Amazon Fire TV

  • Fire tablets

Other services & APIs

  • Small Business Accelerator Program

  • Developer Promotions Console

  • Alexa for video publishers

  • Login with Amazon

  • Frustration-Free Setup

  • Amazon Incentives API

  • Amazon Merch on Demand

  • Amazon Music

  • Fire TV Partners

Support

  • Appstore Developer Community

  • FAQs

  • Contact us

Legal

  • Terms & agreements

  • Privacy Notice

amazon_developer_logo

© 2010-2026, Amazon.com, Inc. or its affiliates. All Rights Reserved.

Terms

Amazon Developer Blog

Contact Us

You are visitor 01402503 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.