DEMO

Good to know: All the methods shown below are synced to an example Swagger file URL and are kept up to date automatically with changes to the API.

User actions

Logs user into the system

GEThttps://petstore.swagger.io/v2/user/login
Query parameters
Response

successful operation

Headers
Body
string
Request
const response = await fetch('https://petstore.swagger.io/v2/user/login?username=text&password=text', {
    method: 'GET',
    headers: {},
});
const data = await response.json();
Response
text

Logs out current logged in user session

GEThttps://petstore.swagger.io/v2/user/logout
Response

successful operation

Request
const response = await fetch('https://petstore.swagger.io/v2/user/logout', {
    method: 'GET',
    headers: {},
});
const data = await response.json();

Creating users

Creates list of users with given input array

POSThttps://petstore.swagger.io/v2/user/createWithList
Body

List of user object

idinteger (int64)
usernamestring
firstNamestring
lastNamestring
emailstring
passwordstring
phonestring
userStatusinteger (int32)

User Status

Response

successful operation

Request
const response = await fetch('https://petstore.swagger.io/v2/user/createWithList', {
    method: 'POST',
    headers: {
      "Content-Type": "application/json"
    },
    body: JSON.stringify([
      {}
    ]),
});
const data = await response.json();

Creates list of users with given input array

POSThttps://petstore.swagger.io/v2/user/createWithArray
Body

List of user object

idinteger (int64)
usernamestring
firstNamestring
lastNamestring
emailstring
passwordstring
phonestring
userStatusinteger (int32)

User Status

Response

successful operation

Request
const response = await fetch('https://petstore.swagger.io/v2/user/createWithArray', {
    method: 'POST',
    headers: {
      "Content-Type": "application/json"
    },
    body: JSON.stringify([
      {}
    ]),
});
const data = await response.json();

Last updated