I'm trying to upload an attachment to the endpoint bill in Acumatica Rest API but gets the error
"Operation is not valid due to the current state of the object".
I’m using the RestService class from the Wiki page and the same PutFile function.
Rs.PutFile("Bill", "bf73fde2-2a71-eb11-80bc-00155d79641e", "test.pdf", sr.BaseStream)
The same call for stockItem works but not for bill? Using the id as key.
Someone who has an idea
Solved
Upload attachment to bill endpoint failes
Best answer by junmao01
You need use Bill Type and Reference number as key instead of id.
Use the PUT method: https://mycompany.acumatica.com/entity/Default/20.200.001/Bill/Bill/50-0008442/files/Invoice1.pdf
Please note, the first Bill is the endpoint name, the second Bill is the “Bills and Adjustments” Type and followed by the Reference Nbr.
Reply
Enter your E-mail address. We'll send you an e-mail with instructions to reset your password.