The most common mistake when performing REST API authorization process

26 December 2019 - 12:38, by , in Best practices in price monitoring, No comments
Reading Time: 2 minutes

One of the multiple features that Price2Spy has to offer is the REST API interface. However, there is one very important point when using REST API which seems to cause confusion among our clients, and it is related to performing the authorization process.

So, let’s explain this in more detail.

If a client uses REST API, he cannot use the API key in the format that we have sent it – decoded. This point represents the problem’s core.

What do you need to do?

  1. The API key needs to be encoded first. For that purpose, you can use the following link: – https://www.base64encode.org/. Here you need to paste your API key (usually provided by the account manager), then to click ENCODE, and finally to copy the encoded API key.

The example of this process is shown in the screenshot below.

Screenshot 1

2. Once encoded, you need to copy the key into swagger – https://api.price2spy.com/rest/swagger-ui.html – the test tool which is also available on the documentation link.

However, there is also another mid-step that is required – it is not enough to just copy the API key. You need to add Basic in front of the encoded API key.

So, it should look like this: Basic YmI1MTkzYTdkMzM4YTZmOTEwZmZiYjAxZjhmMzA2YTZlMjJjNDk3Ng== and then click Authorize (Screenshot 2).

Screenshot 2

There is an explanation in the API documentation, too. Please see it below:

REST Authentication is performed by adding Authorization header to your REST

API requests. The content of the header is *Basic<Base64Encoded_API_KEY>*

Example:

Authorization = Basic YmI1MTkzYTdkMzM4YTZmOTEwZmZiYjAxZjhmMzA2YTZlMjJjNDk3Ng==

Hopefully, now you have a bit clearer picture of how the process of REST API authorization works! Of course, for all additional questions that you might have, please feel free to contact us.

 

About Price2Spy

 

Price2Spy is an online service that provides comprehensive and suitable solutions for eCommerce professionals including; retailers, brands/manufacturers and distributors in order to stay profitable in the current competitive market conditions. If you want to learn more about what Price2Spy can do for your business, please get a personalized free demo or start your 30-day free trial.

About author:

Leave a Reply

About Price2Spy Blog

This blog is a place for eCommerce professionals to discuss ideas, methodologies and strategies to compete more effectively in the ever more tightening world of online retail. We explore things like competitive price monitoring, competitor business intelligence, competitive pricing, and counter-intelligence in general.

Archives

Categories