Skip to main content

Notifications

Power Automate - Using Connectors
Answered

Obtain JWT token with Power Automate HTTP

(0) ShareShare
ReportReport
Posted on by

Hi all,

 

I am trying to estaablish a flow that interfaces the Perdoo API (https://api-docs.perdoo.com/)

 

I can make the flow work from a browser, but I cannot figure out how to specify correctly the email and password required to obtain the token (https://api-eu.perdoo.com/api-token-auth)

 

Using the HTTP step

- Method: POST

- URI: https://api-eu.perdoo.com/api-token-auth

- Header: 

-- Content-Type: application/vnd.api+json

 

I've tried specifying credentials using basic authorisation, but below fault is returned independently of whether I do that or not.

 

Where I think it goes wrong is how to specify the body. 

 

The fault returned is:  

"{"errors":{"email":["This field is required."],"password":["This field is required."]}}"

 

Any help is appreciated 

Thanks

  • Re: Obtain JWT token with Power Automate HTTP

    That worked - Thanks all that contributed!

  • Verified answer
    Re: Obtain JWT token with Power Automate HTTP

    Based on examples in their docs, try one of these:

    1. Content-type: application/vnd.api+json

    Body:

    {
    "data": {
    "type": "obtainJwtToken",
    "id": null,
    "attributes": {
    "email": "xxxx@xxx",
    "password": "xxx"
    }
    }
    }

     

    2. Or set

    Content-Type: application/x-www-form-urlencoded

    Body: email=myuser%40test.com&password=xxx

  • Re: Obtain JWT token with Power Automate HTTP

    Thanks! That solved the immediate parsing error, but now I get this error:

     

    {"errors":[{"detail":"Received document does not contain primary data","status":"400","source":{"pointer":"/data"},"code":"parse_error"}]}

     

    Any ideas are most welcome!

  • abm abm Profile Picture
    abm abm 32,296 on at
    Re: Obtain JWT token with Power Automate HTTP

    Hi @Anonymous 

     

    Try with the double quotes around the email and password

     

    {

    "email":"xxxx",
    "password":"dddd"
    }

     

     

  • Re: Obtain JWT token with Power Automate HTTP

    Thanks, but then it immidiately returns "Enter valid JSON"

     

    Other ideas?

     

    Screenshot 2020-11-03 091026.jpg

  • abm abm Profile Picture
    abm abm 32,296 on at
    Re: Obtain JWT token with Power Automate HTTP

    Hi @Anonymous 

     

    Try this in your HTTP Body

     

    image.png

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Microsoft Kickstarter Events…

Register for Microsoft Kickstarter Events…

Announcing Our 2025 Season 1 Super Users!

A new season of Super Users has arrived, and we are so grateful for the daily…

Announcing Forum Attachment Improvements!

We're excited to announce that attachments for replies in forums and improved…

Leaderboard

#1
WarrenBelz Profile Picture

WarrenBelz 145,526

#2
RandyHayes Profile Picture

RandyHayes 76,287

#3
Pstork1 Profile Picture

Pstork1 64,907

Leaderboard

Featured topics