Skip to main content

I’m using Nintex for Sharepoint 2019 on prem and I’m trying to send a POST request to Graph API to send an email.

The flow is as follows:
A GET request to Graph with ClientID and SecretID to get a token back. This part is working fine.

Then you’re supposed to send the token as the Authentication header when sending the next GET/POST request depending on what you want to do. In my case, I’m sending a POST request to the /sendMail endpoint.

I know the token I’m getting is good because I can successfully make the POST request via Postman and I get a 202 response and the email sends out. But whenever I try to replicate the same exact request from the workflow, I get the following error:
 

code":"InvalidAuthenticationToken","message":"CompactToken parsing failed with error code: 80049244

This usually means the format of the token is wrong, or that the token is not the correct one for what the request is asking (but I already know this is not the case since it works via Postman).


The header is supposed to be: Authorization: Bearer {token}. (With a space between bearer and token). So in my workflow I’m setting up a Web Call with a header set up as: 

Name “Authorization” and the value being “Bearer {token}” No typos, as far as I can tell.

The token is around 1600 characters, so I’m starting to think I might be hitting a the max character count on the header length and it’s being truncated when sent out. Unfortunately I don’t have a way of checking what Nintex is actually sending out since I can’t sniff the request and I don’t have a custom endpoint I could use to read that.

 

Any thoughts? Has anyone ran into anything like this?

Thanks

 

Hi @nlab 

Seeing that you are able to retrieve the Token in Postman... 

I suggest you to display the resulting token (Log to History (max 256 chars) and/or use Email) 

Compare the result to your Postman result.
Is it exactly the same?
Is it the same length?
Are there ‘escape’ chars in the Nintex result?


The history log cannot display that many characters, so what I’ve done to confirm I’m getting a good token is email it to myself (using the Nintex email action)
The token stored in the variable is correct, I can use that in postman just fine.
The problem is when Nintex sends the HTTP request to Graph API using that (or any other) token.
Even if I generate the token outside of nintex and I copy it into the web request I’m getting the error in the post above. So the problem I’m having is at the Web request action.


Hi @nlab 

I suggest you to contact Nintex Support.

 

Show the Postman result or screenshots for the Graph API query.
Ask Nintex Support how the Web Request action should be configured. Sometime it is just a small configuration item (missing, incorrect, etc) that is causing your Web Request to fail.

 

I’ve gone thru something similar - using SQL Query. 


Hi @nlab,

were you able to solve the problem? I have exactly the same problem and am therefore very interested in your solution.


When concatenating the string “Bearer {token}” Nintex adds additional spaces. I used regex to remove these.


Reply