cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Highlighted
Community Champion
Community Champion

How do I make a Swagger JSON file?

I signed up to try the Google Cloud Platform and managed to get a key to the Google Books API. My next step is to get PowerApps to interact with the API. How do I turn the Books API into a JSON file for PowerApps? Or can I get PA to make calls to the API in another way?

 

https://developers.google.com/books/docs/v1/using

 

Any help is appreciated.

Microsoft Employee
@8bitclassroom
2 ACCEPTED SOLUTIONS

Accepted Solutions
Highlighted
Resolver I
Resolver I

Re: How do I make a Swagger JSON file?

Once you have used the Swagger Editor to get a Swagger file with no errors, a path that exactly matches the path requirements of the API, and a response showing the data you want to retrieve (or post, etc), you can convert the file to JSON with online YAML-to-JSON converters like this one or this one. You can then cut and paste the resulting JSON into Visual Studio to further validate the syntax of the JSON file. (In VS, first create an empty JSON by clicking File, New, File, Web, C#, JSON file, then cut and paste the JSON from the converter). There are online validators you can use as well, such as this one or this one. I've found it very convenient to use Visual Studio to make any additional changes you need. One you've validated the JSON and have it in Visual Studio (or maybe an online validator), save it as a .json file and use this to create the PA connection.

 

You might find it useful to learn from my mistakes in the following posts: one, two and this one. The last one links to Swagger references in the last reply that might be of help.

 

It seems to me, as a beginner, there is quite a bit to learn about Swagger and creating an API connection. The PA Team has been very helpful in my learning process but it has taken me a longer time than I first thought it would.

 

Good luck!

View solution in original post

Highlighted
Resolver I
Resolver I

Re: How do I make a Swagger JSON file?

I thought I should mention one other thing. You are trying to use an API that requires OAuth 2.0. From what I have read, PowerApps does not YET support this type of authorization. 

View solution in original post

7 REPLIES 7
Highlighted
Resolver I
Resolver I

Re: How do I make a Swagger JSON file?

Once you have used the Swagger Editor to get a Swagger file with no errors, a path that exactly matches the path requirements of the API, and a response showing the data you want to retrieve (or post, etc), you can convert the file to JSON with online YAML-to-JSON converters like this one or this one. You can then cut and paste the resulting JSON into Visual Studio to further validate the syntax of the JSON file. (In VS, first create an empty JSON by clicking File, New, File, Web, C#, JSON file, then cut and paste the JSON from the converter). There are online validators you can use as well, such as this one or this one. I've found it very convenient to use Visual Studio to make any additional changes you need. One you've validated the JSON and have it in Visual Studio (or maybe an online validator), save it as a .json file and use this to create the PA connection.

 

You might find it useful to learn from my mistakes in the following posts: one, two and this one. The last one links to Swagger references in the last reply that might be of help.

 

It seems to me, as a beginner, there is quite a bit to learn about Swagger and creating an API connection. The PA Team has been very helpful in my learning process but it has taken me a longer time than I first thought it would.

 

Good luck!

View solution in original post

Highlighted
Resolver I
Resolver I

Re: How do I make a Swagger JSON file?

I thought I should mention one other thing. You are trying to use an API that requires OAuth 2.0. From what I have read, PowerApps does not YET support this type of authorization. 

View solution in original post

Highlighted
Resolver I
Resolver I

Re: How do I make a Swagger JSON file?

I thought I should mention one other thing. You are trying to use an API that requires OAuth 2.0. From what I have read, PowerApps does not YET support this type of authorization. 

Highlighted
Resolver I
Resolver I

Re: How do I make a Swagger JSON file?

Replied too soon -- noticed you can also use an API key, so that will likely work.

Highlighted
Community Champion
Community Champion

Re: How do I make a Swagger JSON file?

@ExCessna, it looks like we're building similar apps--your posts show that you're building an ISBN lookup. What is your lookup source?

Microsoft Employee
@8bitclassroom
Highlighted
Resolver I
Resolver I

Re: How do I make a Swagger JSON file?

Mr. Dang,

Yes, we're both doing ISBN lookups. I've tried three different sources: ISBNdb.com, openlibrary.org, and xisbn.worldcat.org. All provide good information and are free. I may try Google Books as well. While connections have been established, I still don't have any of them returning to PowerApps the response I see in the Swagger Editor. But I do see evidence that the connection is made, as I can create DataSource statements that include the fields returned. An "Internal Server Error" has been the problem with two of them. The PA Team has been very responsive to the issue and has been very helpful, so hopefully it will be resolved soon. 

 

Highlighted
Resolver I
Resolver I

Re: How do I make a Swagger JSON file?

Oh, forgot to mention, if you use Visual Studio to validate your Swagger JSON, set the Schema to http://json.schemastore.org/swagger-2.0.

Helpful resources

Announcements
Community Conference

Power Platform Community Conference

Find your favorite faces from the community presenting at the Power Platform Community Conference!

Watch Now

Experience what’s next for Power Apps

See the latest Power Apps innovations, updates, and demos from the Microsoft Business Applications Launch Event.

Power Platform ISV Studio

Power Platform ISV Studio

ISV Studio is designed to become the go-to Power Platform destination for ISV’s to monitor & manage published applications.

secondImage

Power Platform 2020 release wave 2 plan

Features releasing from October 2020 through March 2021

Top Solution Authors
Top Kudoed Authors
Users online (8,861)