Overview

Welcome to the 4b42 API! Our API allows you to easily access your 4b42 account, get information about your products.

What should I know before starting?

Our API is continuously being developed and improved, but we are still trying to keep it as stable as possible. We try to only have changes that are backwards compatible: usually the changes are only additions, e.g. new resources are implemented or new properties are added to existing resources. Sometimes breaking changes cannot be avoided, e.g. when a new feature requires an incompatible change to the underlying data model, all those changes will be documented in the change log.

Methods

We use the following methods for our api:

Method

Type

Meaning

post

Create

Create a new instance

get

Read

Query/list instances

put

Update

Update a specific instance

delete

Delete

Delete a specific instance

Errors

When an error is encountered you will receive an HTTP status code along with a message and error code in the body of the response. The message is intended to give a user-friendly explanation of the error while the error codes are designed to be machine readable codes that applications can use to better understand the context of the error and react appropriately.

We use the following status codes for errors:

Status Code

Meaning

200

OK - Request successful executed.

400

Bad Request – The request contains errors.

401

Unauthorized – The authentication process failed, or the access token is not valid.

403

Forbidden – Access to this resource is restricted for the given caller.

404

Not Found – The specified resource could not be found.

405

Method Not Allowed – An invalid method was used to access a resource.

406

Not Acceptable – An unsupported format was requested.

409

Conflict – The requested operation on the resource cannot be made due the resource state.

500

Internal Server Error – There was a problem with the API host server. Try again later.

503

Service Unavailable – API is temporarily offline for maintenance. Try again later.

TODO.

Status Code

Meaning

INVALID_INPUT

.

INVALID_INPUT_IPV4

...

INVALID_INPUT_IPV6

.

INVALID_INPUT_MAC

.

Authentication

There are a few different ways to get an 4b42 api key. The first option listed, using user credentials, will be the most common.

User credentials

Generates a 4b42 api key which can be used in subsequent calls to 4b42 API. This resource uses Password Authorization. Follow these steps to retrieve an api key:

get curl -u USERNAME:'PASSWORD' https://api.4b42.com

{}

API Key

Once you have the 4b42 apie key, you can make the request to the api. To do this, add your api key to the request header.