根据 square up 的文档,在获得个人访问令牌后,我应该能够通过 curl 的简单请求来检索商家 ID。但是,我收到一个错误。如何获取商家 ID 而不是异常?
从https://docs.connect.squareup.com:
现在您可以使用您的个人访问令牌将您的第一个请求发送到 Connect API。
打开终端窗口并运行以下 curl 命令,在指示的位置提供您的个人访问令牌:
curl -H "Authorization: Bearer PERSONAL_ACCESS_TOKEN" https://connect.squareup.com/v1/me
文档中的预期结果:
{ "id": "JGHJ0343", "name": "Dave Davis", "email": "dave@example.com", "country_code": "US", "language_code": "en-US", "business_name": "Dave's Milkshakes", "business_address": { "address_line_1": "1455 Market St", "locality": "San Francisco", "administrative_district_level_1": "CA", "postal_code": "94103" }, "business_phone": { "calling_code": "+1", "number": "4155551234" }, "business_type": "restaurants", "account_type": "LOCATION" }
异常文本:
PS C:\Users\JMCC> curl -H "Authorization: Bearer PERSONAL_ACCESS_TOKEN" https://connect.squareup.com/v1/me
Invoke-WebRequest : Cannot bind parameter 'Headers'. Cannot convert the "Authorization: Bearer PERSONAL_ACCESS_TOKEN" value of type "System.String" to type "System.Collections.IDictionary".
...