i want to get shopee authorization using the source code.
The language I use is php.5.3.2.
No matter how many times I search, I only have a demo about the higher version, so I can’t find the answer I want to ask.
In shopee, you can calculate the default signature sequence and partner key value as “HMAC-SHA256” and create an autorization value. How can I write it in code?
i already get partner key.. but i don’t know how to get authorization.
3
Answers
In order to get shopee authorization, you need to prepare a header as mentioned below and send this header in curl headers with other required data. You can refer to the example given below.
After preparing this, send $header in curl headers
YOUR CURL REQUEST WOULD BE LIKE THIS:
Hope you get your query resolved by this.
If you can use npm package in your php app, you can use this code:
To get the Shopee Auth code you’ll need partnerID, partnerKey both can be seen on your Shopee Open Platform Console.
Next, is the API path for Authorization which is
https://partner.shopeemobile.com/api/v1/shop/auth_partner for V1
https://partner.shopeemobile.com/api/v2/shop/auth_partner for V2
both have different Auth processes
for V2
create a baseString consisting of
PartnerId,
API path (/api/v2/shop/auth_partner)
and Unix timestamp.
Create a signature using by hashing the baseString with your partnerKey.
prepare the Auth URL like this
Auth URL will look like this
Sample Auth URL