使用rest Magento2获取客户的所有地址

使用rest Magento2获取客户的所有地址,magento2,customer-account-data-api,Magento2,Customer Account Data Api,如何使用rest Magento2获取客户的所有地址?是否有现成的API?是的,如果您有客户ID: GET /V1/customers/{customerId} 这将返回所有客户地址 "customer": { "id": 0, "default_billing": "string", "default_shipping": "string", "addresses": [ { "id": 0, "customer_id": 0,

如何使用rest Magento2获取客户的所有地址?是否有现成的API?

是的,如果您有客户ID:

GET /V1/customers/{customerId}
这将返回所有客户地址

"customer": 
{
  "id": 0,
  "default_billing": "string",
  "default_shipping": "string",
  "addresses": [
    {
      "id": 0,
      "customer_id": 0,
      "region": {
        "region_code": "string",
        "region": "string",
        "region_id": 0,
        "extension_attributes": {}
      },
      "region_id": 0,
      "country_id": "string",
      "street": [
        "string"
      ]
    }
  ]
}

是的,如果您有客户ID:

GET /V1/customers/{customerId}
这将返回所有客户地址

"customer": 
{
  "id": 0,
  "default_billing": "string",
  "default_shipping": "string",
  "addresses": [
    {
      "id": 0,
      "customer_id": 0,
      "region": {
        "region_code": "string",
        "region": "string",
        "region_id": 0,
        "extension_attributes": {}
      },
      "region_id": 0,
      "country_id": "string",
      "street": [
        "string"
      ]
    }
  ]
}

嗨,我是API新手,我正在尝试使用API获得客户,我的训练:127.0.0.1/anusthana/API/rest/customer->返回错误,我从谷歌找到一些知识,他们说你传递令牌,我不知道如何传递令牌,但我知道我的令牌->如何使用它?你能帮我吗@sissyMy帐户无法正常工作我无法发布,你能在这里帮我吗?试着写一篇帖子解释你所做的事情,我无法帮你评论或聊天,抱歉,至少谢谢你的回复。嗨,我是API的新手,我试图通过使用API获得客户,我的训练:127.0.0.1/anusthana/api/rest/customer->它的返回错误,我从谷歌上找到了一些知识,他们说你传递令牌,我不知道如何传递令牌,但我知道我的令牌->我如何使用它?你能帮我吗@Sissym的帐户无法正常工作我无法发布,你能在这里帮我吗?试着写一篇帖子解释你所做的事情,我无法帮你评论或聊天,抱歉,至少谢谢你的回复。