selling-partner-api-sdk icon indicating copy to clipboard operation
selling-partner-api-sdk copied to clipboard

POST restrictedDataToken

Open HT808s opened this issue 3 years ago • 1 comments

Is there a plan to include the call to restrictedDataToken? It would be nice to have it, as an option

HT808s avatar Aug 02 '22 16:08 HT808s

I would be very pleased as well. I am trying fetch GET_AMAZON_FULFILLED_SHIPMENTS_DATA_GENERAL reports and do not receive any PII data. Confusingly some report requests do not need the RDT, see Issue 615 (selling-partner-api-docs).

If implementation is necessary, this would be a rough outline:

  • Restricted Data Token (RDT) must be fetched and updated if RDT is expired before every request in scope
  • Path and dataElements must be defined for every RDT request
  • RDT must be used instead of LWA in header X-Amz-Access-Token, currently SignRequest(r *http.Request)
  • SignRequest(r *http.Request) uses simply the accessToken of the SellingPartner struct
  • The accessToken is set in the RefreshToken() function this would be the best place IMO to incorporate the RDT generation
  • One architecture hurdle would be the definition of Path and dataElements for every request, e.g. for reports it could be added into the ReportOptions

Coffeeri avatar Aug 17 '22 10:08 Coffeeri