Join 34,000+ subscribers and receive articles from our blog about software quality, testing, QA and security.
 

Add_attachment_to_result directions are not clear

#1

Hi,
I’m unable to add_attachment_to_result:

POST /index.php?/api/v2/add_attachment_to_result/26804 HTTP/1.1

Host: test.testrail.io
Authorization: Basic HERE_IS_MY_BASE_64_AUTH_INFO


Content-Type: multipart/form-data; boundary=----WebKitFormBoundary7MA4YWxkTrZu0gW
cache-control: no-cache
Postman-Token: dcc43c5d-d95f-494a-84d2-fcaab9047472
Content-Disposition: form-data; name=“Attachment”; filename=“loginWithValidEmailAndPassword.png

------WebKitFormBoundary7MA4YWxkTrZu0gW–

Here is the error I receive:
{
“error”: “Content-Type header invalid (use Content-Type: application/json)”
}

1 Like
#3

Hey @gavril,
I didn’t withdrawn it. Don’t need to be deleted.
I still have an issue, cannot add a screenshot.

#4

After much tinkering, finally was able to make this work.
Hopefully, guRock will update their documentation so it would be clearer

  1. Use attachment instead of Attachment
  2. Place it in the body as form-data NOT in the header

@yana

2 Likes
[API] Upload screenshot
#5

Thank you @meiacuna! Works for me.
Have you noticed that TestRails started to behave weird way once screenshots are uploaded?
I’m getting ’ Account is in maintenance mode’ warnings. And site is getting really slow.

#6

Hi Yana,

Thanks for the post, glad to hear the information from @meiacuna helped.

In regards to the Maintenance Mode message, this would indicate your account was in maintenance for a brief period of time. We create backups and perform any other maintenance on all of TestRail Cloud accounts each day, so this was the likely cause of the message you received. This status should go away in a matter of minutes. However, if it does last for longer than expected, please reach out to us at contact@gurock.com.

Regards,
Jon

#7

Thank you very much, this is really helpful!

#8

Guys, you really should update the docs in the website! I spend whole day on this issue, because the documentation is not accurate!

#9

Hi Sergey,

Just wanted to update and let you know we are well aware and already addressing the documentation. Apologies for any inconvenience.