Onea Mobile App API

Base URL: /v2, Version: 2017.40

This document describes the public endpoints exposed by the Onea Mobile App API. The default host implementing this API can be found at https://app-api.onea.be.

Schemes: https

Summary

Tag: authentication

User authentication

Operation Description
POST /v2/auth/login

Login a user into a given environment

POST /v2/auth/logout

Log out a logged in user and invalidate an access token

POST /v2/auth/register

Registers a new user

POST /v2/auth/connect/{companyInviteKey}

Connects an authenticated user to a company

Tag: maintenance

API maintenance information

Operation Description
GET /v2/maintenance/message

Get the current active maintenance message.

Tag: companies

Control and manage information about companies

Operation Description
GET /v2/companies

Get all public company data for companies that match given criteria

GET /v2/me/companies

Get a list of all companies the user has access to

POST /v2/me/companies/{companyId}

Update an existing company

GET /v2/me/companies/{companyId}/suppliers

Get a list of all the suppliers for a given company.

POST /v2/me/companies/{companyId}/upload-image

Upload a new image to the given company

Tag: invoices

Control and manage information about invoices

Operation Description
GET /v2/me/companies/{companyId}/invoices/incoming/{invoiceId}/attachments/{attachmentId}/download

Download a PDF attachment for a given invoice

GET /v2/me/companies/{companyId}/invoices/incoming/{invoiceId}/validating/resync

Resync all validating incoming invoices

Paths

Connects an authenticated user to a company

POST /v2/auth/connect/{companyInviteKey}

Tags: authentication

Users with a valid access token can be given access to a company by connecting to the company using a unique company invite key. An invite key gives access to one company only and can be used by multiple users, but can expire due to a manual action or after a certain time period has been reached.

X-Onea-Auth-Token

A valid access token

header string
companyInviteKey

A valid unique invite key

path string

application/json

200 OK

The user was succesfully connected to the company.

Login a user into a given environment

POST /v2/auth/login

Tags: authentication

application/json

The body should contain a JSON object which specifies the environment against which the user should be authenticated, the username of the user and the password of the user.

environment: string
username: string
password: string

application/json

200 OK

The user was successfully logged in. The response contains an access token which can be used for authorization in further requests.

token: string
Log out a logged in user and invalidate an access token

POST /v2/auth/logout

Tags: authentication

application/json

The body should contain a valid access token of a logged in user

token: string
200 OK

The user was successfully logged out and the given access token has been invalidated.

Registers a new user

POST /v2/auth/register

Tags: authentication

application/json

JSON object containing the username, password and email for the new user

username: string
password: string
email: string
200 OK

The user was successfully registered and can now log in.

Get all public company data for companies that match given criteria

GET /v2/companies

Tags: companies
vatNumber

VAT number of the company

query object

application/json

200 OK

Returns a list of public company data for all companies that match the given criteria.

Get the current active maintenance message.

GET /v2/maintenance/message

Tags: maintenance

Whenever the users need to be warned about maintenance on the applicaiton (i.e. possible downtime), the maintenance message will be set and can be retrieved via this endpoint.

application/json

200 OK

Operation success. The body contains a JSON object with the current active maintenance message. In case no maintenance message is currently set, the value of the message property is null.

message: string
Get a list of all companies the user has access to

GET /v2/me/companies

Tags: companies
X-Onea-Auth-Token

A valid access token

header string

application/json

200 OK

Returns a list of all companies the user with the given access token has access to.

Update an existing company

POST /v2/me/companies/{companyId}

Tags: companies

application/json

X-Onea-Auth-Token

A valid access token

header string
companyId

Id of an existing company

path string

application/json

200 OK

The company was succesfully updated.

Download a PDF attachment for a given invoice

GET /v2/me/companies/{companyId}/invoices/incoming/{invoiceId}/attachments/{attachmentId}/download

Tags: invoices

Allows you to download the PDF attachment for a given invoice. Note that this method requires a valid access token in order to download the file which can be set via the X-Onea-Auth-Token header. Alternatively, in cases where headers can not be set (e.g. HTML <a> tags), you can also specify the token via the query parameter token.

X-Onea-Auth-Token

A valid access token

header string
token

A valid access token

query string
companyId

Id of an existing company

path string
invoiceId

Id of an existing invoice

path string
attachmentId

Id of an existing attachment

path integer

application/pdf

200 OK

Download was successful. The response body contains the raw binary data of the requested PDF file.

Resync all validating incoming invoices

GET /v2/me/companies/{companyId}/invoices/incoming/{invoiceId}/validating/resync

Tags: invoices

Forces a resync with the source environment of all incoming invoices with the status VALIDATING of the company with the given companyId.

X-Onea-Auth-Token

A valid access token

header string
companyId

Id of an existing company

path string

application/pdf

200 OK

Resync was successfully triggered. Note that the resync is performed asynchronously and that the resync might not yet have finished.

Get a list of all the suppliers for a given company.

GET /v2/me/companies/{companyId}/suppliers

Tags: companies
X-Onea-Auth-Token

A valid access token

header string
companyId

Id of an existing company

path string

application/json

200 OK

Returns a list of all the suppliers for the given company.

Upload a new image to the given company

POST /v2/me/companies/{companyId}/upload-image

Tags: companies

application/json

X-Onea-Auth-Token

A valid access token

header string
companyId

Id of an existing company

path string
200 OK

Image uploaded succesfully.

Schema definitions

CameraImage: object

paymentMethod: string , x ∈ { cash , visa , invoice }
amounts: object
totalAmount: number
netAmounts: object[]
object
percentage: number
amount: number

Company: object

id: string
code: string
name: string
lastActive: string

PublicCompany: object

id: string
vatNumber: string
name: string
environmentName: string

Supplier: object

code: string
name: string
iconUrl: string
enabledPaymentMethods: string[]
string , x ∈ { CASH , VISA , INVOICE }