News & Announcements User Community Developer Community

Welcome to the RingCentral Community

Please note the community is currently under maintenance and is read-only.

Search
Make sure to review our Terms of Use and Community Guidelines.
  Please note the community is currently under maintenance and is read-only.
Home » Developers
Parameter "attachments" is invalid
Tags: error
Feb 21, 2019 at 5:15pm   •   5 replies  •  0 likes
neil-joyer

We've been using the RC api to post conversations to glip. Some of the posts included images. To implement images, we used the "Attachments" feature outlined here:

https://devcommunity.ringcentral.com/ringcentraldev/topics/new-glip-features-post-attachments-and-th...

It worked great and showed the images inline in chat.

However, a few weeks ago (not exactly sure when), all posts that contain attachments quit working.

I finally got around to debugging and can see that it is because RC/Glip is returning a 400 Bad Request error with the message: "Parameter "attachments" is invalid".


I tried getting a post to go through using the api explorer using attachments and I can't get that to work either.


Did something break with attachments? I'm pretty sure the format of our payloads to the api didn't change.

5 Answers
answered on Feb 26, 2019 at 11:08pm  
Yes, we accidentally changed the text attribute to be a mandatory one. We'll update the API Reference and the changelog. Thanks for your feedback!

 0
answered on Feb 25, 2019 at 7:29am  
A couple of comments.
I should have included my exact payload rather than the one I generated using the api explorer. This is my actual payload that was getting denied:
{
    "groupId": "191750150",
    "attachments": [
        {
            "type": "Card",
            "title": "[https://i.imgur.com/gQ3EeN3.gif](https://i.imgur.com/gQ3EeN3.gif)";,
            "imageUri": "https://i.imgur.com/gQ3EeN3.gif";
        }
    ]
}

This is what I found ended up working:
{
    "groupId": "191750150",
    "attachments": [
        {
            "type": "Card",
            "text": "[https://i.imgur.com/gQ3EeN3.gif](https://i.imgur.com/gQ3EeN3.gif)";,
            "imageUri": "https://i.imgur.com/gQ3EeN3.gif";
        }
    ]
}

Basically, the title was causing it to fail. Switching that to "text" made it work. However, that used to work. Also, having both "title" and "text" works fine too.

I'll also add that the api reference generates the value "black" for color... which is why it was included in my sample. It would be good if that was updated to be hex because right now you can't get posts to generate since that is a drop down with only invalid values.

I'm unblocked. Thank you.

 0
answered on Feb 24, 2019 at 11:55pm  
Hi Neil, the problem is with the color attribute, it should contain Hex color code, like
"color": "#00ff2a"  
The value "Black" was just ignored and now some validation added on the API level. Since Glip API is in Beta now, we may change its behavior from time to time, but we'll improve the process adding all the potential compatibility breakers to the common changelog and adding more self-descriptive error messages. Sorry for inconveniences.

 0
answered on Feb 22, 2019 at 5:46am  
Since I was having trouble with the payload generated by my app (even though it didn't change), I tried reproducing via the api explorer and was able to. Here is a simplified version:{ "groupId": "191750150", "attachments": [ { "type": "Card", "title": "test", "color": "Black", "allDay": false } ] }
A representation that is closer to what I'm trying to do: { "groupId": "191750150", "attachments": [ { "type": "Card", "title": "test", "color": "Black", "text": "[https://i.imgur.com/gQ3EeN3.gif](https://i.imgur.com/gQ3EeN3.gif)", "imageUri": "https://i.imgur.com/gQ3EeN3.gif", "allDay": false } ] }

 0
answered on Feb 22, 2019 at 12:50am  
Hi Neil, could you please share the full body of your API request?

 0



A new Community is coming to RingCentral!

Posts are currently read-only as we transition into our new platform.

We thank you for your patience
during this downtime.

Try Workflow Builder

Did you know you can easily automate tasks like responding to SMS, team messages, and more? Plus it's included with RingCentral Video and RingEX plans!

Try RingCentral Workflow Builder

PRODUCTS
RingEX
Message
Video
Phone
OPEN ECOSYSTEM
Developer Platform
APIs
Integrated Apps
App Gallery
Developer support
Games and rewards

RESOURCES
Resource center
Blog
Product Releases
Accessibility
QUICK LINKS
App Download
RingCentral App login
Admin Portal Login
Contact Sales
© 1999-2024 RingCentral, Inc. All rights reserved. Legal Privacy Notice Site Map Contact Us