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 / GPT-4 API gives bad JS...
Power Automate
Unanswered

GPT-4 API gives bad JSON error in Power Automate Desktop but is ok in OPenAI Playground

(0) ShareShare
ReportReport
Posted on by 431

In Power Automate Desktop, I am looping through similar PDF files and using the GPT-4 API To extract text from them. Some files return status code 200, and some return 400 -bad JSON. I copied the text out of a ‘bad’ file that gets submitted to the API into the Openapi playground and it got processed with no error, Does anyone know how to troubleshoot? Why would the Openapi playground process ok but not the when invoking the webservice from Power Automate Desktop.? TIA

  • Steve48 Profile Picture
    431 on at

    Using Postman I was able to determine (by successive truncation that there was a backslash "\" that made the json invalid. Removing that solved the problem. I don't know why playground worked. maybe they clean the input?

  • Agnius Bartninkas Profile Picture
    Most Valuable Professional on at

    They probably have some escaping applied in the background. You can do that in PAD, by using Replace text to make your flow work properly. You might also want to escape/replace double quotes, too.

    -------------------------------------------------------------------------
    If I have answered your question, please mark it as the preferred solution. If you like my response, please give it a Thumbs Up.

    I also provide paid consultancy and development services using Power Automate. If you're interested, DM me and we can discuss it.

  • Steve48 Profile Picture
    431 on at

    Hi @Agnius. I will replace the ”\”s. Double quotes don’t seem to cause a problem. I’m glad I tried using Postman. I didn’t realize that they underline bad JSON with a “squiggly” line. That made it easy to isolate the problem. All along I suspected the issue had to do with images, but that wasn’t the case.

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

Leaderboard > Power Automate

#1
Mohsin Ali Profile Picture

Mohsin Ali 414

#2
11manish Profile Picture

11manish 331 Super User 2026 Season 2

#3
M Bilal Khan Profile Picture

M Bilal Khan 274

Last 30 days Overall leaderboard