我无法使用shopify Api获取page_info [英] i can not able to get page_info using shopify Api
本文介绍了我无法使用shopify Api获取page_info的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我正在执行Shopify版本控制,因为我无法获取页面数据.我查看了API新版本,因为我在显示page_info的位置显示page_info
I am doing Shopify versioning in that I can not get page wise data. I review API new version in that I show page_info where to I get page_info
$api_url = 'https://6b4c824f22b4f24ddewwerew0a9b36397fd27e5c4:a5cb5dd808ec7392ewrewrwerwerwed8872be5aa5d3b1c@bacsolution-4.myshopify.com/admin/api/2020-01/products.json?limit='.$limit.';rel=next';
//$api_url = 'https://'.$shop.'/admin/products.json?limit='.$limit.'&page='.$i.'';
//$fieldstoselect = 'id,title,variants';
$fieldstoselect = 'id,title';
$api_url = $api_url.'&fields='.$fieldstoselect;
$headr = array();
$headr[] = 'Content-Type: application/json';
//$headr[] = 'X-Shopify-Access-Token:'.$token;
$ch = curl_init($api_url);
curl_setopt($ch, CURLOPT_HTTPHEADER, $headr);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false);
curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, false);
$res = curl_exec($ch);
$response_all = json_decode($res);
echo "<pre>";
print_r($response_all);
exit;
推荐答案
如果使用的是REST API,则会在响应标头中获取它.请在下面的响应标题屏幕截图中查看.
If you are using REST API then you will get it in the response header. have a look in below screenshot of response header.
以下文章可能会帮助您如何从响应标头中提取此pageInfo
And below post might help you on how to extract this pageInfo from response header
这篇关于我无法使用shopify Api获取page_info的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文