39
Views
7
Comments
Solved
Problem consuming a specific microsoft graph endpoint, Rest API
Application Type
Service

Hello guys, I'm having some problem what I can't understand correctly. 
I have one endpoint from Microsoft API (documentation link below) what return a list of events from my calendar, and I can apply some filters in the query just like that :

The endpoint is like that
https://graph.microsoft.com/v1.0/me/calendar/events?$filter=startsWith(subject,'Test')

and it works (with the correct header and authentication)

my problem start with when I try use a variable in the query like that

https://graph.microsoft.com/v1.0/me/calendar/events?$filter=startsWith(subject,'{SearchKeyWord}')

in test it works, but when I use in the flow this return a error 400, I can't understand why.

in test



In a real use

Microsoft API Documentation: 
https://learn.microsoft.com/en-us/graph/api/user-list-events?view=graph-rest-1.0&tabs=http

2024-01-20 21-04-26
Bruno Silva
Solution

Hey Ahmed Essawy, I will close the topic, I can't find the problem, but I maked some alterations and resolve the problem....
Appreciate the attention and help ! 

For some reason this work like that




2024-01-20 14-53-12
Ahmed Essawy

The issue you're experiencing is strange, error 400 means bad request so you may did not send the request as expected please debug you request in the Outsystems service studio, you may be have additional space on the Bearer token also take the values from the debug and re-test the exact values on API tool like postman to investigate your issue more deep.    

also expand the response may add more information  


2024-01-20 21-04-26
Bruno Silva

Thanks for the answer... 

There is nothing in the response, it is just empty, on the other hand, when I copy the authentication parameter to a API tool, it works too, I look with careful and don't have a additional space on the Bearer token.


2024-01-20 14-53-12
Ahmed Essawy


Please check the screenshots below, I gave it a wrong bearer, and the API replied with 401 error (Unauthorized) which is fine and indicates that I am calling it as expected, as you are face 400 error that means bad request, so please double check the URL, quotes, and everything also try to update your service studio to the latest version.  


Could you share the application file *.OML without your credentials to troubleshoot with you?    

2024-01-20 21-04-26
Bruno Silva

I don´t think this is the way, when I request without a input parameter, this work, and retrieve the events I need, but when use a variable it don't works... the url structure its working and the bearer auth too


Below is a example where I test without the input parameter "SearchKeyWord"

2024-01-20 21-04-26
Bruno Silva

You need use a valid token to test, if  use a invalid token it return 401, but with a valid token return 400

2024-01-20 21-04-26
Bruno Silva
Solution

Hey Ahmed Essawy, I will close the topic, I can't find the problem, but I maked some alterations and resolve the problem....
Appreciate the attention and help ! 

For some reason this work like that




2024-01-20 14-53-12
Ahmed Essawy
Community GuidelinesBe kind and respectful, give credit to the original source of content, and search for duplicates before posting.