All Projects → kolonialno → Api Docs

kolonialno / Api Docs

API documentation for Kolonial.no

Projects that are alternatives of or similar to Api Docs

Custom-Software-For-Xiaomi-Dafang
API and panel site for Xiaomi Dafang
Stars: ✭ 36 (+38.46%)
Mutual labels:  api-documentation
Ghlocalapi
(Unofficial) Google Home local API documentation.
Stars: ✭ 334 (+1184.62%)
Mutual labels:  api-documentation
Pdoc
🐍 ➡️ 📜 Auto-generate API documentation for Python projects
Stars: ✭ 604 (+2223.08%)
Mutual labels:  api-documentation
phpdoc-vuepress
🎨 Template for generating your PHP API documentation in a pretty VuePress format
Stars: ✭ 19 (-26.92%)
Mutual labels:  api-documentation
django rest framework swagger tutorial
django rest framework swagger tutorial
Stars: ✭ 20 (-23.08%)
Mutual labels:  api-documentation
Japicmp
Comparison of two versions of a jar archive
Stars: ✭ 490 (+1784.62%)
Mutual labels:  api-documentation
reslate
Beautiful static documentation for your API
Stars: ✭ 98 (+276.92%)
Mutual labels:  api-documentation
Nei Toolkit
NEI 接口文档管理平台配套自动化工具
Stars: ✭ 781 (+2903.85%)
Mutual labels:  api-documentation
Chn Eolinker Ams Lite 4.0 For Java
中国最大的API接口管理平台,3.x开源发行版,支持多国语言[英语、简体中文、繁体中文]
Stars: ✭ 275 (+957.69%)
Mutual labels:  api-documentation
Alfred Devdocs
Alfred workflow for devdocs.io
Stars: ✭ 521 (+1903.85%)
Mutual labels:  api-documentation
eoLinker
在线 API 研发管理测试工具,最后能用的开源修复版本(4.0.1本地测试插件兼容3.5与4.0版本)。
Stars: ✭ 62 (+138.46%)
Mutual labels:  api-documentation
chitchats-api-doc
Documentation for the Chit Chats API
Stars: ✭ 21 (-19.23%)
Mutual labels:  api-documentation
Docgen
Transform your postman collection to HTML/Markdown documentation
Stars: ✭ 498 (+1815.38%)
Mutual labels:  api-documentation
webapi
WAI based library for web api
Stars: ✭ 27 (+3.85%)
Mutual labels:  api-documentation
Devdocs
API Documentation Browser
Stars: ✭ 27,208 (+104546.15%)
Mutual labels:  api-documentation
idoc
📒📚Generate beautiful interactive documentation and Open-API 3.0 spec file from your existing Laravel app.
Stars: ✭ 95 (+265.38%)
Mutual labels:  api-documentation
Raml Spec
RAML Specification
Stars: ✭ 3,759 (+14357.69%)
Mutual labels:  api-documentation
Platform Documentation
Core Platform API Documentation & Tutorials
Stars: ✭ 25 (-3.85%)
Mutual labels:  api-documentation
Graphql Voyager
🛰️ Represent any GraphQL API as an interactive graph
Stars: ✭ 6,481 (+24826.92%)
Mutual labels:  api-documentation
Create Openapi Repo
🤖 Generator for GH repo to help you manage the OpenAPI definition lifecycle
Stars: ✭ 513 (+1873.08%)
Mutual labels:  api-documentation

Kolonial.no API

The API is currently not publicly available.

We only allow pre-approved API clients at this time, and each client needs a unique User-Agent and Client-Token. This is a work in progress and no API stability is guaranteed at this time.

And btw, we're hiring! Read more about our technology 🙌

Quick start

curl -H "Accept: application/json" -H "Content-Type: application/json" -H "User-Agent: <YOUR-USER-AGENT>/1.0" -H "X-Client-Token: <YOUR-CLIENT-TOKEN>" https://kolonial.no/api/v1/products/9329/

Usage

All requests require that the User-Agent and X-Client-Token headers are set. These are unique for the developers participating in the beta, so please do not share these. That said, we would really love if you open sourced your code!

We return JSON on all endpoints, and expect it as input. Remember to set the Accept and Content-Type headers accordingly.

Authentication

Some endpoints requires that the user is authenticated. To acquire a session token, use the login endpoint and save the returned sessionid for use with subsequent requests. The session is valid for a very long time.

To access authenticated URLs, set the HTTP header Cookie: sessionid=<token>.

POST /api/v1/user/login/
    {"username": "", "password": ""}

POST /api/v1/user/logout/

Endpoints

Products

The product category ID can be used to obtain all products in a given child category:

GET /api/v1/productcategories/
GET /api/v1/productcategories/<product_category_id>/

Extended product information:

GET /api/v1/products/<product_id>/

Search

The main search endpoint can be used for both text queries and numeric barcodes.

GET /api/v1/search/?q=mango
GET /api/v1/search/recipes/?q=pasta

Recipes

These are some of the recipe related endpoints:

GET /api/v1/recipe-tags/
GET /api/v1/recipe-tags/<recipe_tag_id>/
GET /api/v1/recipes/plans/current/

GET /api/v1/recipes/<recipe_id>/

These endpoints are personal for the user and requires authentication:

GET  /api/v1/recipes/likes/
GET  /api/v1/recipes/purchased/
POST /api/v1/recipes/<recipe_id>/like-toggle/

Cart

Manipulating the cart contents requires authentication. The quantity field adjusts the quantity currently in the cart.

GET /api/v1/cart/

POST /api/v1/cart/items/
    {
        "items": [{
            "product_id": 9329,
            "quantity": 2,
        }, {
            "product_id": 15163,
            "quantity": -1
        }]
    }

POST /api/v1/cart/clear/

Shopping lists (Product List)

Shopping lists (technically called product lists) can be manipulated through authenticated API calls.

List all product lists

Paginated response. Page size is 50 lists.

GET /api/v1/product-lists/

Response:
{
  "next": null,
  "previous": null,
  "results": [
    {
      "id": <id>,
      "title": "My taco list",
      "description": "Collection of taco products",
      "url": "/handlelister/<id>/",
      "number_of_items": 1,
      "number_of_products": 1,
      "images": [
        {
          "thumbnail": {
            "url": "..."
          }
        }
      ]
    }
  ]
}

Show product list items/details

GET /api/v1/product-lists/<id>/

Response:
{
  "id": <id>,
  "title": "My taco list",
  "description": "Collection of taco products",
  "url": "/handlelister/<id>/",
  "number_of_items": 1,
  "number_of_products": 1,
  "items": [
    {
      "quantity": 1
      "product": {
        ...
      },
    }
  ]
}

Create new product list

POST /api/v1/product-lists/

Payload:
{
  "title": "My new list",
  "description": "An optional description"
}

Response:
{
  "id": <id>,
  "title": "My new list",
  "description": "An optional description",
  "url": "/handlelister/<id>/",
  "number_of_items": 0,
  "number_of_products": 0,
  "items": []
}

Change title and/or description

POST /api/v1/product-lists/<id>/

Payload:
{
  "title": "My updated list title",
  "description": "An new description"
}

Response:
{
  "id": <id>,
  "title": "My updated list title",
  "description": "A new description",
  "url": "/handlelister/<id>/",
  "number_of_items": 0,
  "number_of_products": 0,
  "items": []
}

Delete an existing product list

DELETE /api/v1/product-lists/<id>/

Response:
{
  "success": true
}

Add new product to list

POST /api/v1/product-lists/<id>/products/

Payload:
{
  "items": [
    {
      "product_id": <id>,
      "quantity": 1
    }
  ]
}

Response:
{
  "id": <id>,
  "title": "Example list title",
  "description": "",
  "url": "/handlelister/<id>/",
  "number_of_items": 1,
  "number_of_products": 0,
  "items": [...]
}

Decrease quantity of product in list

Note: Notice that we use the same endpoint (products/) to manipulate all items in the product list.

Also note that decreasing the quantity to 0 (zero) does not delete the product from the list. In order to delete the product you need to pass delete: true in the payload (see below).

POST /api/v1/product-lists/<id>/products/

Payload:
{
  "items": [
    {
      "product_id": <id>,
      "quantity": -1
    }
  ]
}

Response:
{
  "id": <id>,
  "title": "Example list title",
  "description": "",
  "url": "/handlelister/<id>/",
  "number_of_items": 1,
  "number_of_products": 1,
  "items": [...]
}

Remove product from list

Note: Notice that we use the same endpoint (products/) to manipulate all items in the product list.

POST /api/v1/product-lists/<id>/products/

Payload:
{
  "items": [
    {
      "product_id": <id>,
      "quantity": -1,
      "delete": true
    }
  ]
}

Response:
{
  "id": <id>,
  "title": "Example list title",
  "description": "",
  "url": "/handlelister/<id>/",
  "number_of_items": 0,
  "number_of_products": 0,
  "items": []
}

Get list of product suggestions from product list

Based on product list title we can offer a set of products that might be quickly added to the product list, without the need for e.g. searching.

GET /api/v1/product-lists/<id>/suggestions/

Accepted Query Params:
  - offset (int, default: 0)
  - limit (int, default: 6)

Response:
{
  "next": "https://kolonial.no/api/v1/...",
  "previous": null,
  "results": [
    {...},
    {...}
  ],
}
Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].