Hello, I’m trying to upload files using api (application/pdf), and I have several problems but focus on current. I’m making an api call using graphql api as it is said there, but my response.body is always ReadableStream and when I tried to read that stream a got the Uint8Array. Am I doing something wrong or it is what it sould be and I just can’t figure out how to get that url
Hi
Hi
yes, I’m using Javascript, but when I try to use my code locally, I get the ReadableStream, now I deployed the same code and I get the proper response. Only userMutationId is <nil>, should it be like that?
Hi
Ok now I think I’m almost there, but I have a little problem with attaching a file. I already created presigned url, then I uploaded the file, and I’m trying to create a card with my file, but I all the time get the same error:
{
data: { createCard: null },
errors: o
{
message: 'Invalid input: attach_your_resume (u"/orgs/9b72f885-4aa9-4d56-ba43-32748fa3e634/uploads/595dd766-c6b6-43a1-b7b2-bd4a4c124101/a.pdf"])',
locations: oArray],
path: aArray],
code: 30000,
type: 'PipefyRuntimeError'
}
]
}
and this is my graphql field attribute
{
field_id: "attach_your_resume",
field_value: "${`/orgs/9b72f885-4aa9-4d56-ba43-32748fa3e634/uploads/595dd766-c6b6-43a1-b7b2-bd4a4c124101/a.pdf`}"
}
I am not sure I understand what you mean by “graphql field attribute”. Is this the input to `
updateCardField
`?
I believe, given these informations, that you should have your `field_value` be an array, meaning your input to look like:
mutation {
updateCardField(input: {card_id: 123, field_id: "attach_your_resume", new_value: u"/orgs/9b72f885-4aa9-4d56-ba43-32748fa3e634/uploads/595dd766-c6b6-43a1-b7b2-bd4a4c124101/a.pdf"]}) {
clientMutationId
success
}
(note the square brackets as the main difference to yours). See also here:
I am not sure I understand what you mean by “graphql field attribute”. Is this the input to `
updateCardField
`?
I believe, given these informations, that you should have your `field_value` be an array, meaning your input to look like:
mutation {
updateCardField(input: {card_id: 123, field_id: "attach_your_resume", new_value: u"/orgs/9b72f885-4aa9-4d56-ba43-32748fa3e634/uploads/595dd766-c6b6-43a1-b7b2-bd4a4c124101/a.pdf"]}) {
clientMutationId
success
}
(note the square brackets as the main difference to yours). See also here:
no, it’s createCard, but I tried using an array and still doesn’t work
res = await fetch('https://api.pipefy.com/graphql', {
...auth,
body: JSON.stringify({
query: `
mutation {
createCard(input:{
pipe_id: "*pipe_id*",
phase_id: "*phase_id*",
title: "${name}",
fields_attributes: [{
field_id: "your_name",
field_value: "${name}",
},{
field_id: "email",
field_value: "${email}",
},{
field_id: "phone",
field_value: "${phone}",
},{
field_id: "attach_your_resume",
field_value: "${cvUrl}"
},{
field_id: "why_are_you_applying_for_this_job",
field_value: "${message}",
},{
field_id: "available_to_work_from",
field_value: "${availableFrom}",
},
{
field_id: "tech_stack",
field_value: "${techStack}",
},{
field_id: "position",
field_value: "${links}",
}
]
}) {
card {
id
}
}
}
`,
}),
})
Hmm. I see. Then I am sorry, I do not see any immediate mistake anymore. The possibilities I see, just to try and triage the issue, would be
- to not set the attachement on upload, but set it afterwards using the updateCardField.
- to set the attachment only or too on the input’s `attachments` property.
- Ping
@Marcos Carvalho to ask him for help.
Hmm. I see. Then I am sorry, I do not see any immediate mistake anymore. The possibilities I see, just to try and triage the issue, would be
- to not set the attachement on upload, but set it afterwards using the updateCardField.
- to set the attachment only or too on the input’s `attachments` property.
- Ping
@Marcos Carvalho to ask him for help.
- returns the same error
- how to achieve that? I tried but it returned me an error
- Ping
@Marcos Carvalho
2: errors:
{
message: 'Invalid input: attachment (m"/orgs/9b72f885-4aa9-4d56-ba43-32748fa3e634/uploads/236d13f4-ed98-4bc1-acd9-cdcb9e278ad0/pudzian%20%20%20%20%20%20.pdf"])',
locations: cArray],
path: Array],
code: 30000,
type: 'PipefyRuntimeError'
}
]
One more thing I just noticed: did you always use “/orgs/...”, or did you also try without the first slash? I believe the correct way is without, i.e.
o"orgs/9b72f885-4aa9-4d56-ba43-32748fa3e634/uploads/236d13f4-ed98-4bc1-acd9-cdcb9e278ad0/pudzian%20%20%20%20%20%20.pdf"]
or
o"uploads/236d13f4-ed98-4bc1-acd9-cdcb9e278ad0/pudzian%20%20%20%20%20%20.pdf"]
One more thing I just noticed: did you always use “/orgs/...”, or did you also try without the first slash? I believe the correct way is without, i.e.
o"orgs/9b72f885-4aa9-4d56-ba43-32748fa3e634/uploads/236d13f4-ed98-4bc1-acd9-cdcb9e278ad0/pudzian%20%20%20%20%20%20.pdf"]
or
o"uploads/236d13f4-ed98-4bc1-acd9-cdcb9e278ad0/pudzian%20%20%20%20%20%20.pdf"]
starting with /orgs, orgs, /uploads or uploads, everything doesn’t work
Reply
Join us in the Pipefy Community! 🚀
No account yet? Create an account
Login with your Pipefy credentials
Enter your E-mail address. We'll send you an e-mail with instructions to reset your password.