Introduction
Endpoint
Action name | create broker |
---|---|
HTTP path | /api/products |
HTTP method | POST |
Attributes of the HTTP request
token | string | required | A security token provided from Authentication endpoint. |
---|---|---|---|
professionId | int | optional | An attribute used to filter out all products for particular profession. |
Attributes of the HTTP response
Success response | |||
---|---|---|---|
JSON array of objects containing: | |||
id | int | required | An unique identifier of the product. |
name | string | required | A product’s name. |
Failed response | |||
error | string | required | It contains a reason for the failed request. |
Examples
HTTP Request without profession filter |
# HTTP POST # /api/products # 'Content-Type': 'application/json' # 'Accept': 'application/json' { "token": "some long string value" } |
HTTP Request with profession filter |
# HTTP POST # /api/products # 'Content-Type': 'application/json' # 'Accept': 'application/json' { "token": "some long string value", "professionId": 123 } |
Successful HTTP Response |
# HTTP 200 status code # 'Content-Type': 'application/json' [ { "id": 1, "name": "Product1" }, { "id": 2, "name": "Product2" } ] |
Failed HTTP Response |
# HTTP 200 status code # 'Content-Type': 'application/json' { "error": "API User is not existing or deactivated." } |