Hi,
i’m trying to update a program i’ve made some years ago due to an upgrade in the API on the other side.
I was able to update most of my code succesfully but i don’t know how to implement this change :
The example code for what i'm tryng to do is as follow :
> curl -X PUT "https://api-v2.fattureincloud.it/c/12345/entities/clients/12345" \
> -H "Accept: application/json" \
> -H "Authorization: Bearer MYAPIKEY" \
> -H "Content-Type: application/json" \
> -d '{"data":{"code":"AE86","name":"Avv. Maria Rossi","type":"person","first_name":"Maria","last_name":"Rossi","contact_person":"","vat_number":"IT12345640962","tax_code":"BLTGNI5ABCDA794E","address_street":"Via Roma, 1","address_postal_code":"20900","address_city":"Milano","address_province":"MI","address_extra":"","country":"Italia","email":"maria.rossi@example.com","certified_email":"maria.rossi@pec.example.com","phone":"1234567890","fax":"","notes":"","default_payment_terms":1,"default_payment_terms_type":"standard","bank_name":"Indesa","bank_iban":"IT40P123456781000000123456","bank_swift_code":"AK86PCT","shipping_address":"Corso Magellano 4","e_invoice":true,"ei_code":"111111","default_vat":{"id":54321,"value":45,"description":"","is_disabled":false}}}'
My working code for other API call is :
Var Connection As New URLConnection
Var Contenuto As String
Var json As New JSONItem
Var d As New Dictionary
Dim URL As StringConnection.RequestHeader(“Authorization”) = “Bearer MYAPIKEY”
Connection.SetRequestContent(json.ToString, “application/json”)
URL = “https://api-v2.fattureincloud.it/c/325415/entities/clients/” + SCEGLICLI.ElencoAnagrafica.Cell(SCEGLICLI.ElencoAnagrafica.ListIndex,0)
Contenuto = Connection.SendSync (“GET”, URL, 30)
Connection.Disconnect
d = ParseJSON (Contenuto)
The problem in this case is that i don’t know how to pass the -d data part to URLConnection. Also is enough to replace the GET command with PUT command ?
Thanks
Mattia