How to edit manufacturers via API?


POST: http://www.nomedoseusite.com.br/api_products_others.php?action=edit_manufacturers

 

Header Parameter Format
Usuario1 base64_encode()
Senha1 base64_encode()

 

Parameter Format Description
manufacturers_id JSON ID number of manufacturer
Format: int(11)
* FIELD REQUIRED
manufacturers_name JSON

Main name of manufacturer
Format: varchar(32)
* FIELD REQUIRED

manufacturers_banner_status JSON 1 = ACTIVE or 0 = INACTIVE
Only number is required
Format: int(1)
* FIELD REQUIRED
manufacturers_description JSON Full description of manufacturer
Format: text
manufacturers_url JSON URL link of manufacturer
Example: http://www.sitename.com
Format: varchar(255)

PHP Sample

 

	// sample edit manufacturers
	
	$url = $domain_url . '/api_products_others.php?action=edit_manufacturers';

	$data = array("manufacturers_id" => "", // ID number of manufacturer * FIELD REQUIRED
				  "manufacturers_name" => "Main name of manufacturer", // Main name of manufacturer * FIELD REQUIRED
				  "manufacturers_banner_status" => "1", // 1 = ACTIVE or 0 = INACTIVE (Only number is required) * FIELD REQUIRED
				  "manufacturers_description" => "Full description of manufacturer", // Full description of manufacturer
				  "manufacturers_url" => "URL link of manufacturer" // URL link of manufacturer Example: http://www.sitename.com
				  );
				  
	$data_string = json_encode($data);  

	$ch = curl_init($url);
	curl_setopt($ch, CURLOPT_CUSTOMREQUEST, "POST");                                                                     
	curl_setopt($ch, CURLOPT_POSTFIELDS, $data_string);                                                                  
	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", 
		'Usuario1: ' . base64_encode($usuario1),
		'Senha1: ' . base64_encode($senha1),                                                                                
		'Content-Length: ' . strlen($data_string))                                                                       
	);                                                                                                                   
																														 
	$result = curl_exec($ch);
	curl_close($ch);

	print_r($result);
	
	// sample edit manufacturers eof

 

Return Error:

code
message

Return Success:

code
id
message

2018-08-30 12:52 MFORMULA {writeRevision}
Average rating: 0 (0 Votes)

You cannot comment on this entry

Chuck Norris has counted to infinity. Twice.

{debugMessages}