人生就是博·(中国)尊龙AG旗舰厅

人生就是博·(中国)尊龙AG旗舰厅(LianLian Global)官网首页

shopee open v2授权要领

2021/04/21

v2授权教学

v2授权网址组成说明       

返回内容




字段

类型

须要

说明

code

string

Yes

用于获取access_token和refresh_token。。。。。。。。一次性使用有用期为10分钟。。。。。。。。

Shop_id

int

yes

完成授权的shop_id

 

开发职员凭证以下规则天生授权链接,,,,,,,连结提供应卖场营运职员举行授权。。。。。。。。授权完毕后即可透过API对店肆举行操作。。。。。。。。作废授权作法流程同卖场授权流程。。。。。。。。

作废授权网址


https://partner.shopeemobile.com/api/v2/shop/cancel_auth_partner

正式情形

https://partner.uat.shopeemobile.com/api/v2/shop/cancel_auth_partner

测试情形

 

授权使用参数




字段

类型

须要

说明

partner_id

 

Int

yes

Partner ID可点选右上角console后选择APP,,,,,,,则可在APP List中审查

Redirect

String

yes

仅在授权乐成后导向的页面,,,,,,,可以使用任何网址

(e.g.公司网站、卖场网址)

Sign

String

yes

依Shopee规则爆发的字符串

timestampt

int

yes

需要与sign字符串使用的时间戳坚持一致。。。。。。。。 5分钟后逾期。。。。。。。。

 

v2授权网址组陋习范

本部辩白明怎样天生用于卖场授权的HMAC-SHA256。。。。。。。。

v2授权网址组成办法

1.    组成sign的规则

10090/api/v2/shop/auth_partner1594897040

凭证此顺序,,,,,,,以partner_id ,,,,,,,api path ,,,,,,,timestamp组成sign。。。。。。。。

2.    加密字符串

依上一办法将字符串团结后需要透过SHA256 hashing algorithm(HMAC)加密,,,,,,,加密后则为Token。。。。。。。。加密后规范如下:

90c12d3932f3826f0c72242e1ec6492eec9a1298658f41f7a9469664801c4e5a

3.    组成授权网址

 

接着凭证上述"授权网址组陋习范"的规则组成授权网址

4.    完成授权

https://www.www.sdxldwyx.com/?code=xxxxxxxxxx&shop_id=xxxxxx

遵照上述网址完成卖场授权后,,,,,,,将重新导至此网址:(xxx体现随机或以该卖场shop id为主)

 

v2授权逾时逻辑

授权网址会在5分钟内逾期(由于Timestamp逾期),,,,,,,以是开发职员必需重新天生一个新的授权网址。。。。。。。。

若进入授权网址后,,,,,,,未在3分钟内登入卖场账号、密码,,,,,,,将会获得过失讯息"operation overtime",,,,,,,需要重新进入卖场授权网址,,,,,,,而不是重新整理该页面。。。。。。。。

 

v2验证请求说明

除非指定对某些特定的API使用HTTP / FORM(在API文檔中有说明),,,,,,,不然对所有其余的API使用HTTP / JSON。。。。。。。。

以下教学同OpenAPI 2.0 Authorization & Authentication。。。。。。。。

使用参数




字段

类型

须要

说明

partner_id

Int

yes

Partner ID可点选右上角console后选择APP,,,,,,,则可在APP List中审查

timestamp

Int

Yes

所有请求都必需包括。。。。。。。。 5分钟后逾期

access_token

String

No

    将access_token用作某些API的通用请求参数,,,,,,, 在逾期前可以多次使用,,,,,,,有用期为4小时

要挪用Get Access_token API和刷新Access_token   API,,,,,,,可以跳过此参数

sign

String

Yes

依Shopee规则爆发的字符串

 

shop_id

 

int

No


 

返回内容




字段

类型

须要

说明

request_id

string

Yes

用于提供应Shopee盘问呼叫纪录

error

string

Yes

过失讯息,,,,,,,若无过失则返回空值

message

string

No


response

object

no

详细过失讯息说明

 

Step1、建设署名基本字符串

本部辩白明如作甚API请求用的验证天生HMAC-SHA256。。。。。。。。

凭证此顺序,,,,,,,使用partner_id ,,,,,,,api path ,,,,,,,timestamp ,,,,,,,access_token 和shop_id 组成sign(要挪用Get Access_token API和Refresh Access_token API,,,,,,,可以在符号基础字符串中跳过access_token)。。。。。。。。

 

Step2、署名加密

将Sign和Partner key以HMAC-SHA256 hashing algorithm来加密。。。。。。。。

 

Get Access_token

API: https://partner.shopeemobile.com/api/v2/auth/token/get Method: Post

Description: 使用此API和代码来获取access_token和refresh_token。。。。。。。。

使用参数




字段

类型

须要

说明

code

String

yes

卖场授权后,,,,,,,重新导向URL中的代码。。。。。。。。为一次性使用,,,,,,,有用期为10分钟

partner_id

Int

Yes

开发者APP的Partner id

shop_id

int

Yes

卖场Shop id

 

返回内容




字段

类型

须要

说明

request_id

string

yes

用于提供应Shopee盘问呼叫

error

string

yes

纪录过失讯息,,,,,,,若无过失则返回空值

refresh_token

string

yes

使用refresh_token获取新的access_token。。。。。。。。一次

access_token

string

yes

将access_token用作某些API的通用请求参数。。。。。。。。有用多次使用,,,,,,,有用期为4小时

expire_in

int

yes

access_token逾期时间,,,,,,,单位为秒

 

Refresh Access_token

API: https://partner.shopeemobile.com/api/v2/auth/access_token/get Method: Post

Description: 使用此API和代码来重新获取access_token当access_token逾期后。。。。。。。。

使用参数




字段

类型

须要

说明

refresh_token

string

Yes

使用refresh_token获取新的access_token。。。。。。。。一次性使用,,,,,,,有用期为30天。。。。。。。。

partner_id

Int

Yes

开发者APP的Partner id

shop_id

Int

Yes

卖场Shop id

 

返回内容




字段

类型

须要

说明

request_id

string

Yes

用于提供应Shopee盘问呼叫纪录

error

string

Yes

过失讯息,,,,,,,若无过失则返回空值

refresh_token

string

Yes

使用refresh_token获取新的access_token。。。。。。。。一次性使用,,,,,,,有用期为30天

access_token

string

Yes

将access_token用作某些API的通用请求参数。。。。。。。。有用多次使用,,,,,,,有用期为4小时

expire_in

Int

Yes

access_token逾期时间,,,,,,,单位为秒

partner_id

Int

Yes

开发者APP的Partner id

shop_id

Int

Yes

卖场Shop id

 

取得Shop ID要领

授权后欲审查Shop ID可参考以下要领:

●   一经卖家授权完成后,,,,,,,开发者的信箱将会收到授权通知信,,,,,,,信件内部将提及Shop ID。。。。。。。。(测试情形不

●   Shop ID将会泛起在授权完成后跳转的页面网址中,,,,,,,例如在组成卖家授权网址时,,,,,,,填入Redirect Url为https://www.google.com/,,,,,,,则一经授权网址则会加上Shop ID,,,,,,,如下图所示:

●   若是启用了Webhook功效,,,,,,,JSON新闻将被推送到开发者的Callback URL。。。。。。。。(测试情形不支持)

●   可透过shopee.public.GetShopsByPartner获取该Partner id下的所有Shop id。。。。。。。。

 

shopee官网原文详情:

v2授權教學

v2授權網址組成說明       

返回內容




欄位

類型

须要

說明

code

string

Yes

用於獲取access_token和refresh_token。。。。。。。。一次性使用有用期為10分鐘。。。。。。。。

Shop_id

int

yes

完成授權的shop_id

 

開發人員凭证以下規則天生授權連結,,,,,,,連結提供給賣場營運人員進行授權。。。。。。。。授權完畢後即可透過API對店鋪進行操作。。。。。。。。作废授權作法流程同賣場授權流程。。。。。。。。

作废授權網址


https://partner.shopeemobile.com/api/v2/shop/cancel_auth_partner

正式環境

https://partner.uat.shopeemobile.com/api/v2/shop/cancel_auth_partner

測試環境

 

授權使用參數




欄位

類型

须要

說明

partner_id

 

Int

yes

Partner ID可點選右上角console後選擇APP,,,,,,,則可在APP List中审查

Redirect

String

yes

僅在授權乐成後導向的頁面,,,,,,,可以使用任何網址

(e.g.公司網站、賣場網址)

Sign

String

yes

依Shopee規則產生的字串

timestampt

int

yes

需要與sign字串使用的時間戳記坚持一致。。。。。。。。 5分鐘後過期。。。。。。。。

 

v2授權網址組成範例

本部分說明怎样天生用於賣場授權的HMAC-SHA256。。。。。。。。

v2授權網址組成步驟

1.    組成sign的規則

10090/api/v2/shop/auth_partner1594897040

凭证此順序,,,,,,,以partner_id ,,,,,,,api path ,,,,,,,timestamp組成sign。。。。。。。。

2.    加密字串

依上一步驟將字串結合後需要透過SHA256 hashing algorithm(HMAC)加密,,,,,,,加密後則為Token。。。。。。。。加密後範例如下:

90c12d3932f3826f0c72242e1ec6492eec9a1298658f41f7a9469664801c4e5a

3.    組成授權網址

 

接著凭证上述"授權網址組成範例"的規則組成授權網址

4.    完成授權

https://www.www.sdxldwyx.com/?code=xxxxxxxxxx&shop_id=xxxxxx

遵照上述網址完成賣場授權後,,,,,,,將重新導至此網址:(xxx体现隨機或以該賣場shop id為主)

 

v2授權逾時邏輯

授權網址會在5分鐘內過期(因為Timestamp過期),,,,,,,以是開發人員必須重新天生一個新的授權網址。。。。。。。。

若進入授權網址後,,,,,,,未在3分鐘內登入賣場帳號、密碼,,,,,,,將會获得錯誤訊息"operation overtime",,,,,,,需要重新進入賣場授權網址,,,,,,,而不是重新整理該頁面。。。。。。。。

 

v2驗證請求說明

除非指定對某些特定的API使用HTTP / FORM(在API文檔中有說明),,,,,,,否則對所有其餘的API使用HTTP / JSON。。。。。。。。

以下教學同OpenAPI 2.0 Authorization & Authentication。。。。。。。。

使用參數




欄位

類型

须要

說明

partner_id

Int

yes

Partner   ID可點選右上角console後選擇APP,,,,,,,則可在APP List中审查

timestamp

Int

Yes

所有請求都必須包括。。。。。。。。 5分鐘後過期

access_token

String

No

    將access_token用作某些API的通用請求參數,,,,,,, 在過期前可以多次使用,,,,,,,有用期為4小時

要調用Get Access_token API和刷新Access_token API,,,,,,,可以跳過此參數

sign

String

Yes

依Shopee規則產生的字串

 

shop_id

 

int

No


 

返回內容




欄位

類型

须要

說明

request_id

string

Yes

用於提供給Shopee查詢呼叫紀錄

error

string

Yes

錯誤訊息,,,,,,,若無錯誤則返回空值

message

string

No


response

object

no

詳細錯誤訊息說明

 

Step1、建设簽名基底字元串

本部分說明怎样為API請求用的驗證天生HMAC-SHA256。。。。。。。。

凭证此順序,,,,,,,使用partner_id ,,,,,,,api path ,,,,,,,timestamp ,,,,,,,access_token 和shop_id 組成sign(要調用Get Access_token API和Refresh Access_token API,,,,,,,可以在符號基礎字串中跳過access_token)。。。。。。。。

 

Step2、簽名加密

將Sign和Partner key以HMAC-SHA256 hashing algorithm來加密。。。。。。。。

 

Get Access_token

API: https://partner.shopeemobile.com/api/v2/auth/token/get Method: Post

Description: 使用此API和代碼來獲取access_token和refresh_token。。。。。。。。

使用參數




欄位

類型

须要

說明

code

String

yes

賣場授權後,,,,,,,重新導向URL中的代碼。。。。。。。。為一次性使用,,,,,,,有用期為10分鐘

partner_id

Int

Yes

開發者APP的Partner id

shop_id

int

Yes

賣場Shop id

 

返回內容




欄位

類型

须要

說明

request_id

string

yes

用於提供給Shopee查詢呼叫

error

string

yes

紀錄錯誤訊息,,,,,,,若無錯誤則返回空值

refresh_token

string

yes

使用refresh_token獲取新的access_token。。。。。。。。一次

access_token

string

yes

將access_token用作某些API的通用請求參數。。。。。。。。有用多次使用,,,,,,,有用期為4小時

expire_in

int

yes

access_token過期時間,,,,,,,單位為秒

 

Refresh Access_token

API: https://partner.shopeemobile.com/api/v2/auth/access_token/get Method: Post

Description: 使用此API和代碼來重新獲取access_token當access_token過期後。。。。。。。。

使用參數




欄位

類型

须要

說明

refresh_token

string

Yes

使用refresh_token獲取新的access_token。。。。。。。。一次性使用,,,,,,,有用期為30天。。。。。。。。

partner_id

Int

Yes

開發者APP的Partner id

shop_id

Int

Yes

賣場Shop id

 

返回內容




欄位

類型

须要

說明

request_id

string

Yes

用於提供給Shopee查詢呼叫紀錄

error

string

Yes

錯誤訊息,,,,,,,若無錯誤則返回空值

refresh_token

string

Yes

使用refresh_token獲取新的access_token。。。。。。。。一次性使用,,,,,,,有用期為30天

access_token

string

Yes

將access_token用作某些API的通用請求參數。。。。。。。。有用多次使用,,,,,,,有用期為4小時

expire_in

Int

Yes

access_token過期時間,,,,,,,單位為秒

partner_id

Int

Yes

開發者APP的Partner id

shop_id

Int

Yes

賣場Shop id

 

取得Shop ID要领

授權後欲审查Shop ID可參考以下要领:

●   一經賣家授權完成後,,,,,,,開發者的信箱將會收到授權通知信,,,,,,,信件內部將提及Shop ID。。。。。。。。(測試環境不

●   Shop ID將會出現在授權完成後跳轉的頁面網址中,,,,,,,例如在組成賣家授權網址時,,,,,,,填入Redirect Url為https://www.google.com/,,,,,,,則一經授權網址則會加上Shop ID,,,,,,,如下圖所示:

●   若是啟用了Webhook功效,,,,,,,JSON新闻將被推送到開發者的Callback URL。。。。。。。。(測試環境不支援)

●   可透過shopee.public.GetShopsByPartner獲取該Partner id下的所有Shop id。。。。。。。。

 

文章泉源:shopee官方网站

更多
【网站地图】【sitemap】