Intro

These endpoints enables you to maintain your account programatically.

IMPORTANT! Creating addons is currently enabled per invitation only. Please reach out to get an invitation.

Visit our guide to build an addon for more informations.

Authentication

All requests to the API must include a base64 encoded version API token you can copy from your account.

If you e.g. want to update a collection that has _id 5bf935bc3ab42fc4f4280d04, and your API token is a-e1f92c77-5bb0-4fb8-9bd8-9b61d014ab5f, then your request should look like this:

PATCH /api/v1/collections/5bf935bc3ab42fc4f4280d04
Host: https://goaddon.com
Content-Type: application/json
Accept: application/json
Authorization: Basic YS1lMWY5MmM3Ny01YmIwLTRmYjgtOWJkOC05YjYxZDAxNGFiNWY=
{
  "foo": "bar"
}

Unauthorized requests will responded with 401 Unauthorized.

Resources
addons

If you have signed up as an addon you can manage some of your settings through this API.

Name Type Description

_id

BSON::ObjectId

author

String

The company name behind the addon, e.g. My company.

webhook_url_eu

String

When a project inside of the EU zone subscribes to your addon we can trigger a webhook at your EU based API. Here you can register the URL of your API.

If you own e.g. example.com you could could setup your own API there, or you could create a subdomain for it at e.g. eu-api.example.com.

webhook_url_us

String

When a project inside of the US zone subscribes to your addon we can trigger a webhook at your EU based API. Here you can register the URL of your API.

If you own e.g. example.com you could could setup your own API there, or you could create a subdomain for it at e.g. us-api.example.com.

create_project_webhook_path

String

This is the endpoint our webhook hits when a project subscribes to your addon. It signals for you to create a record for the project in your database, assuming that is a part of your project onboarding process.

Following REST conventions we will trigger a POST request, and you are suggested to choose an endpoint ending with /projects. If you choose that exact endpoint, and your own API is registered at e.g. api.example.com, the webhook would hit POST https://api.example.com/projects.

{
  "_id": "5c3f908e3ab42f323432fc59",
  "name": "Example Project",
  "db_hosts": [
    "5c3f908e3ab42f323432fc59-0.mongodb.goaddon.com",
    "5c3f908e3ab42f323432fc59-1.mongodb.goaddon.com"
  ],
  "db_username": "p_5c3f908e3ab42f323432fc59",
  "db_password": "7cf3455b813e7192d3782c1bb31af78500e1d8bbb3fc02a1ef6f7b6c7a6f",
  "encryption_key": "9ba70ff0dae4a78478b93251b3520a23effe667803d7bf985895fb8e652234b2",
  "encryption_iv": "00b43450c1f190fcd1971eb801e5607b",
  "subscription_id": "5c3f90a83ab42f323432fc5a"
}

update_project_webhook_path

String

This is the endpoint our webhook hits when a subscribed project updates its informations. It signals for you to update the projects record in your database, assuming you keep such records.

Following REST conventions we will trigger a PATCH request, and you are suggested to choose an endpoint ending with /projects/{{ project_id }}.

When you include {{ project_id }} in the string we will replace it with the actual _id of the project. If you choose that exact endpoint, and your own API is registered at e.g. api.example.com and the _id of the project is 5bf935bb3ab42fc4f4280d03, the webhook would hit PATCH https://api.example.com/projects/5bf935bb3ab42fc4f4280d03.

{
  "_id": "5c3f908e3ab42f323432fc59",
  "name": "Example Project",
  "db_hosts": [
    "5c3f908e3ab42f323432fc59-0.mongodb.goaddon.com",
    "5c3f908e3ab42f323432fc59-1.mongodb.goaddon.com"
  ],
  "db_username": "p_5c3f908e3ab42f323432fc59",
  "db_password": "7cf3455b813e7192d3782c1bb31af78500e1d8bbb3fc02a1ef6f7b6c7a6f",
  "encryption_key": "9ba70ff0dae4a78478b93251b3520a23effe667803d7bf985895fb8e652234b2",
  "encryption_iv": "00b43450c1f190fcd1971eb801e5607b",
  "subscription_id": "5c3f90a83ab42f323432fc5a"
}

destroy_project_webhook_path

String

This is the endpoint our webhook hits when a project unsubscribes. It signals for you to destroy or inactivate the projects record in your database, assuming you keep such records.

Following REST conventions we will trigger a DELETE request, and you are suggested to choose an endpoint ending with /projects/{{ project_id }}.

When you include {{ project_id }} string we will replace it with the actual _id of the project. If you choose that exact endpoint, and your own API is registered at e.g. api.example.com and the _id of the project is 5bf935bb3ab42fc4f4280d03, the webhook would hit DELETE https://api.example.com/projects/5bf935bb3ab42fc4f4280d03.

form_webhook_path

String

You will probably need subscribed projects to register certain details specific to your addon, and for that purpose you are able to setup configuration pages with forms for the project to fill out.

As per the page docs you can define for each form what HTTP request method and what action should be triggered. To update a project you could e.g. let the form trigger the HTTP method PATCH and the action /projects/5bf935bb3ab42fc4f4280d03.

But if you find yourself duplicating some part of the request action this field can help you out.

When you include {{ locale }} in the string we will replace it with the same locale that the form is displayed in. And when you include {{ action }} we will replace it with the action specified by the form. So you could e.g. choose /{{ locale }}{{ action }}.

Given all example values mentioned above, and that your own API is registered at e.g. api.example.com, you should prepare to receive a PATCH https://api.example.com/en/projects/5bf935bb3ab42fc4f4280d03.

name

String

The name to be displayed publicly, e.g. Your addon.

company

String

The company who legally has ownership of this account.

address_1

String

The address of your company.

address_2

String

An optional second address line of your company.

zip_code

String

The Zip code of the city where your company is legally located.

city

String

The city where your company is legally located.

province

String

The province, state or region where your company is legally located.

country

String

The country where your company is legally located.

email

String

The email address where you would like to receive information about billing.

vat_number

String

The VAT ID that should be applied to invoices.

website

String

The website to be displayed publicly, e.g. example.com.

headline

String

The headline of your public addon listing, e.g. Does cool stuff.

explainer

String

A secondary headline for your public addon listing, e.g. This addon does cool stuff..

video_url

String

A link to a Youtube video promoting your addon, if such a via exists. E.g. https://www.youtube.com/embed/example.

support_email

String

E.g. support@example.com.

support_phone

String

E.g. +123 12345678.

description

String

The primary description of your addon. You are free to style it with markdown.

wiki

String

pricing

String

terms

String

page_scripts

Array

If your pages require any external stripts to load, you can provide an array of script URL's. JQuery 3.3.1, Popper 1.14.7 and Bootstrap 4.3.1 is already loaded. E.g. ['https://cdn.example.com.min.js'].

page_styles

Array

If your pages require any external stylesheets to load, you can provide an array of stylesheet URL's. Bootstrap 4.3.1 and FontAwesome 5.4.2 are already loaded. E.g. ['https://cdn.example.com.min.css'].

paid_only

Boolean

By default, projects can subscribe to your addon without having registered a payment card with Goaddon. If your addon does not offer a free tier or a trial period you can require a payment card to be registered before a project can subscribe by setting this to true.

beta

Boolean

If your addon is in beta, but accepting subscribers you should set this to true. Otherwise you could submit false or leave it blank.

zone

String

The zone in which your addon was created. This determines in which datacenters you can create database nodes.

Description

Get your addon. Even though an endpoint like this would usually respond with many results you should only expect one.

Request

Optionally you can paginate results by including any of the following params in your request string:

Name Description Default value Max. value
per_page The max. number of documents you want returned 100 500
page The page number, starts at 0 0 -
HTTParty.get(
  "https://goaddon.com/api/v1/addons?per_page=100&page=0",
  headers: {
    "Authorization" => "Basic #{Base64.strict_encode64('a-e1f92c77-5bb0-4fb8-9bd8-9b61d014ab5f')}",
    "Content-Type"  => "application/json"
  }
)
Response
Name Description
documents

An array with the requested documents.

Name Description
error

A text description of the error.

No response body.

Description

Get your addon.

Request

No params required.

HTTParty.get(
  "https://goaddon.com/api/v1/addons/5bf935bc3ab42fc4f4280d05",
  headers: {
    "Authorization" => "Basic #{Base64.strict_encode64('a-e1f92c77-5bb0-4fb8-9bd8-9b61d014ab5f')}",
    "Content-Type"  => "application/json"
  }
)
Response
Name Description
document

The requested document.

Name Description
error

A text description of the error.

No response body.

Description

Update the addon.

Request

Include any of the following keys in your JSON body:

{
  "name": "My addon",
  "zone": "eu",
  "website": "https://example.com",
  "author": "My company",
  "webhook_url_eu": "eu-api.example.com",
  "webhook_url_us": "us-api.example.com",
  "create_project_webhook_path": "/projects",
  "update_project_webhook_path": "/projects/{{ project_id }}",
  "destroy_project_webhook_path": "/projects/{{ project_id }}",
  "form_webhook_path": "/{{ locale }}{{ action }}",
  "page_scripts": [
    "https://cdn.example.com.min.js"
  ],
  "page_styles": [
    "https://cdn.example.com.min.css"
  ],
  "support_email": "support@example.com",
  "support_phone": "+123 12345678",
  "headline": "Does cool stuff",
  "explainer": "This addon does cool stuff.",
  "video_url": "https://www.youtube.com/embed/example",
  "description": "#####Selling points\n\n- First selling point\n\n- Second selling point",
  "wiki": "#####Intro\n\n1. First do **this**\n\n2. Then do _that_",
  "pricing": "Free trial, then ...",
  "terms": "This agreement...",
  "beta": true,
  "paid_only": true
}
HTTParty.patch(
  "https://goaddon.com/api/v1/addons/5bf935bc3ab42fc4f4280d05",
  headers: {
    "Authorization" => "Basic #{Base64.strict_encode64('a-e1f92c77-5bb0-4fb8-9bd8-9b61d014ab5f')}",
    "Content-Type"  => "application/json"
  },
  body: body.to_json
)
Response
Name Description
success

A text confirmation describing if the document was successfully updated.

message

A text confirmation describing if the document was recognized, but that there was no new data to update with.

Name Description
error

A text description of the error.

No response body.

Description

Invite a user to access the addon. Caution! This will grant the user full and immediate access.

Request

Include an email of the user you would like to invite, either as a parameter or as a JSON request body:

{
  "email": "example@example.com"
}
# For example purposes the email is included both as a parameter and inside the request body. Choose the option you prefer.
HTTParty.patch(
  "https://goaddon.com/api/v1/addons/5bf935bc3ab42fc4f4280d05/grant_access?email=example@example.com",
  headers: {
    "Authorization" => "Basic #{Base64.strict_encode64('a-e1f92c77-5bb0-4fb8-9bd8-9b61d014ab5f')}",
    "Content-Type"  => "application/json"
  },
  body: {email: "example@example.com"}.to_json
)
Response
Name Description
success

A text confirming that the user was granted access.

user_id

The _id to the user that was granted access.

Name Description
error

A text description of the error.

No response body.

Description

Revoke a users access to the addon.

Request

Include the user_id of the user that should have his access revoked, either as a parameter or as a JSON request body:

{
  "user_id": "5c10f5133ab42f16f609497c"
}
# For example purposes the user_id is included both as a parameter and inside the request body. Choose the option you prefer.
HTTParty.patch(
  "https://goaddon.com/api/v1/addons/5bf935bc3ab42fc4f4280d05/revoke_access?user_id=5c10f5133ab42f16f609497c",
  headers: {
    "Authorization" => "Basic #{Base64.strict_encode64('a-e1f92c77-5bb0-4fb8-9bd8-9b61d014ab5f')}",
    "Content-Type"  => "application/json"
  },
  body: {user_id: "5c10f5133ab42f16f609497c"}.to_json
)
Response
Name Description
message

A text confirming that the users access was revoked.

Name Description
error

A text description of the error.

No response body.

Description

Unlock a users access to the addon.

Request

Include the user_id of the user that should have his access unlocked, either as a parameter or as a JSON request body:

{
  "user_id": "5c10f5133ab42f16f609497c"
}
# For example purposes the user_id is included both as a parameter and inside the request body. Choose the option you prefer.
HTTParty.patch(
  "https://goaddon.com/api/v1/addons/5bf935bc3ab42fc4f4280d05/unlock_access?user_id=5c10f5133ab42f16f609497c",
  headers: {
    "Authorization" => "Basic #{Base64.strict_encode64('a-e1f92c77-5bb0-4fb8-9bd8-9b61d014ab5f')}",
    "Content-Type"  => "application/json"
  },
  body: {user_id: "5c10f5133ab42f16f609497c"}.to_json
)
Response
Name Description
success

A text confirming that the users access was unlocked.

Name Description
error

A text description of the error.

No response body.

Description

Configure the database, by changing the number of nodes should participate in your MongoDB Replica Set.

Caution! Before you start using this API endpoint, be sure to have an intimite understanding about how to safely manage nodes on a Replica Set from Goaddon. One wrong request can cause permanent loss of data.

Request

Include the identifier of the datacenter where you want to change the number of nodes. Also include how many nodes should be in this datacenter.

Submit either as parameters or as a JSON request body:

{
  "identifier": "hcloud_fsn1__cx11",
  "nodes": 3
}

In this example, the number of CX11 nodes in Hetzners Falkenstein datacenter will be adjusted to 3. If other types of nodes exist in your plan they will not be changed unless you submit a separate request for those.

If you want to switch from a dedicated database plan to the Sandbox plan you should submit this:

{
  "identifier": "hcloud_fsn1__sandbox"
}

This will destroy your dedicated database plan along with all data in your dedicated database.

When you submit requests that result in permanent loss of data you are required to provide a verify sentence. The sentence should follow this template:

Delete the database of {{ name }}

If, for example, the name of your account is My Company, you should submit this:

{
  "identifier": "hcloud_fsn1__cx11",
  "nodes": 0,
  "verify": "Delete the database of My Company"
}
# For example purposes the identifier and nodes are included both as a parameters and inside the request body. Choose the option you prefer.
HTTParty.patch(
  "https://goaddon.com/api/v1/addons/5bf935bc3ab42fc4f4280d05/db_configure?identifier=hcloud_fsn1__cx11&nodes=3",
  headers: {
    "Authorization" => "Basic #{Base64.strict_encode64('a-e1f92c77-5bb0-4fb8-9bd8-9b61d014ab5f')}",
    "Content-Type"  => "application/json"
  },
  body: {identifier: "hcloud_fsn1__cx11", nodes: 3}.to_json
)
Response
Name Description
success

A text confirming that configuration is in progress.

Name Description
error

A text description of the error.

No response body.

Description

Reboot a node in your dedicated MongoDB Replica Set.

Request

Include the node_id of the node that you want to reboot. Or leave it out if you want to reboot all nodes.

Submit either as parameters or as a JSON request body:

{
  "node_id": "5447122"
}
# For example purposes the node_id is included both as a parameter and inside the request body. Choose the option you prefer. If you don't include a node_id all nodes will be rebooted.
HTTParty.patch(
  "https://goaddon.com/api/v1/addons/5bf935bc3ab42fc4f4280d05/db_reboot?node_id=5447122",
  headers: {
    "Authorization" => "Basic #{Base64.strict_encode64('a-e1f92c77-5bb0-4fb8-9bd8-9b61d014ab5f')}",
    "Content-Type"  => "application/json"
  },
  body: {node_id: "5447122"}.to_json
)
Response
Name Description
message

A text confirming that the node is being rebooted.

Name Description
error

A text description of the error.

No response body.

Description

Poll for the raw output from replSetGetStatus.

The first time you request this endpoint the polling will be initiated. Subsequently you should request it every few seconds in order to actually get the status. A healthy cluster will give a status almost immediately, but if one or more Replica Set members are unhealthy it can take up to 90 seconds. The status will be available up to 5 minutes after your first request.

This endpoint is only accessible if you have a dedicated database plan.

Request

No params required.

HTTParty.get(
  "https://goaddon.com/api/v1/addons/5bf935bc3ab42fc4f4280d05/db_status",
  headers: {
    "Authorization" => "Basic #{Base64.strict_encode64('a-e1f92c77-5bb0-4fb8-9bd8-9b61d014ab5f')}",
    "Content-Type"  => "application/json"
  }
)
Response
Name Description
success

A text confirming that the status is included.

repl_set_get_status

The raw output from replSetGetStatus. If polling failed because the database connection timed out this key will contain the response error.

nodes

An array of all nodes. A node will be contain an identifier and an IP address.

requested_at

The time the polling was started.

saved_at

The time the polling was finished and made available.

message

If this is your first request no other keys will be included. Instead a message key will confirm that polling has been initiated or is still in progress.

Name Description
error

A text description of the error.

No response body.

Description

Initiate a failover, where the primary node of your MongoDB Replica Set steps down.

This endpoint is only accessible if you have a dedicated database plan.

Request

No params required.

HTTParty.patch(
  "https://goaddon.com/api/v1/addons/5bf935bc3ab42fc4f4280d05/db_failover",
  headers: {
    "Authorization" => "Basic #{Base64.strict_encode64('a-e1f92c77-5bb0-4fb8-9bd8-9b61d014ab5f')}",
    "Content-Type"  => "application/json"
  }
)
Response
Name Description
success

A text confirming that the db plan switch has been initiated.

Name Description
error

A text description of the error.

No response body.

Description

Reset an access token related to the addon. Currently it is possible to reset:

  • api_token, which is used for this API
  • webhook_token, which is used to authenticate requests from Goaddon to your API
Request

Include the token_name you would like to reset, either as a parameter or as a JSON request body:

{
  "token_name": "webhook_token"
}
# For example purposes the token_name is included both as a parameter and inside the request body. Choose the option you prefer.
HTTParty.patch(
  "https://goaddon.com/api/v1/addons/5bf935bc3ab42fc4f4280d05/reset_token?token_name=webhook_token",
  headers: {
    "Authorization" => "Basic #{Base64.strict_encode64('a-e1f92c77-5bb0-4fb8-9bd8-9b61d014ab5f')}",
    "Content-Type"  => "application/json"
  },
  body: {token_name: "webhook_token"}.to_json
)
Response
Name Description
success

A text confirmation describing that the token was successfully reset.

new_token

The new token, which will take affect immediately.

Name Description
error

A text description of the error.

No response body.

api_references

You can define API references for projects to use.

Name Type Description

_id

BSON::ObjectId

title

String

Give the API reference a unique title, e.g. API or Management API.

intro

String

An introduction explaining the purpose of your API.

authentication

String

A description of how to authenticate yourself to get access to the API functionality.

resources

Array

We will use your resources specification to render an API reference similar to the one you are looking at right now.

[
  {
    "name": "projects",
    "description": "If you've signed up as a project you can manage some of settings through this API.",
    "endpoints": [
      {
        "method": "patch",
        "path": "/project_api/v1/projects/{{ project_id }}",
        "description": "Updates your `project`.",
        "request_examples": [ 
          {
              "title": "JSON body",
              "body": "Include any of the following keys:\n\n```json\n{\"foo\": \"bar\"}\n```"
          }
        ],
        "responses": [
          {
            "code": "200",
            "keys": [
              {
                "name": "success",
                "description": "A confirmation text."
              }
            ]
          }
        ]
      }
    ],
    "properties": [
      {
        "name": "foo",
        "type": "String",
        "description": "Some description"
      }
    ]
  }
]

Description

Get all api_references.

Request

Optionally you can paginate results by including any of the following params in your request string:

Name Description Default value Max. value
per_page The max. number of documents you want returned 100 500
page The page number, starts at 0 0 -
HTTParty.get(
  "https://goaddon.com/api/v1/api_references?per_page=100&page=0",
  headers: {
    "Authorization" => "Basic #{Base64.strict_encode64('a-e1f92c77-5bb0-4fb8-9bd8-9b61d014ab5f')}",
    "Content-Type"  => "application/json"
  }
)
Response
Name Description
documents

An array with the requested documents.

Name Description
error

A text description of the error.

No response body.

Description

Get specific API reference.

Request

No params required.

HTTParty.get(
  "https://goaddon.com/api/v1/api_references/5bf935bc3ab42fc4f4280d05",
  headers: {
    "Authorization" => "Basic #{Base64.strict_encode64('a-e1f92c77-5bb0-4fb8-9bd8-9b61d014ab5f')}",
    "Content-Type"  => "application/json"
  }
)
Response
Name Description
document

The requested document.

Name Description
error

A text description of the error.

No response body.

Description

Create an API reference.

Request

Include the following keys:

{
  "title": "API",
  "intro": "This API enables you to maintain your subscription programatically.",
  "authentication": "All requests must include a token...",
  "resources": [
    {
      "name": "projects",
      "description": "If you've signed up as a project you can manage some of settings through this API.",
      "endpoints": [
        {
          "method": "patch",
          "path": "/project_api/v1/projects/{{ project_id }}",
          "description": "Updates your `project`.",
          "request_examples": [
            {
                "title": "JSON body",
                "body": "Include any of the following keys:\n\n```json\n{\"foo\": \"bar\"}\n```"
            }
          ],
          "responses": [
            {
              "code": "200",
              "keys": [
                {
                  "name": "success",
                  "description": "A confirmation text."
                }
              ]
            }
          ]
        }
      ],
      "properties": [
        {
          "name": "foo",
          "type": "String",
          "description": "Some description"
        }
      ]
    }
  ]
}
HTTParty.post(
  "https://goaddon.com/api/v1/api_references",
  headers: {
    "Authorization" => "Basic #{Base64.strict_encode64('a-e1f92c77-5bb0-4fb8-9bd8-9b61d014ab5f')}",
    "Content-Type"  => "application/json"
  },
  body: body.to_json
)
Response
Name Description
success

A text confirmation that a document was successfully created.

_id

The _id of the created document.

Name Description
error

A text description of the error.

No response body.

Description

Update an API reference.

Request

Include any of the following keys in your JSON body:

{
  "title": "API",
  "intro": "This API enables you to maintain your subscription programatically.",
  "authentication": "All requests must include a token...",
  "resources": [
    {
      "name": "projects",
      "description": "If you've signed up as a project you can manage some of settings through this API.",
      "endpoints": [
        {
          "method": "patch",
          "path": "/project_api/v1/projects/{{ project_id }}",
          "description": "Updates your `project`.",
          "request_examples": [
            {
                "title": "JSON body",
                "body": "Include any of the following keys:\n\n```json\n{\"foo\": \"bar\"}\n```"
            }
          ],
          "responses": [
            {
              "code": "200",
              "keys": [
                {
                  "name": "success",
                  "description": "A confirmation text."
                }
              ]
            }
          ]
        }
      ],
      "properties": [
        {
          "name": "foo",
          "type": "String",
          "description": "Some description"
        }
      ]
    }
  ]
}
HTTParty.patch(
  "https://goaddon.com/api/v1/api_references/5bf935bc3ab42fc4f4280d05",
  headers: {
    "Authorization" => "Basic #{Base64.strict_encode64('a-e1f92c77-5bb0-4fb8-9bd8-9b61d014ab5f')}",
    "Content-Type"  => "application/json"
  },
  body: body.to_json
)
Response
Name Description
success

A text confirmation describing if the document was successfully updated.

message

A text confirmation describing if the document was recognized, but that there was no new data to update with.

Name Description
error

A text description of the error.

No response body.

Description

Destroy an API reference.

Request

No params required.

HTTParty.delete(
  "https://goaddon.com/api/v1/api_references/5bf935bc3ab42fc4f4280d05",
  headers: {
    "Authorization" => "Basic #{Base64.strict_encode64('a-e1f92c77-5bb0-4fb8-9bd8-9b61d014ab5f')}",
    "Content-Type"  => "application/json"
  }
)
Response
Name Description
message

A text confirmation that the document was destroyed.

Name Description
error

A text description of the error.

No response body.

Description

Replace all existing API reference with the ones you submit.

Request

Include an array of hashes like this:

{
  "api_references": [
    {}
  ]
}

Each hash should contain the following keys:

{
  "title": "API",
  "intro": "This API enables you to maintain your subscription programatically.",
  "authentication": "All requests must include a token...",
  "resources": [
    {
      "name": "projects",
      "description": "If you've signed up as a project you can manage some of settings through this API.",
      "endpoints": [
        {
          "method": "patch",
          "path": "/project_api/v1/projects/{{ project_id }}",
          "description": "Updates your `project`.",
          "request_examples": [
            {
                "title": "JSON body",
                "body": "Include any of the following keys:\n\n```json\n{\"foo\": \"bar\"}\n```"
            }
          ],
          "responses": [
            {
              "code": "200",
              "keys": [
                {
                  "name": "success",
                  "description": "A confirmation text."
                }
              ]
            }
          ]
        }
      ],
      "properties": [
        {
          "name": "foo",
          "type": "String",
          "description": "Some description"
        }
      ]
    }
  ]
}
HTTParty.post(
  "https://goaddon.com/api/v1/api_references/reset",
  headers: {
    "Authorization" => "Basic #{Base64.strict_encode64('a-e1f92c77-5bb0-4fb8-9bd8-9b61d014ab5f')}",
    "Content-Type"  => "application/json"
  },
  body: body.to_json
)
Response
Name Description
created

An integer of the number of documents that was created.

updated

An integer of the number of documents that was updated.

destroyed

An integer of the number of documents that was destroyed.

Name Description
error

A text description of the error.

No response body.

collections

As an addon your access to projects databases is limited. You only get access to the collections you have registered. As a project you have full access.

A collection has indexes, and when a project registers one we will create it in their MongoDB. Or if an addon registers one, we will create it for all the projects that are subscribed to the addon.

Name Type Description

_id

BSON::ObjectId

klass

String

The class of the collection, pluralized. E.g. companies, orders, products, etc.

_fields

Array

As an addon the attributes you register will be listed in a database overview that projects can review. If you as a project register the attributes you intend to use we will present you with the collections that overlaps with the addons you subscribe to.

[
  {
    "name": "foo",
    "type": "String",
    "description": "Contains the `foo` variable."
  }
]

indexes

Array

You may define as many indexes as you need.

An index consists of one or more keys, each either sorted ascending or descending.

Additionally in options you can define if the set of keys should be validated for uniqueness.

[
  {
    "key": {
      "foo": 1
    }
  },
  {
    "key": {
      "company_id": 1,
      "foo": 1
    },
    "options": {
      "unique": true,
      "sparse": true,
      "name": "company_foo"
    }
  }
]

Description

Get all collections.

Request

Optionally you can paginate results by including any of the following params in your request string:

Name Description Default value Max. value
per_page The max. number of documents you want returned 100 500
page The page number, starts at 0 0 -
HTTParty.get(
  "https://goaddon.com/api/v1/collections?per_page=100&page=0",
  headers: {
    "Authorization" => "Basic #{Base64.strict_encode64('a-e1f92c77-5bb0-4fb8-9bd8-9b61d014ab5f')}",
    "Content-Type"  => "application/json"
  }
)
Response
Name Description
documents

An array with the requested documents.

Name Description
error

A text description of the error.

No response body.

Description

Get specific collection.

Request

No params required.

HTTParty.get(
  "https://goaddon.com/api/v1/collections/5bf935bc3ab42fc4f4280d05",
  headers: {
    "Authorization" => "Basic #{Base64.strict_encode64('a-e1f92c77-5bb0-4fb8-9bd8-9b61d014ab5f')}",
    "Content-Type"  => "application/json"
  }
)
Response
Name Description
document

The requested document.

Name Description
error

A text description of the error.

No response body.

Description

Create a collection.

DANGER! Changing indexes will immediately trigger reindexing of all affected databases.

Request

Include the following keys:

{
  "klass": "companies",
  "description": "A `company` owns almost all other resources.",
  "_fields": [
    {
      "name": "_id",
      "type": "BSON::ObjectId",
      "description": ""
    },
    {
      "name": "website",
      "type": "String",
      "description": "The company website."
    },
    {
      "name": "email",
      "type": "String",
      "description": "The company email."
    }
  ],
  "indexes": [
    {
      "key": {
        "email": 1
      }
    },
    {
      "key": {
        "website": 1
      },
      "options": {
        "unique": true,
        "sparse": true
      }
    }
  ]
}
HTTParty.post(
  "https://goaddon.com/api/v1/collections",
  headers: {
    "Authorization" => "Basic #{Base64.strict_encode64('a-e1f92c77-5bb0-4fb8-9bd8-9b61d014ab5f')}",
    "Content-Type"  => "application/json"
  },
  body: body.to_json
)
Response
Name Description
success

A text confirmation that a document was successfully created.

_id

The _id of the created document.

Name Description
error

A text description of the error.

No response body.

Description

Update a collection.

DANGER! Changing indexes will immediately trigger reindexing of all affected databases.

Request

Include any of the following keys in your JSON body:

{
  "klass": "companies",
  "description": "A `company` owns almost all other resources.",
  "_fields": [
    {
      "name": "_id",
      "type": "BSON::ObjectId",
      "description": ""
    },
    {
      "name": "website",
      "type": "String",
      "description": "The company website."
    },
    {
      "name": "email",
      "type": "String",
      "description": "The company email."
    }
  ],
  "indexes": [
    {
      "key": {
        "email": 1
      }
    },
    {
      "key": {
        "website": 1
      },
      "options": {
        "unique": true,
        "sparse": true
      }
    }
  ]
}
HTTParty.patch(
  "https://goaddon.com/api/v1/collections/5bf935bc3ab42fc4f4280d05",
  headers: {
    "Authorization" => "Basic #{Base64.strict_encode64('a-e1f92c77-5bb0-4fb8-9bd8-9b61d014ab5f')}",
    "Content-Type"  => "application/json"
  },
  body: body.to_json
)
Response
Name Description
success

A text confirmation describing if the document was successfully updated.

message

A text confirmation describing if the document was recognized, but that there was no new data to update with.

Name Description
error

A text description of the error.

No response body.

Description

Destroy a collection.

DANGER! Changing indexes will immediately trigger reindexing of all affected databases.

Request

No params required.

HTTParty.delete(
  "https://goaddon.com/api/v1/collections/5bf935bc3ab42fc4f4280d05",
  headers: {
    "Authorization" => "Basic #{Base64.strict_encode64('a-e1f92c77-5bb0-4fb8-9bd8-9b61d014ab5f')}",
    "Content-Type"  => "application/json"
  }
)
Response
Name Description
message

A text confirmation that the document was destroyed.

Name Description
error

A text description of the error.

No response body.

Description

Replace all existing collections with the ones you submit.

DANGER! Changing indexes will immediately trigger reindexing of all affected databases.

Request

Include an array of hashes like this:

{
  "collections": [
    {}
  ]
}

Each hash should contain the following keys:

{
  "klass": "companies",
  "description": "A `company` owns almost all other resources.",
  "_fields": [
    {
      "name": "_id",
      "type": "BSON::ObjectId",
      "description": ""
    },
    {
      "name": "website",
      "type": "String",
      "description": "The company website."
    },
    {
      "name": "email",
      "type": "String",
      "description": "The company email."
    }
  ],
  "indexes": [
    {
      "key": {
        "email": 1
      }
    },
    {
      "key": {
        "website": 1
      },
      "options": {
        "unique": true,
        "sparse": true
      }
    }
  ]
}
HTTParty.post(
  "https://goaddon.com/api/v1/collections/reset",
  headers: {
    "Authorization" => "Basic #{Base64.strict_encode64('a-e1f92c77-5bb0-4fb8-9bd8-9b61d014ab5f')}",
    "Content-Type"  => "application/json"
  },
  body: body.to_json
)
Response
Name Description
created

An integer of the number of documents that was created.

updated

An integer of the number of documents that was updated.

destroyed

An integer of the number of documents that was destroyed.

Name Description
error

A text description of the error.

No response body.

db_users

In order to access your database you need to create database users.

Name Type Description

_id

BSON::ObjectId

username

String

The username of the database user. E.g. myuser.

password

String

The password of the database user. E.g. 123456789.

roles

Array

The roles of the database user. E.g. ['readWrite'].

Description

Get all database users.

Request

Optionally you can paginate results by including any of the following params in your request string:

Name Description Default value Max. value
per_page The max. number of documents you want returned 100 500
page The page number, starts at 0 0 -
HTTParty.get(
  "https://goaddon.com/api/v1/db_users?per_page=100&page=0",
  headers: {
    "Authorization" => "Basic #{Base64.strict_encode64('a-e1f92c77-5bb0-4fb8-9bd8-9b61d014ab5f')}",
    "Content-Type"  => "application/json"
  }
)
Response
Name Description
documents

An array with the requested documents.

Name Description
error

A text description of the error.

No response body.

Description

Get specific database user.

Request

No params required.

HTTParty.get(
  "https://goaddon.com/api/v1/db_users/5bf935bc3ab42fc4f4280d05",
  headers: {
    "Authorization" => "Basic #{Base64.strict_encode64('a-e1f92c77-5bb0-4fb8-9bd8-9b61d014ab5f')}",
    "Content-Type"  => "application/json"
  }
)
Response
Name Description
document

The requested document.

Name Description
error

A text description of the error.

No response body.

Description

Create a database user.

Request

Include the following keys:

{
  "username": "my_user",
  "password": "123456789",
  "roles": [
    "readWrite"
  ]
}
HTTParty.post(
  "https://goaddon.com/api/v1/db_users",
  headers: {
    "Authorization" => "Basic #{Base64.strict_encode64('a-e1f92c77-5bb0-4fb8-9bd8-9b61d014ab5f')}",
    "Content-Type"  => "application/json"
  },
  body: body.to_json
)
Response
Name Description
success

A text confirmation that a document was successfully created.

_id

The _id of the created document.

Name Description
error

A text description of the error.

No response body.

Description

Update a database user.

Request

Include any of the following keys in your JSON body:

{
  "username": "my_user",
  "password": "123456789",
  "roles": [
    "readWrite"
  ]
}
HTTParty.patch(
  "https://goaddon.com/api/v1/db_users/5bf935bc3ab42fc4f4280d05",
  headers: {
    "Authorization" => "Basic #{Base64.strict_encode64('a-e1f92c77-5bb0-4fb8-9bd8-9b61d014ab5f')}",
    "Content-Type"  => "application/json"
  },
  body: body.to_json
)
Response
Name Description
success

A text confirmation describing if the document was successfully updated.

message

A text confirmation describing if the document was recognized, but that there was no new data to update with.

Name Description
error

A text description of the error.

No response body.

Description

Destroy a database user.

Request

No params required.

HTTParty.delete(
  "https://goaddon.com/api/v1/db_users/5bf935bc3ab42fc4f4280d05",
  headers: {
    "Authorization" => "Basic #{Base64.strict_encode64('a-e1f92c77-5bb0-4fb8-9bd8-9b61d014ab5f')}",
    "Content-Type"  => "application/json"
  }
)
Response
Name Description
message

A text confirmation that the document was destroyed.

Name Description
error

A text description of the error.

No response body.

pages

When a project subscribes to an addon it can manage its subscription through custom pages set up by the addon.

Name Type Description

_id

BSON::ObjectId

name

String

Page names are used for navigation purpose, and needs to be unique.

If you want to link to a page named my_page, it can be done like this: <a href=#page=my_page>My page</a>.

You are required to have a page named root. All other pages will be rendered inside the root page where ever you insert the tag {% yield %}.

Additionally you are required to have a page named frontpage.

All other pages should have names that captures their purpose.

If the page should not be listed in the menu, but is instead a sub page of another, you should name it like this: parent_page__sub_page.

webhook_http_method

String

webhook_path

String

You may want to provide project specific variables before the page is displayed.

Therefore you can specify an API path for us to request, as well as the preferred request method (GET or POST).

Respond to our API request with a JSON hash and your page will have access to it through the variable remote_data.

You can reference variables like e.g. Hello {{ remote_data.project_name | capitalize }}.

If you specify an API path and request method for your root page, we will use them as default for all pages that haven't been assigned any.

html

String

Write instructions for a project to follow and forms to fill out.

locales

Hash

You can keep your HTML code clean by putting all text content into the locale hash. You are not obligated to do so, and currently only English is supported, but if you use locales from the beginning you will be prepared to support multiple languages if it becomes relevant later on.

You can insert text from your locales by referencing it like e.g. {{ l.foo.bar }}.

{
  "en": {
    "headline": "My Page",
    "greeting": "Welcome to my page."
  }
}

menu_locales

Hash

Your pages will be accessible to projects through the left hand menu.

You can specify the menu title for a page, localized in different languages. Currently the only supported language is English.

{
  "en": "My page"
}

Description

Get all pages.

Request

Optionally you can paginate results by including any of the following params in your request string:

Name Description Default value Max. value
per_page The max. number of documents you want returned 100 500
page The page number, starts at 0 0 -
HTTParty.get(
  "https://goaddon.com/api/v1/pages?per_page=100&page=0",
  headers: {
    "Authorization" => "Basic #{Base64.strict_encode64('a-e1f92c77-5bb0-4fb8-9bd8-9b61d014ab5f')}",
    "Content-Type"  => "application/json"
  }
)
Response
Name Description
documents

An array with the requested documents.

Name Description
error

A text description of the error.

No response body.

Description

Get specific page.

Request

No params required.

HTTParty.get(
  "https://goaddon.com/api/v1/pages/5bf935bc3ab42fc4f4280d05",
  headers: {
    "Authorization" => "Basic #{Base64.strict_encode64('a-e1f92c77-5bb0-4fb8-9bd8-9b61d014ab5f')}",
    "Content-Type"  => "application/json"
  }
)
Response
Name Description
document

The requested document.

Name Description
error

A text description of the error.

No response body.

Description

Create a page.

Request

Include the following keys:

{
  "name": "frontpage",
  "html": "{% include 'greeting' %}\n\n{% if remote_data.provisioned == true %} {{ l.all_is_good }} {% else %} {{ l.please_wait }} {% endif %} ",
  "locales": {
    "en": {
      "all_is_good": "All is good.",
      "please_wait": "Please wait while your informations are being evaluated."
    }
  },
  "menu_locales": {
    "en": "Frontpage"
  }
}
HTTParty.post(
  "https://goaddon.com/api/v1/pages",
  headers: {
    "Authorization" => "Basic #{Base64.strict_encode64('a-e1f92c77-5bb0-4fb8-9bd8-9b61d014ab5f')}",
    "Content-Type"  => "application/json"
  },
  body: body.to_json
)
Response
Name Description
success

A text confirmation that a document was successfully created.

_id

The _id of the created document.

Name Description
error

A text description of the error.

No response body.

Description

Update a page.

Request

Include any of the following keys in your JSON body:

{
  "name": "frontpage",
  "html": "{% include 'greeting' %}\n\n{% if remote_data.provisioned == true %} {{ l.all_is_good }} {% else %} {{ l.please_wait }} {% endif %} ",
  "locales": {
    "en": {
      "all_is_good": "All is good.",
      "please_wait": "Please wait while your informations are being evaluated."
    }
  },
  "menu_locales": {
    "en": "Frontpage"
  }
}
HTTParty.patch(
  "https://goaddon.com/api/v1/pages/5bf935bc3ab42fc4f4280d05",
  headers: {
    "Authorization" => "Basic #{Base64.strict_encode64('a-e1f92c77-5bb0-4fb8-9bd8-9b61d014ab5f')}",
    "Content-Type"  => "application/json"
  },
  body: body.to_json
)
Response
Name Description
success

A text confirmation describing if the document was successfully updated.

message

A text confirmation describing if the document was recognized, but that there was no new data to update with.

Name Description
error

A text description of the error.

No response body.

Description

Destroy a page.

Request

No params required.

HTTParty.delete(
  "https://goaddon.com/api/v1/pages/5bf935bc3ab42fc4f4280d05",
  headers: {
    "Authorization" => "Basic #{Base64.strict_encode64('a-e1f92c77-5bb0-4fb8-9bd8-9b61d014ab5f')}",
    "Content-Type"  => "application/json"
  }
)
Response
Name Description
message

A text confirmation that the document was destroyed.

Name Description
error

A text description of the error.

No response body.

Description

Replace all existing pages with the ones you submit.

Request

Include an array of hashes like this:

{
  "pages": [
    {}
  ]
}

Each hash should contain the following keys:

{
  "name": "frontpage",
  "html": "{% include 'greeting' %}\n\n{% if remote_data.provisioned == true %} {{ l.all_is_good }} {% else %} {{ l.please_wait }} {% endif %} ",
  "locales": {
    "en": {
      "all_is_good": "All is good.",
      "please_wait": "Please wait while your informations are being evaluated."
    }
  },
  "menu_locales": {
    "en": "Frontpage"
  }
}
HTTParty.post(
  "https://goaddon.com/api/v1/pages/reset",
  headers: {
    "Authorization" => "Basic #{Base64.strict_encode64('a-e1f92c77-5bb0-4fb8-9bd8-9b61d014ab5f')}",
    "Content-Type"  => "application/json"
  },
  body: body.to_json
)
Response
Name Description
created

An integer of the number of documents that was created.

updated

An integer of the number of documents that was updated.

destroyed

An integer of the number of documents that was destroyed.

Name Description
error

A text description of the error.

No response body.

projects

You can get an overview of subscribed projects. This is usefull if you want to regularly verify the data provided through our webhooks.

Name Type Description

_id

BSON::ObjectId

name

String

The name of the project or company, e.g. Some company.

db_plan

Hash

The projects chosen database configuration, e.g. {'hcloud_fsn1__cx11': 3}

db_hosts

The host URL's of the database. This is neccesary knowledge when connecting to the projects Goaddon database, e.g. ['5bf935bc3ab42fc4f4280d05-0.mongodb.goaddon.com', '5bf935bc3ab42fc4f4280d05-1.mongodb.goaddon.com'].

db_name

String

The name of the projects Goaddon database.

encryption_key

String

The key that is used to encrypt and decrypt data from the database, e.g. 49b97a6f8362315d27921d6c4db71ef5e4798c24ea0d62b367f3ee5d1bd96f8b.

encryption_iv

String

The IV that is used to encrypt and decrypt data from the database, e.g. 51cd115466d508d77da8996f45f374e4.

db_username

String

Username that should be used to access the projects Goaddon database, e.g. 2686b0c4dda20513e8cf39c0ff32d717b2bc2d653cb3a281fa2523161e25.

db_password

String

Password that should be used to access the projects Goaddon database, e.g. 870185b3e49bdd3cf899452dc6fb78174b41106f4c5bf91deee9b37540ac.

subscription_id

BSON::ObjectId

The _id of the projects subscription to your addon.

zone

String

The zone in which the project was created. This determines in which datacenter the database of the project is.

Description

Get projects.

Request

Optionally you can paginate results by including any of the following params in your request string:

Name Description Default value Max. value
per_page The max. number of documents you want returned 100 500
page The page number, starts at 0 0 -
HTTParty.get(
  "https://goaddon.com/api/v1/projects?per_page=100&page=0",
  headers: {
    "Authorization" => "Basic #{Base64.strict_encode64('a-e1f92c77-5bb0-4fb8-9bd8-9b61d014ab5f')}",
    "Content-Type"  => "application/json"
  }
)
Response
Name Description
documents

An array with the requested documents.

Name Description
error

A text description of the error.

No response body.

Description

Get specific project.

Request

No params required.

HTTParty.get(
  "https://goaddon.com/api/v1/projects/5bf935bc3ab42fc4f4280d05",
  headers: {
    "Authorization" => "Basic #{Base64.strict_encode64('a-e1f92c77-5bb0-4fb8-9bd8-9b61d014ab5f')}",
    "Content-Type"  => "application/json"
  }
)
Response
Name Description
document

The requested document.

Name Description
error

A text description of the error.

No response body.

Description

Forward data to another addon that the project is subscribed to.

Request

Include the addon_id of the addon that should receive the data, either as a parameter or in the JSON request body:

{
  "addon_id": "5cd3febe3ab42f7177438894",
  "forward": {
    "foo": "bar"
    }
}
HTTParty.patch(
  "https://goaddon.com/api/v1/projects/5bf935bc3ab42fc4f4280d05/forward_to_addon",
  headers: {
    "Authorization" => "Basic #{Base64.strict_encode64('a-e1f92c77-5bb0-4fb8-9bd8-9b61d014ab5f')}",
    "Content-Type"  => "application/json"
  },
  body: {
    addon_id: "5cd3febe3ab42f7177438894",
    forward: {
        foo: "bar"
    }
  }.to_json
)
Response
Name Description
success

A text confirming that the data was forwarded to the addon.

Name Description
error

A text description of the error.

No response body.

shortcuts

A shortcut is a single page that lets a project subscribe to your addon with a pre-defined configuration. You can invite other addons to participate in the shortcut, though not through the API.

Name Type Description

_id

BSON::ObjectId

name

String

Give the shortcut a unique internal name.

explainer

String

A secondary headline for the public shortcut listing, e.g. This shortcut does cool stuff..

description

String

The primary description of the shortcut. You are free to style it with markdown.

video_url

String

A link to a Youtube video explaining the shortcut, if such a via exists. E.g. https://www.youtube.com/embed/example.

html

String

Write instructions for a project to follow and forms to fill out.

<h1>{{ l.headline }}</h1>\n<p>{{ l.greeting }}</p>

locales

Hash

You can keep your HTML code clean by putting all text content into the locale hash. You are not obligated to do so, and currently only English is supported, but if you use locales from the beginning you will be prepared to support multiple languages if it becomes relevant later on.

You can insert text from your locales by referencing it like e.g. {{ l.foo.bar }}.

{
    "en": {
        "headline": "My Shortcut",
        "greeting": "Welcome to my shortcut."
    }
}

webhooks

Array

An array of webhooks that you need triggered before loading the shortcut.

[
  {
    "addon_id": "5f7958473ab42f4c16fc41bb",
    "http_method": "post",
    "path": "/{{ locale }}/goa_api/shortcuts/{{ shortcut }}",
    "form_webhook_path": "/{{ locale }}"
  }
]

scripts

Array

If your shortcut require any external stripts to load, you can provide an array of script URL's for us to load. JQuery 3.3.1, Popper 1.14.7 and Bootstrap 4.3.1 is already loaded. E.g. ['https://cdn.example.com.min.js'].

styles

Array

If your shortcut require any external stylesheets to load, you can provide an array of stylesheet URL's for us to load. Bootstrap 4.3.1 and FontAwesome 5.4.2 are already loaded. E.g. ['https://cdn.example.com.min.css'].

Description

Get all shortcuts.

Request

Optionally you can paginate results by including any of the following params in your request string:

Name Description Default value Max. value
per_page The max. number of documents you want returned 100 500
page The page number, starts at 0 0 -
HTTParty.get(
  "https://goaddon.com/api/v1/shortcuts?per_page=100&page=0",
  headers: {
    "Authorization" => "Basic #{Base64.strict_encode64('a-e1f92c77-5bb0-4fb8-9bd8-9b61d014ab5f')}",
    "Content-Type"  => "application/json"
  }
)
Response
Name Description
documents

An array with the requested documents.

Name Description
error

A text description of the error.

No response body.

Description

Get specific shortcut.

Request

No params required.

HTTParty.get(
  "https://goaddon.com/api/v1/shortcuts/5bf935bc3ab42fc4f4280d05",
  headers: {
    "Authorization" => "Basic #{Base64.strict_encode64('a-e1f92c77-5bb0-4fb8-9bd8-9b61d014ab5f')}",
    "Content-Type"  => "application/json"
  }
)
Response
Name Description
document

The requested document.

Name Description
error

A text description of the error.

No response body.

Description

Create a shortcut.

Request

Include the following keys:

{
  "name": "greeting",
  "explainer": "This shortcut does cool stuff.",
  "description": "**Cool** things will happen",
  "html": "<h1>{{ l.hello }}</h1>",
  "video_url": "https://www.youtube.com/embed/example",
  "locales": {
    "en": {
      "hello_world": "Hello!"
    }
  },
  "scripts": [
    "https://cdn.example.com.min.js"
  ],
  "styles": [
    "https://cdn.example.com.min.css"
  ],
  "webhooks": [
    {
      "addon_id": "5f7958473ab42f4c16fc41bb",
      "http_method": "post",
      "path": "/{{ locale }}/goa_api/shortcuts/{{ shortcut }}",
      "form_webhook_path": "/{{ locale }}"
    }
  ]
}
HTTParty.post(
  "https://goaddon.com/api/v1/shortcuts",
  headers: {
    "Authorization" => "Basic #{Base64.strict_encode64('a-e1f92c77-5bb0-4fb8-9bd8-9b61d014ab5f')}",
    "Content-Type"  => "application/json"
  },
  body: body.to_json
)
Response
Name Description
success

A text confirmation that a document was successfully created.

_id

The _id of the created document.

Name Description
error

A text description of the error.

No response body.

Description

Update a shortcut.

Request

Include any of the following keys in your JSON body:

{
  "name": "greeting",
  "explainer": "This shortcut does cool stuff.",
  "description": "**Cool** things will happen",
  "html": "<h1>{{ l.hello }}</h1>",
  "video_url": "https://www.youtube.com/embed/example",
  "locales": {
    "en": {
      "hello_world": "Hello!"
    }
  },
  "scripts": [
    "https://cdn.example.com.min.js"
  ],
  "styles": [
    "https://cdn.example.com.min.css"
  ],
  "webhooks": [
    {
      "addon_id": "5f7958473ab42f4c16fc41bb",
      "http_method": "post",
      "path": "/{{ locale }}/goa_api/shortcuts/{{ shortcut }}",
      "form_webhook_path": "/{{ locale }}"
    }
  ]
}
HTTParty.patch(
  "https://goaddon.com/api/v1/shortcuts/5bf935bc3ab42fc4f4280d05",
  headers: {
    "Authorization" => "Basic #{Base64.strict_encode64('a-e1f92c77-5bb0-4fb8-9bd8-9b61d014ab5f')}",
    "Content-Type"  => "application/json"
  },
  body: body.to_json
)
Response
Name Description
success

A text confirmation describing if the document was successfully updated.

message

A text confirmation describing if the document was recognized, but that there was no new data to update with.

Name Description
error

A text description of the error.

No response body.

Description

Destroy a shortcut.

Request

No params required.

HTTParty.delete(
  "https://goaddon.com/api/v1/shortcuts/5bf935bc3ab42fc4f4280d05",
  headers: {
    "Authorization" => "Basic #{Base64.strict_encode64('a-e1f92c77-5bb0-4fb8-9bd8-9b61d014ab5f')}",
    "Content-Type"  => "application/json"
  }
)
Response
Name Description
message

A text confirmation that the document was destroyed.

Name Description
error

A text description of the error.

No response body.

Description

Invite an addon to the shortcut.

Request

Include an _id of the addon you would like to invite to participate in the shortcut, either as a parameter or as a JSON request body:

{
  "_id": "5f74828983c336ba6ce436a1"
}
HTTParty.patch(
  "https://goaddon.com/api/v1/shortcuts/5bf935bc3ab42fc4f4280d05/invite_addon?addon_id=5f74828983c336ba6ce436a1",
  headers: {
    "Authorization" => "Basic #{Base64.strict_encode64('a-e1f92c77-5bb0-4fb8-9bd8-9b61d014ab5f')}",
    "Content-Type"  => "application/json"
  },
  body: {addon_id: "5f74828983c336ba6ce436a1"}.to_json
)
Response
Name Description
success

A text confirming that the addon was invited.

addon_name

The name of the invited addon.

Name Description
error

A text description of the error.

No response body.

Description

Remove an addon from the shortcut.

Request

Include an _id of the addon you would like to remove from the shortcut, either as a parameter or as a JSON request body:

{
  "_id": "5f74828983c336ba6ce436a1"
}
HTTParty.patch(
  "https://goaddon.com/api/v1/shortcuts/5bf935bc3ab42fc4f4280d05/remove_addon?addon_id=5f74828983c336ba6ce436a1",
  headers: {
    "Authorization" => "Basic #{Base64.strict_encode64('a-e1f92c77-5bb0-4fb8-9bd8-9b61d014ab5f')}",
    "Content-Type"  => "application/json"
  },
  body: {addon_id: "5f74828983c336ba6ce436a1"}.to_json
)
Response
Name Description
message

A text confirming that the addon was removed.

addon_name

The name of the removed addon.

Name Description
error

A text description of the error.

No response body.

Description

Accept an invitation to participate in the shortcut.

Request

No params required.

HTTParty.patch(
  "https://goaddon.com/api/v1/shortcuts/5bf935bc3ab42fc4f4280d05/accept_invite",
  headers: {
    "Authorization" => "Basic #{Base64.strict_encode64('a-e1f92c77-5bb0-4fb8-9bd8-9b61d014ab5f')}",
    "Content-Type"  => "application/json"
  }
)
Response
Name Description
success

A text confirming that you have accepted the invitation.

shortcut_name

The name of the shortcut.

Name Description
error

A text description of the error.

No response body.

snippets

Snippets can be included in pages. Insert a snippet by using the tag {% include 'snippet_name' %}.

Name Type Description

_id

BSON::ObjectId

name

String

Give the snippet a unique name that can be referenced by pages or other snippets, e.g. my_snippet.

html

String

Write instructions for a project to follow and forms to fill out.

<h1>{{ l.headline }}</h1>\n<p>{{ l.greeting }}</p>

locales

Hash

You can keep your HTML code clean by putting all text content into the locale hash. You are not obligated to do so, and currently only English is supported, but if you use locales from the beginning you will be prepared to support multiple languages if it becomes relevant later on.

You can insert text from your locales by referencing it like e.g. {{ l.foo.bar }}.

{
    "en": {
        "headline": "My Snippet",
        "greeting": "Welcome to my snippet."
    }
}

Description

Get all snippets.

Request

Optionally you can paginate results by including any of the following params in your request string:

Name Description Default value Max. value
per_page The max. number of documents you want returned 100 500
page The page number, starts at 0 0 -
HTTParty.get(
  "https://goaddon.com/api/v1/snippets?per_page=100&page=0",
  headers: {
    "Authorization" => "Basic #{Base64.strict_encode64('a-e1f92c77-5bb0-4fb8-9bd8-9b61d014ab5f')}",
    "Content-Type"  => "application/json"
  }
)
Response
Name Description
documents

An array with the requested documents.

Name Description
error

A text description of the error.

No response body.

Description

Get specific snippet.

Request

No params required.

HTTParty.get(
  "https://goaddon.com/api/v1/snippets/5bf935bc3ab42fc4f4280d05",
  headers: {
    "Authorization" => "Basic #{Base64.strict_encode64('a-e1f92c77-5bb0-4fb8-9bd8-9b61d014ab5f')}",
    "Content-Type"  => "application/json"
  }
)
Response
Name Description
document

The requested document.

Name Description
error

A text description of the error.

No response body.

Description

Create a snippet.

Request

Include the following keys:

{
  "name": "greeting",
  "html": "<h1>{{ l.hello }}</h1>",
  "locales": {
    "en": {
      "hello_world": "Hello!"
    }
  }
}
HTTParty.post(
  "https://goaddon.com/api/v1/snippets",
  headers: {
    "Authorization" => "Basic #{Base64.strict_encode64('a-e1f92c77-5bb0-4fb8-9bd8-9b61d014ab5f')}",
    "Content-Type"  => "application/json"
  },
  body: body.to_json
)
Response
Name Description
success

A text confirmation that a document was successfully created.

_id

The _id of the created document.

Name Description
error

A text description of the error.

No response body.

Description

Update a snippet.

Request

Include any of the following keys in your JSON body:

{
  "name": "greeting",
  "html": "<h1>{{ l.hello }}</h1>",
  "locales": {
    "en": {
      "hello_world": "Hello!"
    }
  }
}
HTTParty.patch(
  "https://goaddon.com/api/v1/snippets/5bf935bc3ab42fc4f4280d05",
  headers: {
    "Authorization" => "Basic #{Base64.strict_encode64('a-e1f92c77-5bb0-4fb8-9bd8-9b61d014ab5f')}",
    "Content-Type"  => "application/json"
  },
  body: body.to_json
)
Response
Name Description
success

A text confirmation describing if the document was successfully updated.

message

A text confirmation describing if the document was recognized, but that there was no new data to update with.

Name Description
error

A text description of the error.

No response body.

Description

Destroy a snippet.

Request

No params required.

HTTParty.delete(
  "https://goaddon.com/api/v1/snippets/5bf935bc3ab42fc4f4280d05",
  headers: {
    "Authorization" => "Basic #{Base64.strict_encode64('a-e1f92c77-5bb0-4fb8-9bd8-9b61d014ab5f')}",
    "Content-Type"  => "application/json"
  }
)
Response
Name Description
message

A text confirmation that the document was destroyed.

Name Description
error

A text description of the error.

No response body.

Description

Replace all existing snippets with the ones you submit.

Request

Include an array of hashes like this:

{
  "snippets": [
    {}
  ]
}

Each hash should contain the following keys:

{
  "name": "greeting",
  "html": "<h1>{{ l.hello }}</h1>",
  "locales": {
    "en": {
      "hello_world": "Hello!"
    }
  }
}
HTTParty.post(
  "https://goaddon.com/api/v1/snippets/reset",
  headers: {
    "Authorization" => "Basic #{Base64.strict_encode64('a-e1f92c77-5bb0-4fb8-9bd8-9b61d014ab5f')}",
    "Content-Type"  => "application/json"
  },
  body: body.to_json
)
Response
Name Description
created

An integer of the number of documents that was created.

updated

An integer of the number of documents that was updated.

destroyed

An integer of the number of documents that was destroyed.

Name Description
error

A text description of the error.

No response body.

tallies

Submit tallies of your subscribers.

Name Type Description

_id

BSON::ObjectId

project_id

BSON::ObjectId

The identifier of the project you want to submit a tally for. E.g. 5decf4023ab42f222c4db172.

remote_id

String

A unique identifier for the tally, chosen by you. E.g. foo.

opened_at

Time

The time where you opened the tally. E.g. 2019-12-07 10:00:00 +0100.

closed_at

Time

The time where you closed the tally. This is defined by you, and not necessarily the same time as you create the tally. E.g. 2019-12-07 20:00:00 +0100.

headline

String

A headline that explains the nature of the expenses in the tally. E.g. Hosting of your database

description

String

A description that further explains the nature of the expenses in the tally. E.g. 40 GB disk space for your database.

details

Array

An array of hashes that specifies details of the tally. These will be transformed into a table. Your table can have op to 8 columns. col1, col2, col3, etc. The column can have markup.

[
  {
    "col1": "**Disk usage:**",
    "col2": "10.0 EUR"
  }
]

amount

Float

The total amount to be added on the next invoice issues for the subscriber. E.g. 10.00.

Description

Get all tallies.

Request

Optionally you can paginate results by including any of the following params in your request string:

Name Description Default value Max. value
per_page The max. number of documents you want returned 100 500
page The page number, starts at 0 0 -
HTTParty.get(
  "https://goaddon.com/api/v1/tallies?per_page=100&page=0",
  headers: {
    "Authorization" => "Basic #{Base64.strict_encode64('a-e1f92c77-5bb0-4fb8-9bd8-9b61d014ab5f')}",
    "Content-Type"  => "application/json"
  }
)
Response
Name Description
documents

An array with the requested documents.

Name Description
error

A text description of the error.

No response body.

Description

Get specific tally.

Request

No params required.

HTTParty.get(
  "https://goaddon.com/api/v1/tallies/5bf935bc3ab42fc4f4280d05",
  headers: {
    "Authorization" => "Basic #{Base64.strict_encode64('a-e1f92c77-5bb0-4fb8-9bd8-9b61d014ab5f')}",
    "Content-Type"  => "application/json"
  }
)
Response
Name Description
document

The requested document.

Name Description
error

A text description of the error.

No response body.

Description

Create a tally.

Request

Include the following keys:

{
  "project_id": "5decf4023ab42f222c4db172",
  "remote_id": "12345678",
  "headline": "Hosting of your database",
  "description": "40GB disk space for your database.",
  "opened_at": "2019-12-07 10:00:00 +0100",
  "closed_at": "2019-12-07 20:00:00 +0100",
  "amount": 10.0,
  "details": [
    {
      "col1": "**Disk usage:**",
      "col2": "10.0 EUR"
    }
  ]
}
HTTParty.post(
  "https://goaddon.com/api/v1/tallies",
  headers: {
    "Authorization" => "Basic #{Base64.strict_encode64('a-e1f92c77-5bb0-4fb8-9bd8-9b61d014ab5f')}",
    "Content-Type"  => "application/json"
  },
  body: body.to_json
)
Response
Name Description
success

A text confirmation that a document was successfully created.

_id

The _id of the created document.

Name Description
error

A text description of the error.

No response body.