(Solved) – MS Access VBA HTTP req using cURL library -r Child fields

(solved)-–-ms-access-vba-http-req-using-curl-library-r-child-fields

I am accessing an API using VBA in MS Access.

I have my HTTP scripts running fine and i can POST and create customers but I am having issue with the Address field.
This is because instead of just being one field, it has child fields which I don’t know the syntax for.

Can anyone give a hand with syntax for a -d cURL syntax child fields in VBA?

reqBody = "description=" & desc & _
"&email=" & pEmail & _
"&name=" & pName & _
"&phone=" & pPhone

Set httpReq = CreateObject("MSXML2.ServerXMLHTTP")
httpReq.Open "POST", API_URL, False

httpReq.setRequestHeader "Authorization", "Bearer " & api_key
httpReq.send reqBody
strResponse = httpReq.responseText

From the documentation from the API:

> address optional dictionary The customer’s address.
> 
> Address.line1 REQUIRED Address line 1 (e.g., street, PO Box, or
> company name).
> 
> address.city optional City, district, suburb, town, or village.
> 
> address.country optional Two-letter country code (ISO 3166-1 alpha-2).
> 
> address.line2 optional Address line 2 (e.g., apartment, suite, unit,
> or building).
> 
> address.postal_code optional ZIP or postal code.
> 
> address.state optional State, county, province, or region.

Leave a Reply

Your email address will not be published. Required fields are marked *