How to create an attachment with api?

Hi Guys,

I have been working in API integration in our current automation suite to upload the results in cucumber studio. As part of this for failed scenarios tried to push the screenshot via API.

I read the API reference documentation and come up with below API request,

POST https://studio.cucumber.io/api/projects/<project_id>/test_runs/<test_run_id>/test_snapshots/<test_snapshot_id>/test_results/<test_result_id>/attachments HTTP/1.1

Accept: application/vnd.api+json; version=1
access-token: <your access token>
client: <your client id>
uid: <your uid>
Content-Disposition: form-data; name="file"; filename="my-attachment.jpg"

{
"file" : "D:/screenshots"
}

but its not working. Please let me know what's wrong in this

Hi!

Can you share your script with us so we can debug it together.
You can either share it without your API credentials here or reach the support team via in-app chat.

My best guess at this point is that your request body does not contain the file data.
Maybe we need to improve the error message if that the case to be more explicit (those endpoints are pretty new, they can surely be improved).

Thanks.