APIを介して登録された製品のリストを取得するにはどうすればよいですか?
url:http://www.namedoseusite.com.br/api_products_ots.php?action=list_products
<テーブルスタイル= "幅:100%;">
パラメーター | フォーマット | 説明 |
status | get |
1、2または3 |
search_model | get | 製品モデル |
検索 | get | 製品名 |
カテゴリ | get | カテゴリ番号 番号のみが必要です< /td> |
sort_order | get | ラッキーオーダー: sort_product_name sort_date_added sort_date_updated sort_quantity sort_price sort_bestseller < /td> |
phpサンプル:
//サンプルリスト製品$ add_query_order =&#39;&#39 ;;
if($ _get [&#39;]!=&#39;&#39;){
$ add_query_order。=&#39;&amp; status =&#39; $ _ get [&#39; status&#39;];
}
if($ _get [&#39; search_model&#39;]!=&#39;&#39;){
$ add_query_order。=&#39;&amp; search_model =&#39; $ _ get [&#39; search_model&#39;];
}
if($ _get [&#39; search&#39;]!=&#39;&#39;){
$ add_query_order。=&#39;&amp; search =&#39; $ _ get [&#39; search&#39;];
}
if($ _get [&#39; category&#39;]!=&#39;&#39;){
$ add_query_order。=&#39;&amp; category =&#39; $ _ get [&#39; category&#39;];
}
if($ _get [&#39; sort_order&#39;]!=&#39;&#39;){
$ add_query_order。=&#39;&amp; sort_order =&#39; $ _ get [&#39; sort_order&#39;];
}$ url = $ tabain_url。 &#39; /api_seller_products_others.php?action = list_products&#39 ;. $ add_query_order;
$ ch = curl_init($ url);
curl_setopt($ ch、curlopt_returntransfer、true);
curl_setopt($ ch、curlopt_ssl_verifypeer、false);
curl_setopt($ ch、curlopt_httpheader、array(
&#39; content-type:application/json&#39;、
「キャッシュコントロール:キャッシュなし」、
&#39; usuario1:&#39; 。 base64_encode($ usuario1)、
&#39; Password1:&#39; 。 base64_encode($ password1)、
&#39;コンテンツレングス:&#39; 。 strlen($ data_string)))
);$ result = curl_exec($ ch);
curl_close($ ch);print_r($ result);
//サンプルリスト製品EOF
返品:
products_id
image
name
model
数量
status
date_added
last_modified < /p>