Problem adding a company using POST fieldapi/companies/v1
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
I need to add companies to projects using the fieldapi/companies/v1/add_to_projects api. The problem is although I have these companies in admin (added via hq/v1/accounts/:account_id/companies), I don't have the necessary field company ids for them to make the add_to_projects call (the field project ids are no problem). Therefore, I'm trying to add each company to Bim360 Field Company using the fieldapi/companies/v1 api. I will then retrieve the id and make the add_to_projects call.
When I POST the following url from Java, I get this error: Illegal repetition near index 338. When I POST the identical url from Postman, it returns status 200 and a list of all Field projects.
What is going on here? I don't understand why it doesn't like this Json string when invoking it from Java. I'm using the Spring REST templates, which work beautifully when used to call a dozen other field and admin apis--passing json all over the place. Also, when I make the same call via Postman, it treats it like I'm calling GET /fieldapi/companies/v1. I've checked over and over again, and I'm definitely calling POST.
Also, I'd be curious to know what the bare minimum amount of data contained in the Json string is. I only need to pass the Company Name and have no idea what other fields are required or optional.
POST http://bim360field.autodesk.com/fieldapi/companies/v1?ticket=c7d2c403-326f-430b-be72-df03c3283b8c&co... MOUNTS LLC","ctype":"C - Constructions","category":"Contractor","description":"Engineer","duns_no":"Engineer","ein_no":"0","url":"www.microdesk.com","telephone":"212-354-5656","fax":"999-888-7766","address":{"address1":"PO BOX 5205","address2":" ","address3":" ","city":"NEW YORK","county":null,"state":"NY","country":"US","postal_code":"10008-5205"},"custom_fields": [{"name": "Trade","display_type": "text","value": "","default_value": null,"possible_values": []}]}