Skip to main content

Notifications

Power Automate - Using Connectors
Answered

Rest API connector working in Postman but not in Power Automate

(0) ShareShare
ReportReport
Posted on by 331

Hello all,

 

I've a connector which is working when I'm testing it in postman or other test tools but not with Power Automate.

 

I need to make a POST to the following address :

 

https://mese.webuntis.com/WebUntis/jsonrpc.do?school=gym_Biel-Bienne

Here, it works fine and I get a Session ID :

 

forstera_0-1687201946158.png

 

But when I do the same in Power Automate it doesnt work :

forstera_1-1687202085897.png

Result :

forstera_2-1687202144222.png

 

Could it be a certificate problem ?

Thanks to all for your help 🙂

 

 

  • forstera Profile Picture
    forstera 331 on at
    Re: Rest API connector working in Postman but not in Power Automate

    Thanks very much for the informations, I'll have a look a learn about it 🙂 

  • Verified answer
    lbendlin Profile Picture
    lbendlin 7,597 on at
    Re: Rest API connector working in Postman but not in Power Automate

    Look at the Raw tabs in Postman, see what's really happening.

  • forstera Profile Picture
    forstera 331 on at
    Re: Rest API connector working in Postman but not in Power Automate

    ah ok, thanks very much I understand the meaning yet.

     

    What is really strange to me is when sending informations via another tool (postman for example) it works. I just copied and pasted into the Power Automate html component. Do you think I should convert it before sending, too ? 

  • lbendlin Profile Picture
    lbendlin 7,597 on at
    Re: Rest API connector working in Postman but not in Power Automate

    When you use Base64decode on this

    eyJqc29ucnBjIjoiMi4wIiwiaWQiOiJlcnJvciIsImVycm9yIjp7Im1lc3NhZ2UiOiJpbnZhbGlkIHNjaG9vbG5hbWUiLCJjb2RlIjotODUwMH19

    you get

     

    {"jsonrpc":"2.0","id":"error","error":{"message":"invalid schoolname","code":-8500}}

     

    🙂

  • forstera Profile Picture
    forstera 331 on at
    Re: Rest API connector working in Postman but not in Power Automate

    so, do you mean that if I take the following answer 

     

    {
     "statusCode": 200,
     "headers": {
     "Connection": "keep-alive",
     "requestId": "39beb5ff218dd1ae054d4634595bd368",
     "Access-Control-Allow-Headers": "Accept, Origin, X-Requested-With, Content-Type, Last-Modified",
     "Access-Control-Allow-Origin": "*",
     "Date": "Tue, 20 Jun 2023 12:51:33 GMT",
     "Server": "nginx",
     "Content-Length": "84"
     },
     "body": {
     "$content-type": "application/octet-stream",
     "$content": "eyJqc29ucnBjIjoiMi4wIiwiaWQiOiJlcnJvciIsImVycm9yIjp7Im1lc3NhZ2UiOiJpbnZhbGlkIHNjaG9vbG5hbWUiLCJjb2RlIjotODUwMH19"
     }
    }

    and I convert it to base64  

    base64ToString(MyAnswer)

    I'll get something like this ? 

    forstera_0-1687266102031.png

     

  • lbendlin Profile Picture
    lbendlin 7,597 on at
    Re: Rest API connector working in Postman but not in Power Automate

    Great, you get stuff back.  Your content is Base64 encoded.  Decode it and then use that.

  • forstera Profile Picture
    forstera 331 on at
    Re: Rest API connector working in Postman but not in Power Automate

    Hello @lbendlin and sorry .. yes of course I forgott that, sorry.

    So, I work for a school and I need to authenticate to that application to retrieve timetables teachers and students.

     

    The authentication process should be like this :

    {"id":"ID","method":"authenticate","params":{"user":"ANDROID",
    "password":"PASSWORD", "client":"CLIENT"},"jsonrpc":"2.0"}
    The parameter CLIENT is a unique identifier for the client app. The parameter client will be
    mandatory in the future.
    result:
    {"jsonrpc":"2.0","id":"ID","result":
    {"sessionId":"644AFBF2C1B592B68C6B04938BD26965","personType"=2,"personId"=17}

    When I try to authenticate using, from example, postman or another tool I found in the web it wors with the following data :

    forstera_0-1687232397104.png

    When posting with them, I receive the following answer :

    forstera_1-1687232446998.png

    Then I can use the "SessionID" to make my request.

     

    But now, when I do the same using the html component of Power Automate, the answer is not the same and I dont receive any SessionID:

    Here's my html component to post :

    forstera_2-1687232595754.png

    and here's the answer : we can see that it's completely different that the one here above and the one expected  which should be :

    {"jsonrpc":"2.0",
    
    "id":"ID",
    
    "result":
    {"sessionId":"644AFBF2C1B592B68C6B04938BD26965",
    
    "personType"=2,
    
    "personId"=17}

     

    forstera_3-1687232642200.png

     

    So  I dont know howto define my html component to make it working ...

    Thanks to all for your help 🙂

  • lbendlin Profile Picture
    lbendlin 7,597 on at
    Re: Rest API connector working in Postman but not in Power Automate

    Likely you need to explicitly specify the expected content type.

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,445

#2
RandyHayes Profile Picture

RandyHayes 76,287

#3
Pstork1 Profile Picture

Pstork1 64,741

Leaderboard

Featured topics