1. Home
  2. /
  3. Catalogo elettronico Mformula
  4. /
  5. API
  6. /
  7. Produtos
  8. /
  9. Come aggiungere unità di...

Come aggiungere unità di vendita tramite API?

POST: http://www.namedoseusite.com.br/api_products_thers.php?act=add_uv

parametro header formato
usuario1 base64_encode ()
password1 base64_encode ()

parametro formato Descrizione
uv_name_text json

Nome principale dell’unità di vendita
Formato: testo
* campo richiesto

campione PHP

// campione aggiungi UV

$ Url = $ tabain_url. ' /pi_products_ors.php? Action = add_uv &#39 ;;

$ Data = array (“uv_name_text” = & gt; “nome principale dell’unità di vendita” // Nome principale dell’unità di vendita * campo richiesto
);

$ 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 (
' tipo di contenuto: Applicazione/JSON ',
“Cache-Control: No-Cache”,
' usuario1: ' . base64_encode ($ usuario1),
' password1: ' . base64_encode ($ password1),
' lunghezza del contenuto: ' . Strlen ($ data_string)))
);

$ result = curl_exec ($ ch);
CURL_CLOSE ($ CH);

print_r ($ risultato);

// campione aggiungi UV eof

Errore di ritorno:

codice
messaggio

Successo di ritorno:

codice
ID
messaggio

Lascia un commento 0