POST Body Contents


#1

Hello community, I am new to SONAR and I have to admit that coding/programming is not my field at all, however, this is an important project for us and I definitely want to helps as much as I can.

By any chance can you help me putting together the body of my POST request in order to create a user using the API?.

I am using this POST:
https://BLABLABLA.software/api/v1/accounts/

The Body of my request looks like:

{
“name”: “Julian Franco”,
“account_type_id”: 1,
“account_status_id”: 3,
“next_bill_date”: “2018-07-11”,
“line1”: “Somewheret”,
“city”: “Stratford”,
“state”: “ON”,
“county”: “”,
“zip”: “”,
“country”: “CA”,
“latitude”: 45.367598,
“longitude”: -85.985007,
“contact_name”: “Julian Franco”,
“delinquent”: false
}

When I send the request, I always get a 200 OK response, however, what is is returned is a list of all the accounts.

Thanks for your time.

Regards,

Julian F


#2

That means you are using a GET, not a POST. Some of those fields are also invalid, check https://sonar.software/apidoc/#api-Accounts-PostAccount for a list of valid fields.