Warning: file_get_contents(/data/phpspider/zhask/data//catemap/8/api/5.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Php 修改现有履行意外返回404页_Php_Api_Shopify_Fulfillment - Fatal编程技术网

Php 修改现有履行意外返回404页

Php 修改现有履行意外返回404页,php,api,shopify,fulfillment,Php,Api,Shopify,Fulfillment,我目前正在github上使用Sandepshetty的shopify.php插件 该插件似乎可以工作,逻辑相当简单。我已经使用“创建新的履行”对其进行了测试,但是在使用“修改现有履行”API调用时收到错误消息 我提交以下字符串,收到404错误 $orders = $shopify('PUT', "/admin/orders/160387514/fulfillments/791851111396.json", $fulfillment_put, $response_headers); 其中,$

我目前正在github上使用Sandepshetty的shopify.php插件

该插件似乎可以工作,逻辑相当简单。我已经使用“创建新的履行”对其进行了测试,但是在使用“修改现有履行”API调用时收到错误消息

我提交以下字符串,收到404错误

$orders = $shopify('PUT', "/admin/orders/160387514/fulfillments/791851111396.json", $fulfillment_put, $response_headers);
其中,$fulfillment\u put转换为有效负载

{ "fulfillment": { "tracking_number": "987654321", "id": 255858046 } }
下面是PUT命令的详细转储。正如上面所看到的,我对路径使用了以下格式。我确实用hidden或alt替换了一些变量,仅供参考

/admin/orders/#{order_id}/fulfillments/#{product_id}.json

* About to connect() to alt.myshopify.com port 443 (#0)
*   Trying 204.93.213.40... * connected
* Connected to alt.myshopify.com (204.93.213.40) port 443 (#0)
* successfully set certificate verify locations:
*   CAfile: /usr/share/curl/curl-ca-bundle.crt
  CApath: none
* SSL connection using RC4-SHA
* Server certificate:
* subject: /serialNumber=Hidden/C=CA/ST=Ontario/L=Ottawa/O=Jaded Pixel Technologies Inc./CN=*.myshopify.com
* start date: 2010-05-10 22:23:08 GMT
* expire date: 2015-08-12 19:17:14 GMT
* subjectAltName: alt.myshopify.com matched
* issuer: /C=US/O=Equifax/OU=Equifax Secure Certificate Authority
* SSL certificate verify ok.
* Server auth using Basic with user 'hidden for privacy'
> PUT /admin/orders/160387514/fulfillments/791851111396.json HTTP/1.1
Authorization: Basic hidden for privacy=
User-Agent: HAC
Host: alt.myshopify.com
Accept: */*
Content-Type: application/json; charset=utf-8
Content-Length: 62

< HTTP/1.1 404 Not Found
< Server: nginx
< Date: Thu, 21 Mar 2013 21:39:06 GMT
< Content-Type: application/json; charset=utf-8
< Transfer-Encoding: chunked
< Connection: keep-alive
< Vary: Accept-Encoding
< Status: 404 Not Found
< X-Shopify-Shop-Api-Call-Limit: 2/500
< HTTP_X_SHOPIFY_SHOP_API_CALL_LIMIT: 2/500
< X-Request-Id: 7ec529327cd022e973f22be4a9e86916
< X-UA-Compatible: IE=Edge,chrome=1
< Set-Cookie: _secure_session_id=hidden; path=/; secure; HttpOnly
< X-Runtime: 0.042757
< 
* Connection #0 to host alt.myshopify.com left intact
* Closing connection #0
*即将()连接到alt.myshopify.com端口443(#0)
*正在尝试204.93.213.40…*有联系的
*已连接到alt.myshopify.com(204.93.213.40)端口443(#0)
*已成功设置证书验证位置:
*CAfile:/usr/share/curl/curl-ca-bundle.crt
卡帕斯:没有
*使用RC4-SHA的SSL连接
*服务器证书:
*主题:/serialNumber=Hidden/C=CA/ST=Ontario/L=Ottawa/O=Jaded Pixel Technologies Inc./CN=*.myshopify.com
*开始日期:2010-05-10 22:23:08格林威治标准时间
*过期日期:2015-08-12 19:17:14 GMT
*subjectAltName:alt.myshopify.com匹配
*颁发者:/C=US/O=Equifax/OU=Equifax安全证书颁发机构
*SSL证书验证正常。
*使用Basic对用户“出于隐私而隐藏”进行服务器身份验证
>PUT/admin/orders/160387514/fulfillments/791851111396.json HTTP/1.1
授权:基本的隐藏隐私=
用户代理:HAC
主持人:alt.myshopify.com
接受:*/*
内容类型:application/json;字符集=utf-8
内容长度:62
未找到
附言。 我想指出的是,我使用了以下API文档

它建议我使用 PUT/admin/orders/#{id}/fulfillments/#{id}.json

但是,#{id}在那里被引用了两次,这表明我应该连续使用Order id两次,但是文档清楚地显示了/admin/orders/450789469/fulfillments/255858046.json的示例
我想进一步澄清一下实际的{id}代表什么以及如何使用它们。

我认为您只是在/admin/orders/{id}/fulfillments/{id}.json中为第二个id使用了错误的id。第一个是订单ID,第二个是履行ID。履行ID已在创建履行响应中返回。

感谢您的响应,很抱歉延迟接受。问题很简单,就是使用了错误的ID。