Analytics (0.0.0)

Download OpenAPI specification:Download

A simple analytics API.

Authentication

RootKey

The instance root key is used for managing projects.

Security Scheme Type API Key
Header parameter name: X-Root-Key

WriteKeyHeader

Security Scheme Type API Key
Header parameter name: Authorization

WriteKeyQuery

Security Scheme Type API Key
Query parameter name: api_key

Events

Events are the individual data points collected by the API. These events are stored in collections.

Record a single event

path Parameters
projectId
required
string
Example: 5e19426836270c1b1e7b03f2

ID of the project.

collectionName
required
string
Example: your_event

Name of the event collection to record the event in.

Request Body schema: application/json

Key value object of the event body

Responses

201

Event created successfully

400

Missing or invalid parameters. Error messages will often contain more information to help you figure out what’s wrong.

401

API key is missing or invalid

404

The requested resource was not found.

post /projects/{projectId}/events/{collectionName}
https://e1-analytics.herokuapp.com/1.0/projects/{projectId}/events/{collectionName}
http://localhost:3000/1.0/projects/{projectId}/events/{collectionName}

Request samples

Content type
application/json
Copy
Expand all Collapse all
{
  • "key": "value"
}

Response samples

Content type
application/json
Copy
Expand all Collapse all
{
  • "created": true
}

Record a single event

path Parameters
projectId
required
string
Example: 5e19426836270c1b1e7b03f2

ID of the project.

collectionName
required
string
Example: your_event

Name of the event collection to record the event in.

query Parameters
data
string

URL-encoded AND base-64 encoded event body

redirect
string

A URL to redirect the request toward after the event is recorded.

Responses

201

Event created successfully

400

Missing or invalid parameters. Error messages will often contain more information to help you figure out what’s wrong.

401

API key is missing or invalid

404

The requested resource was not found.

get /projects/{projectId}/events/{collectionName}
https://e1-analytics.herokuapp.com/1.0/projects/{projectId}/events/{collectionName}
http://localhost:3000/1.0/projects/{projectId}/events/{collectionName}

Response samples

Content type
application/json
Copy
Expand all Collapse all
{
  • "created": true
}

Projects

Projects

Get projects

Authorizations:

Responses

200

A project object

401

API key is missing or invalid

get /projects
https://e1-analytics.herokuapp.com/1.0/projects
http://localhost:3000/1.0/projects

Response samples

Content type
application/json
Copy
Expand all Collapse all
[
  • {
    }
]

Create project

Authorizations:
Request Body schema: application/json

New project

name
required
string

Specifies the name of the project

Responses

200

A project object

400

Missing or invalid parameters. Error messages will often contain more information to help you figure out what’s wrong.

401

API key is missing or invalid

404

The requested resource was not found.

post /projects
https://e1-analytics.herokuapp.com/1.0/projects
http://localhost:3000/1.0/projects

Request samples

Content type
application/json
Copy
Expand all Collapse all
{
  • "name": "Test Project"
}

Response samples

Content type
application/json
Copy
Expand all Collapse all
{
  • "_id": "5e19426836270c1b1e7b03f2",
  • "name": "Test Project",
  • "masterKey": "<MASTER_API_KEY>",
  • "readKey": "<READ_API_KEY>",
  • "writeKey": "<WRITE_API_KEY>",
  • "createdAt": "2020-01-11T13:38:05.006Z",
  • "updatedAt": "2020-01-11T21:18:56.035Z"
}

Get project

Authorizations:
path Parameters
projectId
required
string
Example: 5e19426836270c1b1e7b03f2

ID of the project.

Responses

200

A project object

400

Missing or invalid parameters. Error messages will often contain more information to help you figure out what’s wrong.

401

API key is missing or invalid

404

The requested resource was not found.

get /projects/{projectId}
https://e1-analytics.herokuapp.com/1.0/projects/{projectId}
http://localhost:3000/1.0/projects/{projectId}

Response samples

Content type
application/json
Copy
Expand all Collapse all
{
  • "_id": "5e19426836270c1b1e7b03f2",
  • "name": "Test Project",
  • "masterKey": "<MASTER_API_KEY>",
  • "readKey": "<READ_API_KEY>",
  • "writeKey": "<WRITE_API_KEY>",
  • "createdAt": "2020-01-11T13:38:05.006Z",
  • "updatedAt": "2020-01-11T21:18:56.035Z"
}

Update project

Authorizations:
path Parameters
projectId
required
string
Example: 5e19426836270c1b1e7b03f2

ID of the project.

Request Body schema: application/json

Updated project

name
required
string

Specifies the name of the project

Responses

200

A project object

400

Missing or invalid parameters. Error messages will often contain more information to help you figure out what’s wrong.

401

API key is missing or invalid

404

The requested resource was not found.

post /projects/{projectId}
https://e1-analytics.herokuapp.com/1.0/projects/{projectId}
http://localhost:3000/1.0/projects/{projectId}

Request samples

Content type
application/json
Copy
Expand all Collapse all
{
  • "name": "Test Project"
}

Response samples

Content type
application/json
Copy
Expand all Collapse all
{
  • "_id": "5e19426836270c1b1e7b03f2",
  • "name": "Test Project",
  • "masterKey": "<MASTER_API_KEY>",
  • "readKey": "<READ_API_KEY>",
  • "writeKey": "<WRITE_API_KEY>",
  • "createdAt": "2020-01-11T13:38:05.006Z",
  • "updatedAt": "2020-01-11T21:18:56.035Z"
}