Method Community

 

rest.method.me/api/v1/files invalid table

Last post 02-05-2024 12:12 PM by nsweeney. 2 replies.
Page 1 of 1 (3 items)
Sort Posts: Previous Next
  • 02-02-2024 10:59 AM

    rest.method.me/api/v1/files invalid table

    I am trying to attach a file to a work order record in MCNationalAccountWorkOrders table. using this API  I include the table name, record id, add to email, and base64 encoded pdf.  See below.  I am getting an error thatt the table name is not valid.  The error message in the response is "errors:[Failed to read the request form. Invalid header line: MCNationalAccountWorkOrders".

    I am able to create a work order using developer.method.me/api/v1/tables/MCNationalAccountWorkOrders, so I assume the table is valid.

    Content-Type: multipart/form-data; boundary=--18d6a4ec36e


    --18d6a4ec36e
    Content-Disposition: form-data; name="table"
    MCNationalAccountWorkOrders
    --18d6a4ec36e
    Content-Disposition: form-data; name="recordId"
    1758
    --18d6a4ec36e
    Content-Disposition: form-data; name="attachToEmail"
    true
    --18d6a4ec36e
    Content-Disposition: form-data; name=""; filename="Work Order TEST150022.pdf"
    Content-Type: application/pdf
    <Base64 encoded PDF data>
    --18d6a4ec36e--

  • 02-05-2024 11:58 AM In reply to

    Re: rest.method.me/api/v1/files invalid table

    Hi nsweeney,

    Thanks for reaching out to the Method Forum Community.


    Have you tried exploring our documentation on how to upload a file and attach it to a record in Method? If not then it will be a great start to follow the steps and see if that fix your issues.

    https://developer.method.me/#tag/Files/operation/file-upload

  • 02-05-2024 12:12 PM In reply to

    Re: rest.method.me/api/v1/files invalid table

    Thank you for the quick response to my quesition I was just getting ready to update this question.

    I did read the documentation, and thought I had followed it, but I was mising a carriage return after the Content-Disposition line.  Once I corrected that, I was able to upload the file.

    Thank you for your reply,

    Ned

Page 1 of 1 (3 items)