Como obter a lista de produtos cadastrados via API ?


URL: http://www.nomedoseusite.com.br/api_products_others.php?action=list_products

 

Header Parameter Format
Token base64_encode()
Secret base64_encode()
E-mail base64_encode()

 

Parameter Format Description
status GET

1, 2 or 3
Only number is required

search_model GET Product model
search GET Product Name
category GET Category number
Only number is required
sort_order GET Sorte order by:
sort_product_name
sort_date_added
sort_date_updated
sort_code
sort_quantity
sort_price
sort_bestseller

 

PHP Sample:

 

	// sample list products
	
	$add_query_order = '';
	if ($_GET['status'] != '') {
		$add_query_order .= '&status='.$_GET['status'];
	}
	if ($_GET['search_model'] != '') {
		$add_query_order .= '&search_model='.$_GET['search_model'];
	}
	if ($_GET['search'] != '') {
		$add_query_order .= '&search='.$_GET['search'];
	}
	if ($_GET['category'] != '') {
		$add_query_order .= '&category='.$_GET['category'];
	}
	if ($_GET['sort_order'] != '') {
		$add_query_order .= '&sort_order='.$_GET['sort_order'];
	}

	$url = $domain_url . '/api_seller_products_others.php?action=list_products'.$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(                                                                          
		'Content-Type: application/json',
		"Cache-Control: no-cache", 
		'Token: ' . base64_encode($token),
		'Secret: ' . base64_encode($secret),
		'E-mail: ' . base64_encode($email))
	);                                                                                                                   
																														 
	$result = curl_exec($ch);
	curl_close($ch);

	print_r($result);

	// sample list products eof

 

Return:

products_id
image
name
model
quantity
price
status
date_added
last_modified

 

2018-09-02 10:45 MFORMULA FAQ {writeRevision}
Avaliaçãoo mídia: 0 (0 Votos)

Não pode comentar este artigo

Chuck Norris has counted to infinity. Twice.

{debugMessages}