Skip to content

Correct format for "file" in API upload request #27

@PepSoft01

Description

@PepSoft01

Hi,

I'm trying to upload a PDF file to the API.

What is the correct format for the file field?

I tried using:
--form "file=@C:/TestA/Fact2.pdf"
but it doesn't work for me.

Here is the full request I'm making:

bash
Copia
Modifica
curl -X POST
--header "Authorization: Bearer ak-A-w--XXXXxxxxxXXXXXxxxxxxXXXXXxxxxxXXXXXXX"
--header "UploadType: single_doc"
--form "package_type=elite"
--form "file=@C:/TestA/Fact2.pdf"
And this is the response I get:

json
Copia
Modifica
{
"code": 2,
"data": [
{
"type": "missing",
"loc": ["body", "file"],
"msg": "Field required",
"input": null
}
],
"detail": [
{
"type": "missing",
"loc": ["body", "file"],
"msg": "Field required",
"input": null
}
]
}
Any ideas on what I might be doing wrong?

Thanks a lot!

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions