cancel
Showing results for 
Search instead for 
Did you mean: 

RestAPI: why am I unable to import an API definition?

Jen_ReadyAPI
Occasional Contributor

RestAPI: why am I unable to import an API definition?

Hi,

Why am I unable to import an API definition?

I believe I have a REST API - https://reqres.in/api/users?page=2

(Maybe it's not a REST API or just something else - pls let me know).

 

So when I try inputing:

https://reqres.in/api/users?page=2

https://reqres.in

https://reqres.in/

https://reqres.in/api/users

https://reqres.in/api/users?

 

They all fail.

Jen_ReadyAPI_0-1624420061526.png

 

Jennifer

6 REPLIES 6
nmrao
Community Hero

Re: RestAPI: why am I unable to import an API definition?

One would require a swagger definition in order to import into the tool.
Here is sample public swagger defition which you can try import. You would need a similar one.
https://petstore.swagger.io/v2/swagger.json



Regards,
Rao.
Jen_ReadyAPI
Occasional Contributor

Re: RestAPI: why am I unable to import an API definition?

Rao,
How do I know what language this API is in? How can I tell it’s something else and not Swagger?
Jennifer
nmrao
Community Hero

Re: RestAPI: why am I unable to import an API definition?

- that will not get imported in the ReadyAPI or SaopUI tools
- once can also try to import / load either the url or file of the swagger definition in Swagger editor
https://editor.swagger.io/


Regards,
Rao.
Jen_ReadyAPI
Occasional Contributor

Re: RestAPI: why am I unable to import an API definition?

I understand that won’t import but I don’t understand why not?
Rao says it needs to be swagger (or other), so my question is how do I tell that my api is or isn’t a swagger?
Again - I am new to REST, API, HMTL and ReadyAPI - so pls understand if my questions sound silly.
Jennifer
nmrao
Community Hero

Re: RestAPI: why am I unable to import an API definition?

Swagger definition has to follow the specification.
If you open(download json) the above sample swagger definition provided in previous reply and open in in a text editor or open in swagger editor, you can easily identify.

The links you opened are sample payload for a REST call, I believe.


Regards,
Rao.
VeenaDevi
Contributor

Re: RestAPI: why am I unable to import an API definition?

The URL you have mentioned are REST API , not an definition file , So you can use Endpoint Explorer to validate  Rest API and then create Project/Test

New Here?
Join us and watch the welcome video:
Announcements
Top Kudoed Authors