Dear all,
I have the following code method which is calling an Ms Graph API :
<span>public</span> <span>String</span> <span>getGuestUserId</span>(<span>String AuthToken,String userEmail</span>){
<span>String</span> _userId
def http = <span>new</span> <span>HTTPBuilder</span>(<span>"https://graph.microsoft.com/v1.0/users/?"</span>)
http.<span>request</span>(<span>GET</span>) {
requestContentType = <span>ContentType</span>.<span>JSON</span>
<span>//uri.query = [ $filter:"mail eq '$userEmail'"].toString()</span>
uri.<span>query</span>=[<span>$filter</span>:<span>"mail eq '$userEmail'"</span>]
headers.<span>'Authorization'</span> = <span>"Bearer "</span> + <span>AuthToken</span>
response.<span>success</span> = { resp, json ->
<span>if</span> (**json.<span>value</span>**){
_userId=**json.<span>value</span>**[<span>0</span>].<span>id</span>
}
<span>else</span>
_userId=-<span>1</span> <span>// user does not exist</span>
}
<span>// user ID not found : error 404</span>
response.<span>'404'</span> = { resp ->
_userId = <span>'Not Found'</span>
}
}
_userId
} When this method is called, I need to log the full URL which is executed in order to verify it
I have try http.GetUri() but it return only the uri part and I need to get as well the querry filter
My expected result should be something like below :
https://graph.microsoft.com/v1.0/users?$filter=mail eq 'user@xx.onmicrosoft.com'
How to get that full url in my code to verify that syntax is as expected ?
Regards