Skip to content

Latest commit

 

History

History
341 lines (255 loc) · 8.8 KB

openApi.md

File metadata and controls

341 lines (255 loc) · 8.8 KB
title language_tabs language_clients toc_footers includes search highlight_theme headingLevel
EmporioLambda Backend v0.1.0
shell
curl
shell
true
darkula
2

EmporioLambda Backend v0.1.0

Scroll down for code samples, example requests and responses. Select a language for code samples from the tabs above or the mobile navigation menu.

REST interfaces for EmporioLambda Backend

Base URLs:

Authentication

Scope Scope Description
read read for customers and admins
readAdmin read only for admins
writeUser edit data only for users
writeAdmin edit data only for admins

carts

The carts service

post__cart

Code samples

# You can also use wget
curl -X POST https://app.swaggerhub.com/apis/NotOnlyStudents/Backend/0.0.1/cart \
  -H 'Content-Type: application/json' \
  -H 'Accept: application/json' \
  -H 'Authorization: Bearer {access-token}'

POST /cart

Add a new product to the buyer's cart

Body parameter

{
  "token": {
    "data": {
      "id": "string",
      "name": "string",
      "description": "string",
      "images": [
        "string"
      ],
      "quantity": 0,
      "price": 0,
      "available": true,
      "evidence": true,
      "category": [
        "string"
      ]
    },
    "timeout": "2019-08-24T14:15:22Z"
  },
  "hmac": "stringstringstringstringstringstringstringst"
}

Parameters

Name In Type Required Description
body body object true none
» token body object true none
»» data body #/paths/1cart/post/requestBody/content/application1json/schema/properties/token/properties/data false none
»»» id body string true none
»»» name body string true none
»»» description body string false none
»»» images body [string] false none
»»» quantity body integer(int32) true none
»»» price body integer(int64) true none
»»» available body boolean false none
»»» evidence body boolean false none
»»» category body [string] true none
»» timeout body string(date-time) false none
» hmac body string(byte) true none

Example responses

400 Response

{
  "message": "string"
}

Responses

Status Meaning Description Schema
204 No Content Successfull modification of the cart None
400 Bad Request Invalid request Inline
401 Unauthorized No authentication information was given, denied Inline
403 Forbidden Wrong permissions, denied Inline
5XX Unknown Unexpected server error Inline

Response Schema

Status Code 400

Name Type Required Restrictions Description
» message string true none none

Status Code 401

Name Type Required Restrictions Description
» message string true none none

Status Code 403

Name Type Required Restrictions Description
» message string true none none

Status Code 5XX

Name Type Required Restrictions Description
» message string true none none
To perform this operation, you must be authenticated by means of one of the following methods: oAuth ( Scopes: writeUser )

get__cart

Code samples

# You can also use wget
curl -X GET https://app.swaggerhub.com/apis/NotOnlyStudents/Backend/0.0.1/cart \
  -H 'Accept: application/json' \
  -H 'Authorization: Bearer {access-token}'

GET /cart

Obtain information about a user personal cart

Example responses

200 Response

{
  "token": {
    "data": {
      "products": [
        {
          "id": "string",
          "name": "string",
          "description": "string",
          "images": [
            "string"
          ],
          "quantity": 0,
          "price": 0,
          "available": true,
          "evidence": true,
          "category": [
            "string"
          ]
        }
      ]
    },
    "timeout": "2019-08-24T14:15:22Z"
  },
  "hmac": "stringstringstringstringstringstringstringst"
}

Responses

Status Meaning Description Schema
200 OK Successfully returned a cart Inline
401 Unauthorized No authentication information was given, denied Inline
5XX Unknown Unexpected server error Inline

Response Schema

Status Code 200

Name Type Required Restrictions Description
» token object true none none
»» data object false none none
»»» products [#/paths/1cart/post/requestBody/content/application1json/schema/properties/token/properties/data] true none none
»»»» id string true none none
»»»» name string true none none
»»»» description string false none none
»»»» images [string] false none none
»»»» quantity integer(int32) true none none
»»»» price integer(int64) true none none
»»»» available boolean false none none
»»»» evidence boolean false none none
»»»» category [string] true none none
»» timeout string(date-time) false none none
» hmac string(byte) true none none

Status Code 401

Name Type Required Restrictions Description
» message string true none none

Status Code 5XX

Name Type Required Restrictions Description
» message string true none none
To perform this operation, you must be authenticated by means of one of the following methods: oAuth ( Scopes: read )

patch__cart_{productId}

Code samples

# You can also use wget
curl -X PATCH https://app.swaggerhub.com/apis/NotOnlyStudents/Backend/0.0.1/cart/{productId} \
  -H 'Content-Type: application/json' \
  -H 'Accept: application/json' \
  -H 'Authorization: Bearer {access-token}'

PATCH /cart/{productId}

Edit a product quantity in the buyer's cart

Body parameter

{
  "quantity": 0
}

Parameters

Name In Type Required Description
productId path string true The id of the desired product
body body object true none
» quantity body integer(int32) false none

Example responses

400 Response

{
  "message": "string"
}

Responses

Status Meaning Description Schema
204 No Content Successfull modification of the product quantity in the cart None
400 Bad Request Invalid request Inline
401 Unauthorized No authentication information was given, denied Inline
403 Forbidden Wrong permissions, denied Inline
5XX Unknown Unexpected server error Inline

Response Schema

Status Code 400

Name Type Required Restrictions Description
» message string true none none

Status Code 401

Name Type Required Restrictions Description
» message string true none none

Status Code 403

Name Type Required Restrictions Description
» message string true none none

Status Code 5XX

Name Type Required Restrictions Description
» message string true none none
To perform this operation, you must be authenticated by means of one of the following methods: oAuth ( Scopes: writeUser )