Skip to content

Instantly share code, notes, and snippets.

@mbuhot
Last active June 7, 2016 00:32
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save mbuhot/ae1c182c4de4897e910bd6b1e942e626 to your computer and use it in GitHub Desktop.
Save mbuhot/ae1c182c4de4897e910bd6b1e942e626 to your computer and use it in GitHub Desktop.
Bureaucrat output with Swagger info
title search
Simple API
true

Simple API

A Simple API.

Authentication

basic

Standard HTTP basic authentication applies to all API operations.

Models

User

A user of the application.

{
  "type": "user",
  "id": "99775670",
  "attributes": {
    "user_updated_at": "2016-05-28T23:11:45Z",
    "user_created_at": "2016-05-29T23:54:25Z",
    "street_address": "I am a street address",
    "postal_code": "12345",
    "phone": "1800-IAMATEST",
    "full_name": "Junius Batz",
    "email": "haskell1937@olson.info",
    "country": "Country",
    "birthday": "1980-09-12"
  }
}
Property Description Type Required
attributes.birthday Birthday in YYYY-MM-DD format string true
attributes.country Country string true
attributes.email Email string true
attributes.full_name Full name string true
attributes.phone Users phone number string true
attributes.postal_code The users postal / zip code string true
attributes.street_address Street address string true
attributes.user_created_at First created timestamp UTC string true
attributes.user_updated_at Last update timestamp UTC string true
id The user unique ID string true
type This entity type, always "user" string true

Users

A page of User results

{
  "meta": {
    "total-pages": 1
  },
  "links": {
    "self": "http://localhost:4001/api/v1/users?page[number]=1&page[size]=1",
    "prev": "",
    "next": "",
    "last": "http://localhost:4001/api/v1/users?page[number]=1&page[size]=1",
    "first": "http://localhost:4001/api/v1/users?page[number]=1&page[size]=1"
  },
  "data": [
    {
      "type": "users",
      "id": "2841943X",
      "attributes": {
        "user_updated_at": "",
        "user_created_at": "",
        "street_address": "I am a street address",
        "postal_code": "12345",
        "phone": "1800-IAMATEST",
        "full_name": "Aliza Schiller",
        "email": "denis1961@bradtke.org",
        "country": "Country",
        "birthday": ""
      }
    }
  ]
}
Property Description Type Required
data Content with User objects array(User) true
links.first Link to the first page of results string true
links.last Link to the last page of results string true
links.next Link to the next page of results string true
links.prev Link to the previous page of results string true
links.self Link to this page of results string true
meta.total-pages The total number of pages available integer true

users

Operations related to users

Query for users.

returns a single user with pagination metadata

GET /api/v1/users?page%5Bsize%5D=1&page%5Bnumber%5D=1
accept: application/vnd.api+json
authorization: Basic aGVyb2l4OnBhc3N3b3Jk

Response

200
content-type: application/vnd.api+json; charset=utf-8
cache-control: max-age=0, private, must-revalidate
x-request-id: mbrq5c2oim1heh86ca36tbrbpemqcstk
{
  "meta": {
    "total-pages": 1
  },
  "links": {
    "self": "http://localhost:4001/api/v1/users?page[number]=1&page[size]=1",
    "prev": "",
    "next": "",
    "last": "http://localhost:4001/api/v1/users?page[number]=1&page[size]=1",
    "first": "http://localhost:4001/api/v1/users?page[number]=1&page[size]=1"
  },
  "data": [
    {
      "type": "users",
      "id": "3682559X",
      "attributes": {
        "user_updated_at": "2016-06-06T23:51:34.167+00:00",
        "user_created_at": "2016-06-06T23:51:34.167+00:00",
        "street_address": "I am a street address",
        "region": "Region",
        "postal_code": "12345",
        "phone": "1800-IAMATEST",
        "locality": "Locality",
        "full_name": "Mrs. Katelynn Kutch DDS",
        "extended_address": "I am an address",
        "email": "skylar_weissnat@blanda.com",
        "country": "Country",
        "birthday": "1980-09-12T00:00:00.000+00:00"
      }
    }
  ]
}

returns multiple users with pagination metadata

GET /api/v1/users?page%5Bsize%5D=2&page%5Bnumber%5D=2
accept: application/vnd.api+json
authorization: Basic aGVyb2l4OnBhc3N3b3Jk

Response

200
content-type: application/vnd.api+json; charset=utf-8
cache-control: max-age=0, private, must-revalidate
x-request-id: ijgu8risvmh3ble87psr2jfp7qnnuku7
{
  "meta": {
    "total-pages": 3
  },
  "links": {
    "self": "http://localhost:4001/api/v1/users?page[number]=2&page[size]=2",
    "prev": "http://localhost:4001/api/v1/users?page[number]=1&page[size]=2",
    "next": "http://localhost:4001/api/v1/users?page[number]=3&page[size]=2",
    "last": "http://localhost:4001/api/v1/users?page[number]=3&page[size]=2",
    "first": "http://localhost:4001/api/v1/users?page[number]=1&page[size]=2"
  },
  "data": [
    {
      "type": "users",
      "id": "59140763",
      "attributes": {
        "user_updated_at": "2016-06-06T23:51:34.131+00:00",
        "user_created_at": "2016-06-06T23:51:34.131+00:00",
        "street_address": "I am a street address",
        "region": "Region",
        "postal_code": "12345",
        "phone": "1800-IAMATEST",
        "locality": "Locality",
        "full_name": "Jaunita Stiedemann",
        "extended_address": "I am an address",
        "email": "wilhelmine_blanda@king.biz",
        "country": "Country",
        "birthday": "1980-09-12T00:00:00.000+00:00"
      }
    },
    {
      "type": "users",
      "id": "33433488",
      "attributes": {
        "user_updated_at": "2016-06-06T23:51:34.132+00:00",
        "user_created_at": "2016-06-06T23:51:34.132+00:00",
        "street_address": "I am a street address",
        "region": "Region",
        "postal_code": "12345",
        "phone": "1800-IAMATEST",
        "locality": "Locality",
        "full_name": "Fabian Schuppe",
        "extended_address": "I am an address",
        "email": "sadie2092@breitenberg.name",
        "country": "Country",
        "birthday": "1980-09-12T00:00:00.000+00:00"
      }
    }
  ]
}

returns users related to organization

GET /api/v1/users?filter%5Borganization_uuid%5D=1530566X&page%5Bsize%5D=1
accept: application/vnd.api+json
authorization: Basic aGVyb2l4OnBhc3N3b3Jk

Response

200
content-type: application/vnd.api+json; charset=utf-8
cache-control: max-age=0, private, must-revalidate
x-request-id: 2fe632edohejqek1sajrepvi5bunru8b
{
  "meta": {
    "total-pages": 1
  },
  "links": {
    "self": "http://localhost:4001/api/v1/users?page[number]=1&page[size]=1",
    "prev": "",
    "next": "",
    "last": "http://localhost:4001/api/v1/users?page[number]=1&page[size]=1",
    "first": "http://localhost:4001/api/v1/users?page[number]=1&page[size]=1"
  },
  "data": [
    {
      "type": "users",
      "id": "52295672",
      "attributes": {
        "user_updated_at": "2016-06-06T23:51:34.102+00:00",
        "user_created_at": "2016-06-06T23:51:34.102+00:00",
        "street_address": "I am a street address",
        "region": "Region",
        "postal_code": "12345",
        "phone": "1800-IAMATEST",
        "locality": "Locality",
        "full_name": "Lea Kutch",
        "extended_address": "I am an address",
        "email": "fae.ondricka@grady.org",
        "country": "Country",
        "birthday": "1980-09-12T00:00:00.000+00:00"
      }
    }
  ]
}

Query for users, supporting pagination and filtering by organization ID.

Parameters

Parameter Description In Type Required Default Example
page[size] Page size query integer false 10 100
page[number] Page Number query integer false 1 7
filter[organization_uuid] Organization UUID query string false 1234-123124-12213

Responses

Status Description Schema
200 A list of users. Users
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment