api rest don't work anymore
# 🤝help
m
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
Are you able to call the API from another source, like Postman?
m
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
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
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
m
no i'm not
a
You'll need to join the beta to get access to triggers
m
okk, are you sure that there were no changes done about the rest api part please !
thank you
@witty-football-93730
a
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
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
can you share the axios code (stripped-down, just want to try it for myself)?
m
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
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
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
@modern-finland-97226 Do you mind sharing your botId 🙏 . You can easily find it in the studio url
m
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.