https://discord.gg/botpress logo
#🤝help
api rest don't work anymore
# 🤝help
m

modern-finland-97226

07/24/2023, 8:53 AM
what is wrong with all the rest api requests ? they were working 5 days ago , and now when i checked my bot , not a single one is working, always getting an error !

https://cdn.discordapp.com/attachments/1132958637086748722/1132958637237735424/Sans_titre.png

@acceptable-kangaroo-64719 could you please check with the team if this issue is going to be resolved in short time ? as i said i'm sure that it's not me who triggered the issue , i think it's a technical problem :/ all the api requests are not working neither in the emulator nor in my web application
@bumpy-butcher-41910 @acceptable-gold-88171
a

acceptable-kangaroo-64719

07/24/2023, 10:31 AM
Are you able to call the API from another source, like Postman?
m

modern-finland-97226

07/24/2023, 10:33 AM
yess , i made sure to test it with postman before creating this help request , and it's working fine :/
i saw someone in the geneal discussion who has the same issue as me
a

acceptable-kangaroo-64719

07/24/2023, 10:36 AM
hmmmmm it could be something with Jira and security. A lot of these enterprise apps will prohibit calls from frontend applications because it exposes the API key. However Botpress runs client code through a proxy to (supposedly) make it look like it is coming from a backend application instead.
@witty-football-93730 have we done anything to the proxy in the last week or so?
m

modern-finland-97226

07/24/2023, 11:18 AM
omg if it so then all the work that i have done is going in vain 😦 .
@acceptable-kangaroo-64719 i want to use trigger card but i could not find it anywhere
a

acceptable-kangaroo-64719

07/24/2023, 12:08 PM
m

modern-finland-97226

07/24/2023, 12:34 PM
no i'm not
a

acceptable-kangaroo-64719

07/24/2023, 12:39 PM
You'll need to join the beta to get access to triggers
m

modern-finland-97226

07/24/2023, 1:10 PM
okk, are you sure that there were no changes done about the rest api part please !
thank you
@witty-football-93730
a

acceptable-gold-88171

07/24/2023, 2:13 PM
If it's a front-end issue, it will work when you deploy it, as all functions run in the back-end when published. Since @modern-finland-97226 mentioned it isn't working in the web app, it's a different problem. I would axios.get().catch((error)=>{console.log({error})}) and try and see if the server returns more information
m

modern-finland-97226

07/24/2023, 2:27 PM
i'm sorry but i'm unable to find the console.log message in botpress studio , it's not appearing neither in event debugger nor in journalism.
@acceptable-gold-88171
a

acceptable-gold-88171

07/24/2023, 2:34 PM
can you share the axios code (stripped-down, just want to try it for myself)?
m

modern-finland-97226

07/24/2023, 2:35 PM
try { const url = 'https://jira.$######o/rest/api/2/search' const auth = { username: "#######", password: "#######!" } const response = await axios.get(url, { auth }) const issueKeys = _.get(response, 'data.issues', []).map(issue => issue.key) workflow.issueKeys = issueKeys } catch (error) { console.error('Error retrievfing issue keys:', error) }
this is the code but you cannot test it since it contains my jira account credentials :/
i'm sure that it was working perfectly last week, it's true that it don't always work in the emulator but in my web application it works for sure!. this time it's always showing errors everywhere
well i just added : const headers = { Accept: 'application/json' } ,

https://cdn.discordapp.com/attachments/1132958637086748722/1133050775367590038/Sans_titreeee.png

a

acceptable-gold-88171

07/24/2023, 3:13 PM
I can call Jira with axios without a problem, guessing it's due to the endpoint
I would try it in Postman like @acceptable-kangaroo-64719 mentioned, then use the export to axios function on the right to make sure it's identical. There might be a typo somewhere that we aren't seeing.

https://cdn.discordapp.com/attachments/1132958637086748722/1133054814088081508/image.png

m

modern-finland-97226

07/24/2023, 3:29 PM
i'm using the endpoints correctly believe me, here is the links to endpoints : https://developer.atlassian.com/cloud/jira/platform/rest/v2/api-group-issues/#api-group-issues. my bot is based on jira rest apis , not a single one is working anymore. that is so strange
w

witty-football-93730

07/25/2023, 5:48 PM
@modern-finland-97226 Do you mind sharing your botId 🙏 . You can easily find it in the studio url
m

modern-finland-97226

07/26/2023, 9:43 AM
hello eveyone @witty-football-93730 , @acceptable-gold-88171 , @acceptable-kangaroo-64719 ! i'm sorry for the inconvenience but it turned out to be an update regarding VPN in the startup i'm currently working in.