web
You’re offline. This is a read only version of the page.
close
Skip to main content

Announcements

News and Announcements icon
Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Power Automate / The API operation requ...
Power Automate
Unanswered

The API operation requires the property 'body' to be of type 'Object' but is of type 'String'.

(0) ShareShare
ReportReport
Posted on by Microsoft Employee

Hello all, 

 

I am developing my own connector with an action that should return html text by id using api method.

 

My connector action is described as following:

paths:

/getTemplate:
get:

produces: [application/json, text/html]
parameters:
- {name: id, in: query, description: Template ID, required: true, type: string}
responses:
default:
description: default
schema:
type: object
properties:
template: {type: string, description: template, title: '', format: html}

 

If I pass the template as 'text/html' my flow failed with error 'The API operation "getTemplate" requires the property 'body' to be of type 'Object' but is of type 'String'.'

If I pass the template as application/json, I convert the HTML to base64 string and put it to JSON object, but in this way I get the same base64 string (not HTML) in response. My JSON object looks like the following:
{ 'template': '<base64>' }

 

How I can pass and get HTML text in the connector action?

 

Thank you.

Regards.

Categories:
I have the same question (0)
  • JS-27041152-0 Profile Picture
    on at

    Your schema definition should match the response payload.

     

    If you API returns the HTML payload directly, you will describe it as:

     schema: { type: string}, or

     schema: { type: string, format: binary }   // if you think the payload are not text

     

    If your API returns the HTML payload wrapped in JSON, like below:

    {

       "template": "<html>....</html>"

    }

    Then your schema definition would be:

     schema: {

       type: object,

       properties: {

          template: { type: string }
       }

     }

     

    Finally, If your API returns the HTML payload wrapped in JSON and encoded, like below:

    {

       "template": "base64encoded HTML string"

    }

    Then your schema definition would be:

     schema: {

       type: object,

       properties: {

          template: { type: string, format: byte }
       }

     }

     

    Hope this clarifies.

     

    We also provide an experience to generate the schemas from sample payload.

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

Season of Sharing Community Challenge Winners!

Congratulations to our community stars!

Kudos to our 2025 Community Spotlight Honorees

Expanding mentorship, skilling, and AI innovation

Congratulations to the June Top 10 Community Leaders!

These are the community rock stars!

Leaderboard > Power Automate

#1
11manish Profile Picture

11manish 227

#2
David_MA Profile Picture

David_MA 204 Super User 2026 Season 1

#3
Valantis Profile Picture

Valantis 177

Last 30 days Overall leaderboard