Berry Blue
Berry Blue

Reputation: 16492

Cannot make requests to Walmart API

I'm trying to make a request to the Walmart API here. https://walmart.io/docs/affiliate/product-lookup

Here are the steps I'm following.

  1. I create my application here on Walmart and uploaded my public key. I created my keys following these instructions on Mac. https://walmart.io/key-tutorial

enter image description here

  1. I followed this code to generate my signature. https://walmart.io/docs/affiliate/onboarding-guide

I plug in all these values into the API explorer, but I keep getting the same error.

enter image description here

enter image description here

Is there an extra step I'm missing?

Upvotes: 1

Views: 1357

Answers (1)

IOSupport
IOSupport

Reputation: 11

The 401 Unauthorized is an HTTP status code error that represents the request sent by the client to the server lacks valid authentication Seems like one of the mandatory header params is missing while consuming api.

Request to please kindly cross check whether all of the mandatory header params are there as part of request.

We should have these below mentioned mandatory header params as part of the request.

One or more header params might be missing in the req.

WM_CONSUMER.ID
WM_SEC.KEY_VERSION
WM_CONSUMER.INTIMESTAMP
WM_SEC.AUTH_SIGNATURE

we need all of the header params and we can generate using below mentioned links.

Generating Auth Signature (WM_CONSUMER.INTIMESTAMP, WM_SEC.AUTH_SIGNATURE) We can generate Auth Signature by using below mentioned link.

We will have to run below mentioned sample code to generate Auth Signature as seen below. This is going to generate timestamp and valid Auth Signature to consume APIs.

Time Stamp will be valid for couple of mins only. If it expires, we will have to regenerate the same https://www.walmart.io/docs/affiliate/onboarding-guide

Generating consumer ID (WM_CONSUMER_ID)

Request to please kindly follow below steps to generate consumer ID

Create an account on Walmart IO platform - https://walmart.io by clicking on the user icon just before the search box.

Login to the account and accept "Terms of Use"

Click on "Create Your Application" to create a new application and fill in appropriate details.

Use this tutorial to generate two sets of public/private keys - https://walmart.io/key-tutorial
One set will be used for production.
Other set will be used for stage.

Upload both public keys using - https://walmart.io/key-upload?app_name=<your app name>

Consumer ID will be generated for both sets for prod and stage which can be seen on the dashboard - https://walmart.io/dashboard.

Regards, Firdos IOSupport

Upvotes: 1

Related Questions