Working with the storage and data

Requesting list of storages

HOST: https://api.mixapp.io

Path: /v1/workplaces/:workplace/storages

workplace - workplace name

Method: GET

Headers:

Content-Type: application/json
X-Auth-Token: <Token>

Body:


Response:

Success

{ "result": [] }

Error

JSON { error_code: int, error_message: string, more_info: "" }

Creating the storage

HOST: https://api.mixapp.io

Path: /v1/workplaces/:workplace/storages

workplace - workplace name

Method: POST

Headers:

Content-Type: application/json
X-Auth-Token: <Token>

Body:

{
  "name": "test",
  "ACL": {
    "create": ["*"],
    "read": ["*"],
    "update": ["*"],
    "delete": ["*"]
  }
}

Response:

Success

{ "result": { "ACL": { "create": ["*"], "delete": ["*"], "read": ["*"], "update": ["*"] }, "name": "test" } }

Error

JSON { error_code: int, error_message: string, more_info: "" }

Requesting storage information

HOST: https://api.mixapp.io

Path: /v1/workplaces/:workplace/storages/:name

workplace - workplace name

workplace - workplace name

name - storage name

Method: GET

Headers:

Content-Type: application/json
X-Auth-Token: <Token>

Body:


Response:

Success

{ "result": { "ACL": { "create": [], "delete": [], "read": [], "update": [] }, "name": "test" } }

Updating the storage

HOST: https://api.mixapp.io

Path: /v1/workplaces/:workplace/storages/:name

workplace - workplace name

name - storage name

Method: POST

Headers:

Content-Type: application/json
X-Auth-Token: <Token>

Body:

{
  "ACL": {
    "create": [],
    "read": [],
    "update": [],
    "delete": []
  }
}

Response:

Success

{ "result": { "ACL": { "create": [], "delete": [], "read": [], "update": [] }, "name": "test" } }

Error

JSON { error_code: int, error_message: string, more_info: "" }

Deleting the storage

HOST: https://api.mixapp.io

Path: /v1/workplaces/:workplace/storages/:name

workplace - workplace name

name - storage name

Method: DELETE

Headers:

Content-Type: application/json
X-Auth-Token: <Token>

Body:


Response:

Success

{ "result": true }

Error

JSON { error_code: int, error_message: string, more_info: "" }

Indexes

Requesting the list of storage indexes

HOST: https://api.mixapp.io

Path: /v1/workplaces/:workplace/storages/:name/indexes

workplace - workplace name

name - storage name

Method: GET

Headers:

Content-Type: application/json
X-Auth-Token: <Token>

Body:


Response:

Success

{ "result": [ { "Background": false, "Bits": 0, "BucketSize": 0, "DefaultLanguage": "", "DropDups": false, "ExpireAfter": 0, "Key": [ "_id" ], "LanguageOverride": "", "Max": 0, "Maxf": 0, "Min": 0, "Minf": 0, "Name": "_id_", "Sparse": false, "Unique": false, "Weights": null } ] }

Error

JSON { error_code: int, error_message: string, more_info: "" }

Creating the index

HOST: https://api.mixapp.io

Path: /v1/workplaces/:workplace/storages/:name/indexes

workplace - workplace name

name - storage name

Method: POST

Headers:

Content-Type: application/json
X-Auth-Token: <Token>

Body:

{
    "name": "IndexName",
    "key": ["-field1","+field2"],
}

Response:

Success

{ "result": { "Background": true, "Bits": 0, "BucketSize": 0, "DefaultLanguage": "", "DropDups": false, "ExpireAfter": 0, "Key": [ "-field1","+field2" ], "LanguageOverride": "", "Max": 0, "Maxf": 0, "Min": 0, "Minf": 0, "Name": "IndexName", "Sparse": false, "Unique": false, "Weights": null } }

Error

JSON { error_code: int, error_message: string, more_info: "" }

Deleting the index

HOST: https://api.mixapp.io

Path: /v1/workplaces/:workplace/storages/:name/indexes/:indexName

workplace - workplace name

name - storage name

indexName - index name

Method: DELETE

Headers:

Content-Type: application/json
X-Auth-Token: <Token>

Body:


Response:

Success

{ "result": true }

Error

JSON { error_code: int, error_message: string, more_info: "" }

Data

Retrieving the list of documents

HOST: https://api.mixapp.io

Path: /workplaces/:workplace/storages/:name/read

workplace - workplace name

name - storage name

Method: POST

Headers:

Content-Type: application/json
X-Auth-Token: <Token>

Body:

{
    query: {},
    doc: {},
    limit: 10,
    fields: {},
    sort: {},
    skip: 0 
}

Response:

Success

{ "result": [] }

Error

JSON { error_code: int, error_message: string, more_info: "" }

Creating the document

HOST: https://api.mixapp.io

Path: /v1/workplaces/:workplace/storages/:name/create

workplace - workplace name

name - storage name

Method: POST

Headers:

Content-Type: application/json
X-Auth-Token: <Token>

Body:

{
    query: {},
    doc: {
        "field": "data"
    },
    limit: 10,
    fields: {},
    sort: {},
    skip: 0 
}

Response:

Success

{ "result": { "n": 1, "ok": 1 } }

Error

JSON { error_code: int, error_message: string, more_info: "" }

Updating the document

HOST: https://api.mixapp.io

Path: /workplaces/:workplace/storages/:name/update

workplace - workplace name

name - storage name

Method: POST

Headers:

Content-Type: application/json
X-Auth-Token: <Token>

Body:

{
    query: {
        "field": "data"
    },
    doc: {
        "$set": {
            "field": "new string"
        }
    },
    limit: 10,
    fields: {},
    sort: {},
    skip: 0 
}

Response:

Success

{ "result": { "n": 1, "nModified": 1, "ok": 1 } }

Error

JSON { error_code: int, error_message: string, more_info: "" }

Counting the documents

HOST: https://api.mixapp.io

Path: /v1/workplaces/:workplace/storages/:name/count

workplace - workplace name

name - storage name

Method: POST

Headers:

Content-Type: application/json
X-Auth-Token: <Token>

Body:

{
    query: {
        "field": "new string"
    },
    doc: {},
    limit: 10,
    fields: {},
    sort: {},
    skip: 0 
}

Response:

Success

{ "result": 1 }

Error

JSON { error_code: int, error_message: string, more_info: "" }

Deleting the documents

HOST: https://api.mixapp.io

Path: /v1/workplaces/:workplace/storages/:name/delete

workplace - workplace name

name - storage name

Method: POST

Headers:

Content-Type: application/json
X-Auth-Token: <Token>

Body:

{
    query: {},
    doc: {},
    limit: 10,
    fields: {},
    sort: {},
    skip: 0 
}

Response:

Success

{ "result": { "n": 1, "ok": 1 } }

Error

JSON { error_code: int, error_message: string, more_info: "" }