Getting started

Okay, so let's make our first API call.

Step 1 -Sign-up and login

Sign-up, verify your email address, then login.

Step 2 - Find your API "auth token"

API tokens are long, random and unique strings of characters that are sent to the API in the HTTP header to grant access to the UserBridge API.

Once you have logged-in, view your API Auth tokens. Every "App" in your account has at least one "API auth token".

Step 3 - Setup your HTTP headers


Accept: application/json
Content-Type: application/json
UserBridge-Version: 20191101
UserBridge-AppKey: [YOUR APP KEY HERE]
Authorization: Bearer [YOUR API AUTH TOKEN HERE]
				

More details can be found here, in the API reference.

Step 4 - "Ping!"

Send a GET request to our "test/ping [GET]" endpoint. No arguments or post data is required for this endpoint.


GET URL: https://userbridge.io/api/test/ping
				

Step 5 - Did it work?

A successful response should be something like this (see below). You should get back an HTTP 200 code. The response will always be a JSON object, which should contain a "response" object. In addition, the "test/ping [GET]" endpoint will return a message containing the name of a famous bridge.


{
    "success": true,
    "http_code": 200,
    "request_id": "5d2cc8c9b1a2bbfe6b8ea6567aad69c450fe5fe4",
    "response": {
        "message": "Looking good! Your bridge is the Millau Bridge"
    }
}
				

If something went wrong, you might see something like this:


{
    "success": false,
    "error_code": "auth_token_forbidden",
    "http_code": 403
}
				

If you are having problems getting this to work, take a look at the Trouble shooting or API error codes documentation.


Next steps

If you have managed to get the "test/ping [GET]" endpoint working - well done - this means your code is correctly talking to the UserBridge API. Typically you will use the API to create, store, update and retrieve your users. In addition, you can also use the API to create user data fields.

Users

Storing and managing users is kinda the point of UserBridge. The "app/users [POST]" endpoint is how you tell UserBridge about your users and user data:

"app/users [POST]" API reference

Fields

Your users have data - email addresses, phone numbers, names etc. But you probably also store a lot of other information about your users that is specific to your business.

UserBridge provides your app with a set of standard "preset" fields, but you can create as many other fields as you wish.

"app/fields [POST]" API reference