New GraphQL update: Retrieve Card attachments

  • 6 April 2021
  • 6 replies
  • 402 views
New GraphQL update: Retrieve Card attachments
Userlevel 7
Badge +8

We added support to retrieve card attachments -- we will return both attachments attached through the card and by the fields of type attachment. We added a new type called Attachment and we also added the attachments attribute inside the Card type.

Sample query:

 

Changelog

  • added: Attachment type
  • added: attachments  attribute inside the Card type

6 replies

Userlevel 1
Badge

How to retrieve the attachment authenticated URL, not with expire date, but like the link sent by e-mail, with signed URL?

Userlevel 7
Badge +5

Hello @tech-team how are you? 

Do you mean, get the original URL of the attachment, which does not expire and by API? If so, by API it is not possible, it will always generate an alternative link that expires (15 minutes by API and 30 days by email template). To get the original link of the attachment on the card, you need to access the card and copy it from there. 

Userlevel 5
Badge

When I use the url and path to try and access the attachment through my browser I get a 401 Unauthorized message. How do I fix that?

Userlevel 7
Badge +12

@jorden-monroe I think it should be sufficient to add the Authorization header you also use for the GraphQL query.

Userlevel 5
Badge

@genietim This might be a dumb question but how do I add the authentication header? When I typed app.pipefy.com/graphiql it automatically let my run queries without any authentication, I just assumed because I was logged into pipefy. How would you add the header in the browser search bar? what would that look like?

Userlevel 7
Badge +12

Ah, I see @jorden-monroe , yes, app.pipefy.com/graphiql automatically adds the header for you because you are logged in.

That website is a playground to explore the API without too much hassle around.

While there are ways to add the header in the browser (the necessary header is documented here: https://developers.pipefy.com/reference/authentication), I’m not sure if it’s not worth it – either you use the browser → can interact → can use the Pipefy Website (where you can easily access the attachments of all cards), or, you cannot interact → use the GraphQL API in a non-playground way (i.e., in your code or using Zapier, Make) where you can set the authorization header much easier.

Reply