Does anyone have a working post example for Version 4_1 API?
I can get it to work if I submit by constructing a URL and submitting that way, but when I try to post the body, it just never gets recoginized as a valid submission?
(I know I should be using V8 API, but silly me thought the 4_1 would be simpler!)
I have it working in Postman by constructing the URL with all the data in the URL and I have it working by code by constructing the URL with all the data in the URL. I just can’t get it to work by submitting JSON in the body of the request.
Anyone have an example of a working submission? I’d really appreciate it. (At this point I’m thinking it’s not possible with v4)
PS - I’ve got the session ID part worked out. That part is working fine(by constructing the URL).
@abuzarfaris THANK YOU!!! I was working on this all day yesterday trying to do this. This worked perfectly. There are so little examples online of how to format this properly. I’ve been able to do in the past by including the request in the URL but not in the body. Thank you so much!
@abuzarfaris Do you know if there is a way to upload Notes with a file attachement via 4_1 API? I’ve tried a bunch of things, but can’t get the actual file to be uploaded to the /uploads/ folder?
@abuzarfaris I’m seeing a bunch of examples for the notes module using set_note_attachement. But I happen to have a custom module with a file field. I’m wondering if maybe this won’t work for a custom module and I have to make an endpoint to handle the file upload?
@abuzarfaris Thanks, can’t wait to try that I think I see now, I was doing that except the _file for the file contents. I wss just nsming the field file. I bet thst the trick!
Hey @abuzarfaris I tried that, because you are using “set_entries” in stead of “set_entry” it’s interpreting the array as two separate arrays and creating two record ids.
I still can’t get it to work. I can get everything else populated except the file upload. At this point I’m thinking it’s not possible. I’m going to have to try my luck with V8 API.
Here’s what I’m doing, if you can see anything wrong I’d appreciate it:
For v8 if I remember correctly you cannot upload files for other modules (I would want you to verify this)
I remember there being an upload file function and that function being explicitly called for only notes and documents module.
I’ll try with a file field and see if I can upload using v4_1
I think what Im going to have to do then is create a note thats related to my module, then upload the file to the note. I have been able to do that with set_note_attachment. It just makes it a 3 step process. I was hoping to just upload the file in one step.
I’ve got it working. After three days I’ve come to the conclusion you cannot upload a file to a file field via API (4_1 or 8) UNLESS its a default Notes or Documents module.
So what I did is my form fill creates a “feature request” (custom module) via API, then if there is a file attachement, a standard Note is created with parent type of feature reqest and parent ID of the feature request. Then the file is sent to the note by set_note_attachement method using the ID of the note created and it all works out.
For anyone else that comes accross this post and wants to create/attach notes. I’ve made a blog article and Youtube walkthrough video. It’s hot off the presses. I walkthrough complete Postman setup and how to get the session ID, how to create a lead, query a lead, update a lead, create a note and link it to the lead, and then upload a file to the note. Enjoy! Hopefully this saves someone else days of stuggle!