Method Community

 

Files API Post

Last post 01-26-2024 3:23 PM by Method_Inderdeep. 1 replies.
Page 1 of 1 (2 items)
Sort Posts: Previous Next
  • 01-25-2024 12:27 PM

    Files API Post

    Would it be possible to get an example (preferably in JSON) of a successful POST to the Files API?  We are consistently getting a 415 Unsupported Media Type error when trying to POST a pdf file.  The documentation for this operation seems a little sparse compared to some other operations and those on tables.  https://developer.method.me/#tag/Files/operation/file-upload

    As a related question, is it possible to POST using a URL for a file rather than a locally stored document?  Use case - we are trying to pass files from one Method account to another.  

    Victoria Cameron
    vcameron@cloudconsutlancyllc.com
    www.cloudconsultancyllc.com
    650/209-0345

    What is Method?


  • 01-26-2024 3:23 PM In reply to

    Re: Files API Post

    Hi Victoria,

    This error typically occurs when the server does not support the media format of the data sent in the request. It could be related to how the PDF file is being encoded or the Content-Type header in your POST request.

    To troubleshoot this issue, I recommend checking the following:

    • Ensure the Content-Type header is set correctly in your request. For a PDF file, it usually should be application/pdf.

    Can you please confirm if that is correct? 

    For the second part, you can create a custom field and store the URL in that field. For example, you can have all your files stored on Google Drive and only the URLs related to those can be posted to that table's fieldThe character limit for the custom field should be set accordingly.


    Let me know if you have any questions.

Page 1 of 1 (2 items)