Come aggiungere clienti tramite API?
POST: http://www.namedoseusite.com.br/api_customers.php?act=add_customers
parametro | formato | Descrizione |
clienti_firstname | json |
Clienti FirstName |
clienti_lastname | json | Clienti LastName È richiesto solo testo Formato: varchar (32) * campo richiesto |
clienti_email_address | json | Indirizzo e -mail Esempio: name@site.com.br formato: varchar (96) * campo richiesto |
clienti_password | json | password minimo: 8 caratteri formato: varchar (40) * campo richiesto |
Clienti_Telephone | json | Telefono Esempio: (11) 3230-6255 Formato: varchar (32) * campo richiesto |
Clienti_telephone_commercial | json | Telefono commerciale Esempio: (11) 3230-6255 Formato: varchar (32) |
clienti_telephone_mobile | json | Telephone Mobile Esempio: (11) 3230-6255 Formato: varchar (32) |
skype | json | Nome Skype Formato: varchar (32) |
msn | json | Nome msn formato: varchar (32) |
clienti_fax | json | Fax Telephone Esempio: (11) 3230-6255 Formato: varchar (32) |
Clienti_Newsletter | json | Usa 1 su yes o da 0 a no è richiesto un solo numero : int (1) * campo richiesto |
clienti_groups_id | json | Controlla l’API per ottenere l’elenco dei gruppi di clienti è richiesto un solo numero formato: int (11) * campo richiesto |
Clienti_Language | json |
Inglese, spagnolo, giapponese o portoghese |
clienti_gender | json | m o f * campo richiesto |
clienti_dob | json | dd/mm/yyyy * campo richiesto |
entry_street_address | json | Indirizzo di strada Formato: varchar (64) * campo richiesto |
entry_number | json | numero Street Indirizzo è richiesto un solo numero * campo richiesto |
entry_completion | json | Indirizzo di Street di completamento |
entry_suburb | json | suburb |
entry_postcode | json | POST CODICE è richiesto un solo numero * campo richiesto |
entry_city | json | città è richiesto solo testo * campo richiesto |
entry_state | json | Controlla l’API per ottenere l’elenco di Stato * campo richiesto |
entry_country_id | json | Controlla l’API per ottenere l’elenco del paese è richiesto un solo numero * campo richiesto |
entry_rg | json | rg |
entry_cpf | json | cpf |
entry_company | json | Nome azienda |
entry_cnpj | json | cnpj |
entry_ie | json | ie |
Person_kind | json | PJ o PF Formato: varchar (2) * campo richiesto |
campione PHP
$ Url = $ tabain_url. ' /pi_customers.php? Action = add_customers ' ;;
$ data = Array (“Customs_FirstName” = & gt; “Clienti FirstName”, // Clienti FirstName * campo richiesto
“Customs_LastName” = & gt; “Clienti LastName”, // Clienti LastName * Field richiesto
“Clienti_Email_address” = & gt; “email@mformula.com.br”, // Indirizzo e -mail * campo richiesto
“Clienti_Password” = & gt; “Test”, // Password * campo richiesto
“Customer_telephone” = & gt; “(11) 3230-6255”, // Esempio di telefono: (11) 3230-6255 * campo richiesto
“Customer_telephone_commercial” = & gt; “(11) 3230-6255”, // Esempio di telefono commerciale: (11) 3230-6255
“Clienti_telephone_mobile” = & gt; “(11) 3230-6255”, // Esempio di cellulare: (11) 3230-6255
“Skype” = & gt; “”, // nome Skype
“msn” = & gt; “”, // msn
“Clienti_fax” = & gt; “”, // Esempio di telefono fax: (11) 3230-6255
“Clienti_Newsletter” = & gt; “1”, // Utilizzare il campo 1 a yes o 0 a (è richiesto solo numero) * campo richiesto
“Clienti_Groups_id” = & gt; “”, // Controlla l’API per ottenere l’elenco dei gruppi di clienti
“Customer_Language” = & gt; “Portoghese”, // campo inglese, spagnolo, giapponese o portoghese * richiesto
“Customer_Gender” = & gt; “M”, // m o f * campo richiesto
“Customer_Dob” = & gt; “01/02/1980”, // DD/MM/YYYY * Field richiesto
“entry_street_address” = & gt; “Av Paulista”, // Indirizzo Street * Field richiesto
“entry_number” = & gt; “1500”, // Numero Indirizzo Street * Field richiesto
“entry_completion” = & gt; “”, // Indirizzo della strada completa
“entry_suburb” = & gt; “Giardini”, // sobborgo
“entry_postcode” = & gt; “04206000”, // POST CODICE
“entry_city” = & gt; “Sao Paulo”, // City * Field richiesto
“entry_state” = & gt; “Sao Paulo”, // Controlla l’API per ottenere l’elenco del campo di stato * richiesto
“entry_country_id” = & gt; “30”, // Controlla l’API per ottenere l’elenco del paese
“Entry_rg” = & gt; “”, // rg
“entry_cpf” = & gt; “28240621856”, // CPF
“Entry_company” = & gt; “”, // Nome della ditta
“entry_cnpj” = & gt; “”, // cnpj
“entry_ie” = & gt; “”, // CIOÈ
“Person_kind” = & gt; “pf” // pj o pf * 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 i clienti eof re>
Errore di ritorno:
codice
messaggio
Successo di ritorno:
codice
ID
messaggio