首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >Shopee访问令牌?

Shopee访问令牌?
EN

Stack Overflow用户
提问于 2022-05-30 07:27:06
回答 1查看 143关注 0票数 0

我是商店API中的新手,我只是想知道如何找到访问令牌?

代码语言:javascript
复制
    $host = '*****';
    $date = new DateTime();
    $timestamp = $date->getTimestamp();
    $partner_id = ****;
    $shop_id = ****;
    $secret_key = "**********";
    $path = "/api/v2/product/get_item_list"; //without the host
    $base_str = $partner_id . $path . $timestamp . $shop_id;            
    $sign = hash_hmac('sha256', $base_str,  $secret_key, false);
    $sign = bin2hex($sign);

    $response = Http::withHeaders([
        //'X-First' => 'foo',
        //'X-Second' => 'bar'
    ])->get('https://partner.test-stable.shopeemobile.com/api/v2/product/get_item_list', [
        
        'partner_id'=>$partner_id,
        'timestamp'=>$timestamp,
        'access_token'=>$sign,
        'shop_id'=>$shop_id,
        'sign'=>$sign
    ]);

    return $response; 

错误是:{"request_id":"821fbdc3e5f41d32884586c7f44be93a"," error ":"error_auth",“message”:“无效access_token”}。

如何获得access_token代码,是在商店管理页面中,还是需要创建代码才能得到?

EN

回答 1

Stack Overflow用户

回答已采纳

发布于 2022-06-01 02:22:34

您需要首先使用auth_partner API从Shopee获取访问代码。您可以在v2 Shop授权下的OpenAPI 2.0概述中参考如何从它们的文档中获取访问令牌。

https://open.shopee.com/documents/v2/OpenAPI%202.0%20Overview?module=87&type=2

票数 0
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/72430568

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档