NAV -image
bash javascript

Introduction

This documentation aims to provide all the information you need to work with the Apostle API. Here you will be able to see what kind of requests are available and how to make the correct calls to the API. As you scroll, you'll see code examples for working with the API in different programming languages in the dark area to the right (or as part of the content on mobile). You can switch the language used with the tabs at the top right (or from the nav menu at the top left on mobile).

Base URL

api-apostle.com

Authenticating requests

To authenticate requests, include an Authorization header with the value "Bearer {YOUR_AUTH_KEY}".

All authenticated endpoints are marked with a requires authentication badge in the documentation below.

Logging in and using API-calls with the Apostle API is a bit different than normal. First when logging in, there is the option to give the domainname of a Team. This will make it so the User will log in to that specific Team. When logging in, a user_token and membership_token will be given. The user_token is supposed to be used like an authentication bearer, as is the case with most APIs. The membership_token is a token that you're supposed to enter with every call in the parameters. This will make it so the API understands what Team you're logged in to and thus return the right information. Every API call always uses the membership_token, except the login. Always enter it with the parameter name 'membership_token'

    An account to test the API with is:
    email: test@apostle.nl
    password: password

Authentication

API-calls to manage authentication and logging in.

Register

requires authentication

Creates an User under a newly registered Team, Brand and then gets placed under the Apostle organization.

Example request:

curl -X POST \
    "api-apostle.com/api/register" \
    -H "Authorization: Bearer {YOUR_AUTH_KEY}" \
    -H "Content-Type: application/json" \
    -H "Accept: application/json" \
    -d '{"brand_name":"velit","team_name":"error","team_domain":"ut","email":"repudiandae","first_name":"soluta","last_name":"vitae","password":"est"}'
const url = new URL(
    "api-apostle.com/api/register"
);

let headers = {
    "Authorization": "Bearer {YOUR_AUTH_KEY}",
    "Content-Type": "application/json",
    "Accept": "application/json",
};

let body = {
    "brand_name": "velit",
    "team_name": "error",
    "team_domain": "ut",
    "email": "repudiandae",
    "first_name": "soluta",
    "last_name": "vitae",
    "password": "est"
}

fetch(url, {
    method: "POST",
    headers,
    body: JSON.stringify(body),
}).then(response => response.json());

Example response (200, OK):


"data": {
     "items": [
         {
             "email": "rickmartens@home.nl",
             "first_name": "Rick",
             "last_name": "Martens",
             "created_at": "2021-01-29T09:56:13.000000Z",
             "id": 201
         },
         {
             "name": "testbrand",
             "updated_at": "2021-01-29T09:56:13.000000Z",
             "created_at": "2021-01-29T09:56:13.000000Z",
             "id": 101
         },
         {
             "name": "testTeam",
             "domain": "tts",
             "updated_at": "2021-01-29T09:56:13.000000Z",
             "created_at": "2021-01-29T09:56:13.000000Z",
             "id": 123
         },
         {
             "updated_at": "2021-01-29T09:56:13.000000Z",
             "created_at": "2021-01-29T09:56:13.000000Z",
             "id": 9048
         }
     ]
}

}

Example response (400, Incorrect input):


The data that has been put in could not be validated.

Request   

POST api/register

Body Parameters

brand_name  string  
The new Brand the User and Team will get registered under.

team_name  string  
The new Team the User will get registered under.

team_domain  string optional  
The team_domain that the newly made Team will have.

email  string  
The email the new User will use to log in with.

first_name  string  
The first name of the newly created User.

last_name  string  
The last name of the newly created User.

password  string  
The password belonging to the newly created User. *

Login

requires authentication

Logs the user in based on their email, password and team_domain. A membership_token and user_token are returned.

Example request:

curl -X POST \
    "api-apostle.com/api/login" \
    -H "Authorization: Bearer {YOUR_AUTH_KEY}" \
    -H "Content-Type: application/json" \
    -H "Accept: application/json" \
    -d '{"email":"accusantium","password":"et","team_domain":"eos"}'
const url = new URL(
    "api-apostle.com/api/login"
);

let headers = {
    "Authorization": "Bearer {YOUR_AUTH_KEY}",
    "Content-Type": "application/json",
    "Accept": "application/json",
};

let body = {
    "email": "accusantium",
    "password": "et",
    "team_domain": "eos"
}

fetch(url, {
    method: "POST",
    headers,
    body: JSON.stringify(body),
}).then(response => response.json());

Example response (200, OK):


"data": {
     "user_token": "eyJ0eXAiOiJKV1QiLCJhbGciOiJSUzI1NiJ9.eyJhdWQiOiIxIiwianRpIjoiMzk5OTMyMmMzNTVmNjI0MzhkNzFkMGMzYjM1M2EwZmQ0NjE5M2RjYTJjNTgyNzkxNDllMmQ3NTUxZmU2NjlmNDEzYWQwNzVkZDUxOGI3YTEiLCJpYXQiOiIxNjExOTEzODk0Ljk2ODQwNCIsIm5iZiI6IjE2MTE5MTM4OTQuOTY4NDExIiwiZXhwIjoiMTY0MzQ0OTg5NC45MzU5OTQiLCJzdWIiOiIxIiwic2NvcGVzIjpbXX0.MMzVlOrYgw7ITdRlgxwx7BwzCvjf5KDClc7IYH6DG7BlZ0rSYJtZ8yrt0wggnsvd8nsGjcFF4gvmglvDdoPzSneVGjQtEX2T8wXgl9A4R-PHTkggDHmETyuQdEQL1k3es7CHK_uL2cqO-k5NSDxFkAmqwEZ4NGNDK3ZR4P3LLqPR_QuCJe97QyDiQzy7Du5DdoiSUWExovnf45xbHgzPdSUE2U6wKMb0nfw83tm_g5lyU0NeEfbhhzkAKuF9kSJh-A9U68e9hep0GAm4jN1y_SmU41zc128iVxN-jrRzH8ElCFwWuTsuEZ-KvfIFHuKTNmN-AbAbTL8TxlhtNvOl8jwvlYu97PRiBOcSr1_c4AXwyETNDjxGbdzLlYrjL-KyXaAEpDXtXi6_OMiib1nlLzd0J2f6BvMJNbaGxfRITj8k21Bh24iCegjMmYDN0tZjZhUTnNfOxdlfbRLPfAbzBAz1L7iXyVyg43CnecWdU5a6iWjqXxzfT0tDa0OuB6MKmrw30nInvt216p5pv1aGsVWHYAPf3IDjVu7opQHm3vzAND1ED01NSQnsVVtkUVMZRfWxbKUHPWbPTeQzqxxdO1FYI6jmC9TI3R442nGn30fY4SCjakbrHa1TsEcISS34uiqxhQ3YIQDOMYUbdy-kXYFNYXvZiuyTE-1JYJIuQ7w",
     "membership_token": "eyJpdiI6IkhWSkhnTXc3cEtSdjVNeTUwUkFFcEE9PSIsInZhbHVlIjoiTXVmME1VNW1NczJDQldYYU9IN3VKUT09IiwibWFjIjoiZDhiNTdjZmZiNWJhNTVhN2Y2Y2FhYzM4MGE3NzAwNjViZDljMWQ1YWFjZDcwMzdiMWMyMjdmOThlZDcwYzBkMyJ9"
}

Example response (404, Not found):


Either the login credentials are incorrect, or there was no user with that email found within the database.

Request   

POST api/login

Body Parameters

email  string  
The email used to register at Apostle.

password  string  
The password paired with the email when the user registered at Apostle.

team_domain  string optional  
The team_domain belonging to the Team the user wants to log in to. If left empty, the user will be logged in to the first Team available.

Send magic link

requires authentication

Request a magic link to be sent to user e-mail address. A membership_token and user_token are returned.

Example request:

curl -X POST \
    "api-apostle.com/api/login/magic/send" \
    -H "Authorization: Bearer {YOUR_AUTH_KEY}" \
    -H "Content-Type: application/json" \
    -H "Accept: application/json" \
    -d '{"e-mail":"quibusdam"}'
const url = new URL(
    "api-apostle.com/api/login/magic/send"
);

let headers = {
    "Authorization": "Bearer {YOUR_AUTH_KEY}",
    "Content-Type": "application/json",
    "Accept": "application/json",
};

let body = {
    "e-mail": "quibusdam"
}

fetch(url, {
    method: "POST",
    headers,
    body: JSON.stringify(body),
}).then(response => response.json());

Example response (404, Not found):


User not found.

Request   

POST api/login/magic/send

Body Parameters

e-mail  string  
The e-mail for making the request.

Magic login

requires authentication

Use token to login once, after this te token will be deleted. A membership_token and user_token are returned.

Example request:

curl -X GET \
    -G "api-apostle.com/api/login/magic" \
    -H "Authorization: Bearer {YOUR_AUTH_KEY}" \
    -H "Content-Type: application/json" \
    -H "Accept: application/json" \
    -d '{"token":"excepturi","team_domain":"dolor"}'
const url = new URL(
    "api-apostle.com/api/login/magic"
);

let headers = {
    "Authorization": "Bearer {YOUR_AUTH_KEY}",
    "Content-Type": "application/json",
    "Accept": "application/json",
};

let body = {
    "token": "excepturi",
    "team_domain": "dolor"
}

fetch(url, {
    method: "GET",
    headers,
    body: JSON.stringify(body),
}).then(response => response.json());

Example response (404, Not found):


Invalid token or User not found.

Example response (403, Forbidden):


Token has timed-out.

Request   

GET api/login/magic

Body Parameters

token  string  
The received token.

team_domain  string optional  
The team_domain belonging to the Team the user wants to log in to. If left empty, the user will be logged in to the first Team available.

Logout

requires authentication

Logout for the User

Example request:

curl -X GET \
    -G "api-apostle.com/api/logout" \
    -H "Authorization: Bearer {YOUR_AUTH_KEY}" \
    -H "Content-Type: application/json" \
    -H "Accept: application/json"
const url = new URL(
    "api-apostle.com/api/logout"
);

let headers = {
    "Authorization": "Bearer {YOUR_AUTH_KEY}",
    "Content-Type": "application/json",
    "Accept": "application/json",
};

fetch(url, {
    method: "GET",
    headers,
}).then(response => response.json());

Example response (401, Not logged in):


There is no User logged in to log out.

Request   

GET api/logout

Send password reset link

requires authentication

Example request:

curl -X GET \
    -G "api-apostle.com/api/password/reset/send" \
    -H "Authorization: Bearer {YOUR_AUTH_KEY}" \
    -H "Content-Type: application/json" \
    -H "Accept: application/json"
const url = new URL(
    "api-apostle.com/api/password/reset/send"
);

let headers = {
    "Authorization": "Bearer {YOUR_AUTH_KEY}",
    "Content-Type": "application/json",
    "Accept": "application/json",
};

fetch(url, {
    method: "GET",
    headers,
}).then(response => response.json());

Example response (422):

{
    "success": false,
    "code": 115,
    "locale": "nl_NL",
    "message": "The given data was invalid.",
    "data": {
        "messages": {
            "email": [
                "The email field is required."
            ]
        }
    },
    "debug": {
        "trace": {
            "class": "Illuminate\\Validation\\ValidationException",
            "file": "\/home\/vagrant\/feniks\/vendor\/laravel\/framework\/src\/Illuminate\/Validation\/Validator.php",
            "line": 466
        }
    }
}

Request   

GET api/password/reset/send

Reset password with token

requires authentication

Example request:

curl -X POST \
    "api-apostle.com/api/password/reset" \
    -H "Authorization: Bearer {YOUR_AUTH_KEY}" \
    -H "Content-Type: application/json" \
    -H "Accept: application/json"
const url = new URL(
    "api-apostle.com/api/password/reset"
);

let headers = {
    "Authorization": "Bearer {YOUR_AUTH_KEY}",
    "Content-Type": "application/json",
    "Accept": "application/json",
};

fetch(url, {
    method: "POST",
    headers,
}).then(response => response.json());

Request   

POST api/password/reset

api/impersonate/{user}

requires authentication

Example request:

curl -X GET \
    -G "api-apostle.com/api/impersonate/non" \
    -H "Authorization: Bearer {YOUR_AUTH_KEY}" \
    -H "Content-Type: application/json" \
    -H "Accept: application/json"
const url = new URL(
    "api-apostle.com/api/impersonate/non"
);

let headers = {
    "Authorization": "Bearer {YOUR_AUTH_KEY}",
    "Content-Type": "application/json",
    "Accept": "application/json",
};

fetch(url, {
    method: "GET",
    headers,
}).then(response => response.json());

Example response (500):

{
    "success": false,
    "code": 113,
    "locale": "nl_NL",
    "message": "Unauthenticated.",
    "data": null,
    "debug": {
        "trace": {
            "class": "Illuminate\\Auth\\AuthenticationException",
            "file": "\/home\/vagrant\/feniks\/vendor\/laravel\/framework\/src\/Illuminate\/Auth\/Middleware\/Authenticate.php",
            "line": 82
        }
    }
}

Request   

GET api/impersonate/{user}

URL Parameters

user  string  

Brands

A slug to group Teams within a Brand by.

Index

requires authentication

Retrieve all Brands under the same organization as the given Membership

Example request:

curl -X GET \
    -G "api-apostle.com/api/brand/all" \
    -H "Authorization: Bearer {YOUR_AUTH_KEY}" \
    -H "Content-Type: application/json" \
    -H "Accept: application/json" \
    -d '{"membership_token":"perferendis","pagination":"\"2,3\" The first number will be the amount of items per page, the second is the current page you want to access"}'
const url = new URL(
    "api-apostle.com/api/brand/all"
);

let headers = {
    "Authorization": "Bearer {YOUR_AUTH_KEY}",
    "Content-Type": "application/json",
    "Accept": "application/json",
};

let body = {
    "membership_token": "perferendis",
    "pagination": "\"2,3\" The first number will be the amount of items per page, the second is the current page you want to access"
}

fetch(url, {
    method: "GET",
    headers,
    body: JSON.stringify(body),
}).then(response => response.json());

Example response (200, success):


"data": {
     "items": [
         {
             {
                 "id": 4,
                 "name": "corrupti",
                 "created_at": "2021-01-12T12:21:56.000000Z",
                 "updated_at": "2021-01-12T12:21:56.000000Z",
                 "organization_id": 5,
                 "organization": {
                      "id": 5,
                      "name": "Bartell-Carter",
                      "created_at": null,
                      "updated_at": null
                  }
             },
             {
                 "id": 10,
                 "name": "marcetti",
                 "created_at": "2021-01-12T12:21:56.000000Z",
                 "updated_at": "2021-01-12T12:21:56.000000Z",
                 "organization_id": 5,
                 "organization": {
                      "id": 5,
                      "name": "Bartell-Carter",
                      "created_at": null,
                      "updated_at": null
                  }
             }
         }
     ]
}

Example response (404, No Brands found):


There were no Brands found within our database.

Request   

GET api/brand/all

Body Parameters

membership_token  string  
The Membership access-token that came back when logged in

pagination  string  
The amount of items you want per page and the page you want to access separated by a comma.

Me

requires authentication

Get the details of Brand of the logged in Member

Example request:

curl -X GET \
    -G "api-apostle.com/api/brand/me" \
    -H "Authorization: Bearer {YOUR_AUTH_KEY}" \
    -H "Content-Type: application/json" \
    -H "Accept: application/json" \
    -d '{"membership_token":"illum"}'
const url = new URL(
    "api-apostle.com/api/brand/me"
);

let headers = {
    "Authorization": "Bearer {YOUR_AUTH_KEY}",
    "Content-Type": "application/json",
    "Accept": "application/json",
};

let body = {
    "membership_token": "illum"
}

fetch(url, {
    method: "GET",
    headers,
    body: JSON.stringify(body),
}).then(response => response.json());

Example response (404, No Team found):


There was no Team found associated to the given Membership.

Example response (500):

{
    "success": false,
    "code": 113,
    "locale": "nl_NL",
    "message": "Unauthenticated.",
    "data": null,
    "debug": {
        "trace": {
            "class": "Illuminate\\Auth\\AuthenticationException",
            "file": "\/home\/vagrant\/feniks\/vendor\/laravel\/framework\/src\/Illuminate\/Auth\/Middleware\/Authenticate.php",
            "line": 82
        }
    }
}

Request   

GET api/brand/me

Body Parameters

membership_token  string  
The Membership access-token that came back when logged in

Resolve

requires authentication

Search a Brand that possesses the given attributes.

Example request:

curl -X GET \
    -G "api-apostle.com/api/brand/resolve" \
    -H "Authorization: Bearer {YOUR_AUTH_KEY}" \
    -H "Content-Type: application/json" \
    -H "Accept: application/json" \
    -d '{"membership_token":"et","search_query":"in"}'
const url = new URL(
    "api-apostle.com/api/brand/resolve"
);

let headers = {
    "Authorization": "Bearer {YOUR_AUTH_KEY}",
    "Content-Type": "application/json",
    "Accept": "application/json",
};

let body = {
    "membership_token": "et",
    "search_query": "in"
}

fetch(url, {
    method: "GET",
    headers,
    body: JSON.stringify(body),
}).then(response => response.json());

Example response (200, success):


"data": {
     "values": [
         [
             {
                 "id": 1,
                 "name": "sit",
                 "created_at": "2021-01-13T08:14:25.000000Z",
                 "updated_at": "2021-01-13T08:14:25.000000Z",
                 "organization": {
                      "id": 5,
                      "name": "Bartell-Carter",
                      "created_at": null,
                      "updated_at": null
                  }
             }
         ]
     ]
}

Example response (404, No Brands found):


There were no Brands found based on the query given.

Request   

GET api/brand/resolve

Body Parameters

membership_token  string  
The Membership access-token that came back when logged in

search_query  string  
Any kind of attribute you want to query on, separating the attribute from the value with a semicolon. ("id;4 name;brandname")

Show

requires authentication

Show the details of a Brand that is available under the same Organization as the given Membership

Example request:

curl -X GET \
    -G "api-apostle.com/api/brand/detail/2" \
    -H "Authorization: Bearer {YOUR_AUTH_KEY}" \
    -H "Content-Type: application/json" \
    -H "Accept: application/json" \
    -d '{"membership_token":"neque"}'
const url = new URL(
    "api-apostle.com/api/brand/detail/2"
);

let headers = {
    "Authorization": "Bearer {YOUR_AUTH_KEY}",
    "Content-Type": "application/json",
    "Accept": "application/json",
};

let body = {
    "membership_token": "neque"
}

fetch(url, {
    method: "GET",
    headers,
    body: JSON.stringify(body),
}).then(response => response.json());

Example response (200, success):


"data": {
     "items": [
         {
             "id": 6,
             "name": "corrupti",
             "created_at": "2021-01-13T08:14:25.000000Z",
             "updated_at": "2021-01-13T08:14:25.000000Z",
                 "organization": {
                      "id": 5,
                      "name": "Bartell-Carter",
                      "created_at": null,
                      "updated_at": null
                  }
         }
     ]
}

Example response (404, No Brand found):


There was no Brand found with that ID.

Example response (409, Conflict):


The Brand you're trying to see does not fall under your Organization, thus you are unauthorized.

Request   

GET api/brand/detail/{id}

URL Parameters

id  integer  
The ID of the Brand that you want to show.

Body Parameters

membership_token  string  
The Membership access-token that came back when logged in.

Store

requires authentication

Stores a single Brand with the given parameters as attributes of said Brand.

Example request:

curl -X POST \
    "api-apostle.com/api/brand/create" \
    -H "Authorization: Bearer {YOUR_AUTH_KEY}" \
    -H "Content-Type: application/json" \
    -H "Accept: application/json" \
    -d '{"membership_token":"quibusdam","name":"doloribus","organization_id":14}'
const url = new URL(
    "api-apostle.com/api/brand/create"
);

let headers = {
    "Authorization": "Bearer {YOUR_AUTH_KEY}",
    "Content-Type": "application/json",
    "Accept": "application/json",
};

let body = {
    "membership_token": "quibusdam",
    "name": "doloribus",
    "organization_id": 14
}

fetch(url, {
    method: "POST",
    headers,
    body: JSON.stringify(body),
}).then(response => response.json());

Example response (201, success):


"data": {
     "items": [
         {
             "name": "Scortini",
             "updated_at": "2021-01-13T08:46:55.000000Z",
             "created_at": "2021-01-13T08:46:55.000000Z",
             "id": 134,
             "organization": {
                  "id": 5,
                  "name": "Bartell-Carter",
                  "created_at": null,
                  "updated_at": null
              }
         }
     ]
}

Example response (400, Wrong values):


The given values to create the Brand either already exist within the database or are of the wrong type.

Example response (409, Could not be created):


The Brand could not be created.

Request   

POST api/brand/create

Body Parameters

membership_token  string  
The Membership access-token that came back when logged in.

name  string  
The name of the Brand that you are trying to create.

organization_id  integer  
The ID of the organization that the Brand you are creating belongs to.

Update

requires authentication

Updates a single Brand with the given parameters as the new attributes of the given Brand.

Example request:

curl -X PATCH \
    "api-apostle.com/api/brand/edit/20" \
    -H "Authorization: Bearer {YOUR_AUTH_KEY}" \
    -H "Content-Type: application/json" \
    -H "Accept: application/json" \
    -d '{"membership_token":"tempora","name":"doloribus"}'
const url = new URL(
    "api-apostle.com/api/brand/edit/20"
);

let headers = {
    "Authorization": "Bearer {YOUR_AUTH_KEY}",
    "Content-Type": "application/json",
    "Accept": "application/json",
};

let body = {
    "membership_token": "tempora",
    "name": "doloribus"
}

fetch(url, {
    method: "PATCH",
    headers,
    body: JSON.stringify(body),
}).then(response => response.json());

Example response (200, success):


"data": {
     "items": [
         {
             "id": 6,
             "name": "Scorccini",
             "created_at": "2021-01-13T08:14:25.000000Z",
             "updated_at": "2021-01-13T08:56:33.000000Z",
             "organization": {
                  "id": 5,
                  "name": "Bartell-Carter",
                  "created_at": null,
                  "updated_at": null
              }
         }
     ]
}

Example response (404, Brand not found):


Could not find the Brand associated with the ID that was given.

Example response (409, Conflict):


The Brand attempted to edit did not fall under the same Organization as the given Membership and is thus unauthorized to be edited.

Request   

PATCH api/brand/edit/{id}

URL Parameters

id  integer  
The ID of the Brand that you want to edit.

Body Parameters

membership_token  string  
The Membership access-token that came back when logged in.

name  string optional  
The new name of the Brand that you want to edit.

Update

requires authentication

Updates the authenticated User with the given parameters.

Example request:

curl -X PATCH \
    "api-apostle.com/api/brand/me/edit" \
    -H "Authorization: Bearer {YOUR_AUTH_KEY}" \
    -H "Content-Type: application/json" \
    -H "Accept: application/json" \
    -d '{"membership_token":"ratione","email":"a","password":"et","first_name":"cupiditate","last_name":"voluptatem","dob":"ab","phone":"et","language":"quia","consent":true,"avatar":"qui"}'
const url = new URL(
    "api-apostle.com/api/brand/me/edit"
);

let headers = {
    "Authorization": "Bearer {YOUR_AUTH_KEY}",
    "Content-Type": "application/json",
    "Accept": "application/json",
};

let body = {
    "membership_token": "ratione",
    "email": "a",
    "password": "et",
    "first_name": "cupiditate",
    "last_name": "voluptatem",
    "dob": "ab",
    "phone": "et",
    "language": "quia",
    "consent": true,
    "avatar": "qui"
}

fetch(url, {
    method: "PATCH",
    headers,
    body: JSON.stringify(body),
}).then(response => response.json());

Example response (201, success):


"data": {
     "items": [
         {
             "email": "test@gmail.com",
             "first_name": "Rick",
             "last_name": "Martens",
             "created_at": "2021-01-19T11:40:17.000000Z",
             "id": 101
         }
     ]
}

Example response (404, User not found):


Could not find the User associated with the ID that was given.

Example response (409, Conflict):


The User could not be updated.

Request   

PATCH api/brand/me/edit

Body Parameters

membership_token  string  
The Membership access-token that came back when logged in.

email  string  
The email of the User that you are trying to edit.

password  string  
The password of the User that you are trying to edit.

first_name  string optional  
The first name of the User that you are trying to edit.

last_name  string optional  
The last name of the User that you are trying to edit.

dob  date optional  
The date of birth of the User that you are trying to edit.

phone  string optional  
The phone number of the User that you are trying to edit.

language  string optional  
A combination of letters standing for the language of the User that you are trying to edit.

consent  boolean optional  
A boolean signifying if the User consented to the terms and conditions.

avatar  url optional  
A URL leading to the image the User wants to use as their avatar.

Destroy

requires authentication

Destroys a single or list of Brands based on the IDs given in the parameters.

Example request:

curl -X DELETE \
    "api-apostle.com/api/brand/delete" \
    -H "Authorization: Bearer {YOUR_AUTH_KEY}" \
    -H "Content-Type: application/json" \
    -H "Accept: application/json" \
    -d '{"membership_token":"soluta","array":"doloremque"}'
const url = new URL(
    "api-apostle.com/api/brand/delete"
);

let headers = {
    "Authorization": "Bearer {YOUR_AUTH_KEY}",
    "Content-Type": "application/json",
    "Accept": "application/json",
};

let body = {
    "membership_token": "soluta",
    "array": "doloremque"
}

fetch(url, {
    method: "DELETE",
    headers,
    body: JSON.stringify(body),
}).then(response => response.json());

Example response (212, Deleted):


"data": {
     "items": [
         {
             "id": 6,
             "id": 8,
         }
     ]
}

Example response (409, Could not be deleted):


Some or all Brands given could not be deleted.

Request   

DELETE api/brand/delete

Body Parameters

membership_token  string  
The Membership access-token that came back when logged in.

array  of optional  
id's to delete

Destroy Me

requires authentication

Destroys the current Brand.

Example request:

curl -X DELETE \
    "api-apostle.com/api/brand/me/delete" \
    -H "Authorization: Bearer {YOUR_AUTH_KEY}" \
    -H "Content-Type: application/json" \
    -H "Accept: application/json" \
    -d '{"membership_token":"qui"}'
const url = new URL(
    "api-apostle.com/api/brand/me/delete"
);

let headers = {
    "Authorization": "Bearer {YOUR_AUTH_KEY}",
    "Content-Type": "application/json",
    "Accept": "application/json",
};

let body = {
    "membership_token": "qui"
}

fetch(url, {
    method: "DELETE",
    headers,
    body: JSON.stringify(body),
}).then(response => response.json());

Request   

DELETE api/brand/me/delete

Body Parameters

membership_token  string  
The Membership access-token that came back when logged in.

Endpoints

api/permission/all

requires authentication

Example request:

curl -X GET \
    -G "api-apostle.com/api/permission/all" \
    -H "Authorization: Bearer {YOUR_AUTH_KEY}" \
    -H "Content-Type: application/json" \
    -H "Accept: application/json"
const url = new URL(
    "api-apostle.com/api/permission/all"
);

let headers = {
    "Authorization": "Bearer {YOUR_AUTH_KEY}",
    "Content-Type": "application/json",
    "Accept": "application/json",
};

fetch(url, {
    method: "GET",
    headers,
}).then(response => response.json());

Example response (500):

{
    "success": false,
    "code": 113,
    "locale": "nl_NL",
    "message": "Unauthenticated.",
    "data": null,
    "debug": {
        "trace": {
            "class": "Illuminate\\Auth\\AuthenticationException",
            "file": "\/home\/vagrant\/feniks\/vendor\/laravel\/framework\/src\/Illuminate\/Auth\/Middleware\/Authenticate.php",
            "line": 82
        }
    }
}

Request   

GET api/permission/all

Check one or more columns against a value delimited per item on semicolon ';'

requires authentication

Example request:

curl -X GET \
    -G "api-apostle.com/api/permission/resolve" \
    -H "Authorization: Bearer {YOUR_AUTH_KEY}" \
    -H "Content-Type: application/json" \
    -H "Accept: application/json"
const url = new URL(
    "api-apostle.com/api/permission/resolve"
);

let headers = {
    "Authorization": "Bearer {YOUR_AUTH_KEY}",
    "Content-Type": "application/json",
    "Accept": "application/json",
};

fetch(url, {
    method: "GET",
    headers,
}).then(response => response.json());

Example response (500):

{
    "success": false,
    "code": 113,
    "locale": "nl_NL",
    "message": "Unauthenticated.",
    "data": null,
    "debug": {
        "trace": {
            "class": "Illuminate\\Auth\\AuthenticationException",
            "file": "\/home\/vagrant\/feniks\/vendor\/laravel\/framework\/src\/Illuminate\/Auth\/Middleware\/Authenticate.php",
            "line": 82
        }
    }
}

Request   

GET api/permission/resolve

api/permission/detail/{id}

requires authentication

Example request:

curl -X GET \
    -G "api-apostle.com/api/permission/detail/at" \
    -H "Authorization: Bearer {YOUR_AUTH_KEY}" \
    -H "Content-Type: application/json" \
    -H "Accept: application/json"
const url = new URL(
    "api-apostle.com/api/permission/detail/at"
);

let headers = {
    "Authorization": "Bearer {YOUR_AUTH_KEY}",
    "Content-Type": "application/json",
    "Accept": "application/json",
};

fetch(url, {
    method: "GET",
    headers,
}).then(response => response.json());

Example response (500):

{
    "success": false,
    "code": 113,
    "locale": "nl_NL",
    "message": "Unauthenticated.",
    "data": null,
    "debug": {
        "trace": {
            "class": "Illuminate\\Auth\\AuthenticationException",
            "file": "\/home\/vagrant\/feniks\/vendor\/laravel\/framework\/src\/Illuminate\/Auth\/Middleware\/Authenticate.php",
            "line": 82
        }
    }
}

Request   

GET api/permission/detail/{id}

URL Parameters

id  string  

api/permission/create

requires authentication

Example request:

curl -X POST \
    "api-apostle.com/api/permission/create" \
    -H "Authorization: Bearer {YOUR_AUTH_KEY}" \
    -H "Content-Type: application/json" \
    -H "Accept: application/json"
const url = new URL(
    "api-apostle.com/api/permission/create"
);

let headers = {
    "Authorization": "Bearer {YOUR_AUTH_KEY}",
    "Content-Type": "application/json",
    "Accept": "application/json",
};

fetch(url, {
    method: "POST",
    headers,
}).then(response => response.json());

Request   

POST api/permission/create

api/permission/edit/{id}

requires authentication

Example request:

curl -X PATCH \
    "api-apostle.com/api/permission/edit/labore" \
    -H "Authorization: Bearer {YOUR_AUTH_KEY}" \
    -H "Content-Type: application/json" \
    -H "Accept: application/json"
const url = new URL(
    "api-apostle.com/api/permission/edit/labore"
);

let headers = {
    "Authorization": "Bearer {YOUR_AUTH_KEY}",
    "Content-Type": "application/json",
    "Accept": "application/json",
};

fetch(url, {
    method: "PATCH",
    headers,
}).then(response => response.json());

Request   

PATCH api/permission/edit/{id}

URL Parameters

id  string  

api/permission/delete

requires authentication

Example request:

curl -X DELETE \
    "api-apostle.com/api/permission/delete" \
    -H "Authorization: Bearer {YOUR_AUTH_KEY}" \
    -H "Content-Type: application/json" \
    -H "Accept: application/json"
const url = new URL(
    "api-apostle.com/api/permission/delete"
);

let headers = {
    "Authorization": "Bearer {YOUR_AUTH_KEY}",
    "Content-Type": "application/json",
    "Accept": "application/json",
};

fetch(url, {
    method: "DELETE",
    headers,
}).then(response => response.json());

Request   

DELETE api/permission/delete

api/translation/all

requires authentication

Example request:

curl -X GET \
    -G "api-apostle.com/api/translation/all" \
    -H "Authorization: Bearer {YOUR_AUTH_KEY}" \
    -H "Content-Type: application/json" \
    -H "Accept: application/json"
const url = new URL(
    "api-apostle.com/api/translation/all"
);

let headers = {
    "Authorization": "Bearer {YOUR_AUTH_KEY}",
    "Content-Type": "application/json",
    "Accept": "application/json",
};

fetch(url, {
    method: "GET",
    headers,
}).then(response => response.json());

Example response (500):

{
    "success": false,
    "code": 113,
    "locale": "nl_NL",
    "message": "Unauthenticated.",
    "data": null,
    "debug": {
        "trace": {
            "class": "Illuminate\\Auth\\AuthenticationException",
            "file": "\/home\/vagrant\/feniks\/vendor\/laravel\/framework\/src\/Illuminate\/Auth\/Middleware\/Authenticate.php",
            "line": 82
        }
    }
}

Request   

GET api/translation/all

api/translation/resolve

requires authentication

Example request:

curl -X GET \
    -G "api-apostle.com/api/translation/resolve" \
    -H "Authorization: Bearer {YOUR_AUTH_KEY}" \
    -H "Content-Type: application/json" \
    -H "Accept: application/json"
const url = new URL(
    "api-apostle.com/api/translation/resolve"
);

let headers = {
    "Authorization": "Bearer {YOUR_AUTH_KEY}",
    "Content-Type": "application/json",
    "Accept": "application/json",
};

fetch(url, {
    method: "GET",
    headers,
}).then(response => response.json());

Example response (500):

{
    "success": false,
    "code": 113,
    "locale": "nl_NL",
    "message": "Unauthenticated.",
    "data": null,
    "debug": {
        "trace": {
            "class": "Illuminate\\Auth\\AuthenticationException",
            "file": "\/home\/vagrant\/feniks\/vendor\/laravel\/framework\/src\/Illuminate\/Auth\/Middleware\/Authenticate.php",
            "line": 82
        }
    }
}

Request   

GET api/translation/resolve

api/translation/detail/{id}

requires authentication

Example request:

curl -X GET \
    -G "api-apostle.com/api/translation/detail/at" \
    -H "Authorization: Bearer {YOUR_AUTH_KEY}" \
    -H "Content-Type: application/json" \
    -H "Accept: application/json"
const url = new URL(
    "api-apostle.com/api/translation/detail/at"
);

let headers = {
    "Authorization": "Bearer {YOUR_AUTH_KEY}",
    "Content-Type": "application/json",
    "Accept": "application/json",
};

fetch(url, {
    method: "GET",
    headers,
}).then(response => response.json());

Example response (500):

{
    "success": false,
    "code": 113,
    "locale": "nl_NL",
    "message": "Unauthenticated.",
    "data": null,
    "debug": {
        "trace": {
            "class": "Illuminate\\Auth\\AuthenticationException",
            "file": "\/home\/vagrant\/feniks\/vendor\/laravel\/framework\/src\/Illuminate\/Auth\/Middleware\/Authenticate.php",
            "line": 82
        }
    }
}

Request   

GET api/translation/detail/{id}

URL Parameters

id  string  

api/translation/create

requires authentication

Example request:

curl -X POST \
    "api-apostle.com/api/translation/create" \
    -H "Authorization: Bearer {YOUR_AUTH_KEY}" \
    -H "Content-Type: application/json" \
    -H "Accept: application/json"
const url = new URL(
    "api-apostle.com/api/translation/create"
);

let headers = {
    "Authorization": "Bearer {YOUR_AUTH_KEY}",
    "Content-Type": "application/json",
    "Accept": "application/json",
};

fetch(url, {
    method: "POST",
    headers,
}).then(response => response.json());

Request   

POST api/translation/create

api/translation/edit/{id}

requires authentication

Example request:

curl -X PATCH \
    "api-apostle.com/api/translation/edit/itaque" \
    -H "Authorization: Bearer {YOUR_AUTH_KEY}" \
    -H "Content-Type: application/json" \
    -H "Accept: application/json"
const url = new URL(
    "api-apostle.com/api/translation/edit/itaque"
);

let headers = {
    "Authorization": "Bearer {YOUR_AUTH_KEY}",
    "Content-Type": "application/json",
    "Accept": "application/json",
};

fetch(url, {
    method: "PATCH",
    headers,
}).then(response => response.json());

Request   

PATCH api/translation/edit/{id}

URL Parameters

id  string  

api/translation/delete

requires authentication

Example request:

curl -X DELETE \
    "api-apostle.com/api/translation/delete" \
    -H "Authorization: Bearer {YOUR_AUTH_KEY}" \
    -H "Content-Type: application/json" \
    -H "Accept: application/json"
const url = new URL(
    "api-apostle.com/api/translation/delete"
);

let headers = {
    "Authorization": "Bearer {YOUR_AUTH_KEY}",
    "Content-Type": "application/json",
    "Accept": "application/json",
};

fetch(url, {
    method: "DELETE",
    headers,
}).then(response => response.json());

Request   

DELETE api/translation/delete

Groups

A slug to group members within a team by.

Memberships

requires authentication

Retrieve all Memberships under the same requested Group

Example request:

curl -X GET \
    -G "api-apostle.com/api/group/memberships/expedita" \
    -H "Authorization: Bearer {YOUR_AUTH_KEY}" \
    -H "Content-Type: application/json" \
    -H "Accept: application/json" \
    -d '{"membership_token":"quae","pagination":"\"2,3\" The first number will be the amount of items per page, the second is the current page you want to access"}'
const url = new URL(
    "api-apostle.com/api/group/memberships/expedita"
);

let headers = {
    "Authorization": "Bearer {YOUR_AUTH_KEY}",
    "Content-Type": "application/json",
    "Accept": "application/json",
};

let body = {
    "membership_token": "quae",
    "pagination": "\"2,3\" The first number will be the amount of items per page, the second is the current page you want to access"
}

fetch(url, {
    method: "GET",
    headers,
    body: JSON.stringify(body),
}).then(response => response.json());

Example response (400, No pagination):


No pagination parameter given.

Example response (401, Not authorized):


No access.

Example response (404, No Group found):


There was no Group with the given id found within our database.

Example response (409, Not authorized):


Group and Membership do not belong to the same Team.

Request   

GET api/group/memberships/{id}

URL Parameters

id  string  

Body Parameters

membership_token  string  
The Membership access-token that came back when logged in

pagination  string  
The amount of items you want per page and the page you want to access separated by a comma.

Membership Add

requires authentication

Adds membership to given Group.

Example request:

curl -X POST \
    "api-apostle.com/api/group/add/membership" \
    -H "Authorization: Bearer {YOUR_AUTH_KEY}" \
    -H "Content-Type: application/json" \
    -H "Accept: application/json" \
    -d '{"membership_token":"alias","group_id":20,"membership_id":15}'
const url = new URL(
    "api-apostle.com/api/group/add/membership"
);

let headers = {
    "Authorization": "Bearer {YOUR_AUTH_KEY}",
    "Content-Type": "application/json",
    "Accept": "application/json",
};

let body = {
    "membership_token": "alias",
    "group_id": 20,
    "membership_id": 15
}

fetch(url, {
    method: "POST",
    headers,
    body: JSON.stringify(body),
}).then(response => response.json());

Example response (401, Not authorized):


No access.

Example response (400, Wrong values):


You entered wrong values.

Example response (403, No access):


Group doesn't belong to your team.

Example response (409, Conflict):


This relation already exists.

Request   

POST api/group/add/membership

Body Parameters

membership_token  string  
The Membership access-token that came back when logged in.

group_id  integer  
The ID of the Group.

membership_id  integer  
The ID of the membership you want to add to the Group.

Membership Delete

requires authentication

Deletes membership from given Group.

Example request:

curl -X DELETE \
    "api-apostle.com/api/group/delete/membership" \
    -H "Authorization: Bearer {YOUR_AUTH_KEY}" \
    -H "Content-Type: application/json" \
    -H "Accept: application/json" \
    -d '{"membership_token":"sint","group_id":7,"membership_id":12}'
const url = new URL(
    "api-apostle.com/api/group/delete/membership"
);

let headers = {
    "Authorization": "Bearer {YOUR_AUTH_KEY}",
    "Content-Type": "application/json",
    "Accept": "application/json",
};

let body = {
    "membership_token": "sint",
    "group_id": 7,
    "membership_id": 12
}

fetch(url, {
    method: "DELETE",
    headers,
    body: JSON.stringify(body),
}).then(response => response.json());

Example response (401, Not authorized):


No access.

Example response (400, Wrong values):


You entered wrong values.

Example response (403, No access):


Group doesn't belong to your team.

Example response (403, No access):


The given Membership does not belong to your Team.

Example response (409, Conflict):


This relation already exists.

Example response (503, Service Unavailable):


Could not remove relation, something went wrong. Please contact developers.

Request   

DELETE api/group/delete/membership

Body Parameters

membership_token  string  
The Membership access-token that came back when logged in.

group_id  integer  
The ID of the Group.

membership_id  integer  
The ID of the membership you want to add to the Group.

Index

requires authentication

Retrieve all Groups under the same Team as the given Membership

Example request:

curl -X GET \
    -G "api-apostle.com/api/group/all" \
    -H "Authorization: Bearer {YOUR_AUTH_KEY}" \
    -H "Content-Type: application/json" \
    -H "Accept: application/json" \
    -d '{"membership_token":"ut","pagination":"\"2,3\" The first number will be the amount of items per page, the second is the current page you want to access"}'
const url = new URL(
    "api-apostle.com/api/group/all"
);

let headers = {
    "Authorization": "Bearer {YOUR_AUTH_KEY}",
    "Content-Type": "application/json",
    "Accept": "application/json",
};

let body = {
    "membership_token": "ut",
    "pagination": "\"2,3\" The first number will be the amount of items per page, the second is the current page you want to access"
}

fetch(url, {
    method: "GET",
    headers,
    body: JSON.stringify(body),
}).then(response => response.json());

Example response (200, success):


"data": {
     "items": [
          {
              "id": 4,
              "name": "corrupti",
              "created_at": "2021-01-12T12:21:56.000000Z",
              "updated_at": "2021-01-12T12:21:56.000000Z",
              "team": {
                  "id": 8,
                  "name": "Pfannerstill, Halvorson and Marquardt",
                  "domain": "herman",
                  "logo": "https://lorempixel.com/640/480/?51237",
                  "created_at": "2021-02-02T12:15:41.000000Z",
                  "updated_at": "2021-02-02T12:15:41.000000Z",
                  "brand": {
                      "id": 6,
                      "name": "ut",
                      "created_at": "2021-02-02T12:15:41.000000Z",
                      "updated_at": "2021-02-02T12:15:41.000000Z",
                      "organization": {
                          "id": 10,
                          "name": "Wintheiser, Barton and Beahan",
                          "created_at": null,
                          "updated_at": null
                      }
                  }
              }
          },
          {
              "id": 10,
              "name": "marcetti",
              "created_at": "2021-01-12T12:21:56.000000Z",
              "updated_at": "2021-01-12T12:21:56.000000Z",
              "team": {
                  "id": 8,
                  "name": "Pfannerstill, Halvorson and Marquardt",
                  "domain": "herman",
                  "logo": "https://lorempixel.com/640/480/?51237",
                  "created_at": "2021-02-02T12:15:41.000000Z",
                  "updated_at": "2021-02-02T12:15:41.000000Z",
                  "brand": {
                      "id": 6,
                      "name": "ut",
                      "created_at": "2021-02-02T12:15:41.000000Z",
                      "updated_at": "2021-02-02T12:15:41.000000Z",
                      "organization": {
                          "id": 10,
                          "name": "Wintheiser, Barton and Beahan",
                          "created_at": null,
                          "updated_at": null
                      }
                  }
              }
          }
     ]
}

Example response (404, No Groups found):


There were no Groups found within our database.

Request   

GET api/group/all

Body Parameters

membership_token  string  
The Membership access-token that came back when logged in

pagination  string  
The amount of items you want per page and the page you want to access separated by a comma.

Resolve

requires authentication

Search a Group with the given attributes.

Example request:

curl -X GET \
    -G "api-apostle.com/api/group/resolve" \
    -H "Authorization: Bearer {YOUR_AUTH_KEY}" \
    -H "Content-Type: application/json" \
    -H "Accept: application/json" \
    -d '{"membership_token":"voluptatum","search_query":"itaque"}'
const url = new URL(
    "api-apostle.com/api/group/resolve"
);

let headers = {
    "Authorization": "Bearer {YOUR_AUTH_KEY}",
    "Content-Type": "application/json",
    "Accept": "application/json",
};

let body = {
    "membership_token": "voluptatum",
    "search_query": "itaque"
}

fetch(url, {
    method: "GET",
    headers,
    body: JSON.stringify(body),
}).then(response => response.json());

Example response (200, success):


"data": {
     "items": [
          {
             "id": 1,
             "name": "sit",
             "created_at": "2021-01-13T08:14:25.000000Z",
             "updated_at": "2021-01-13T08:14:25.000000Z",
             "team_id": 8,
              "team": {
                  "id": 8,
                  "name": "Pfannerstill, Halvorson and Marquardt",
                  "domain": "herman",
                  "logo": "https://lorempixel.com/640/480/?51237",
                  "created_at": "2021-02-02T12:15:41.000000Z",
                  "updated_at": "2021-02-02T12:15:41.000000Z",
                  "brand": {
                      "id": 6,
                      "name": "ut",
                      "created_at": "2021-02-02T12:15:41.000000Z",
                      "updated_at": "2021-02-02T12:15:41.000000Z",
                      "organization": {
                          "id": 10,
                          "name": "Wintheiser, Barton and Beahan",
                          "created_at": null,
                          "updated_at": null
                      }
                  }
              }
           }
     ]
}

Example response (404, No Groups found):


There were no Groups found based on the query given.

Request   

GET api/group/resolve

Body Parameters

membership_token  string  
The Membership access-token that came back when logged in

search_query  string  
Any kind of attribute you want to query on, separating the attribute from the value with a semicolon. ("id;4 name;groupname")

Show

requires authentication

Show the details of a Group that is available under the same Team as the given Membership

Example request:

curl -X GET \
    -G "api-apostle.com/api/group/detail/9" \
    -H "Authorization: Bearer {YOUR_AUTH_KEY}" \
    -H "Content-Type: application/json" \
    -H "Accept: application/json" \
    -d '{"membership_token":"dolore"}'
const url = new URL(
    "api-apostle.com/api/group/detail/9"
);

let headers = {
    "Authorization": "Bearer {YOUR_AUTH_KEY}",
    "Content-Type": "application/json",
    "Accept": "application/json",
};

let body = {
    "membership_token": "dolore"
}

fetch(url, {
    method: "GET",
    headers,
    body: JSON.stringify(body),
}).then(response => response.json());

Example response (200, success):


"data": {
     "items": [
         {
             "id": 6,
             "name": "corrupti",
             "created_at": "2021-01-13T08:14:25.000000Z",
             "updated_at": "2021-01-13T08:14:25.000000Z",
              "team": {
                  "id": 8,
                  "name": "Pfannerstill, Halvorson and Marquardt",
                  "domain": "herman",
                  "logo": "https://lorempixel.com/640/480/?51237",
                  "created_at": "2021-02-02T12:15:41.000000Z",
                  "updated_at": "2021-02-02T12:15:41.000000Z",
                  "brand": {
                      "id": 6,
                      "name": "ut",
                      "created_at": "2021-02-02T12:15:41.000000Z",
                      "updated_at": "2021-02-02T12:15:41.000000Z",
                      "organization": {
                          "id": 10,
                          "name": "Wintheiser, Barton and Beahan",
                          "created_at": null,
                          "updated_at": null
                      }
                  }
              }
          }
     ]
}

Example response (404, No Group found):


There was no Group found with that ID.

Example response (409, Conflict):


The Group you're trying to see does not fall under your Team, thus you are unauthorized.

Request   

GET api/group/detail/{id}

URL Parameters

id  integer  
The ID of the Group that you want to show.

Body Parameters

membership_token  string  
The Membership access-token that came back when logged in.

Store

requires authentication

Stores a single Group with the given parameters as attributes of said Group.

Example request:

curl -X POST \
    "api-apostle.com/api/group/create" \
    -H "Authorization: Bearer {YOUR_AUTH_KEY}" \
    -H "Content-Type: application/json" \
    -H "Accept: application/json" \
    -d '{"membership_token":"sunt","name":"accusantium","team_id":11}'
const url = new URL(
    "api-apostle.com/api/group/create"
);

let headers = {
    "Authorization": "Bearer {YOUR_AUTH_KEY}",
    "Content-Type": "application/json",
    "Accept": "application/json",
};

let body = {
    "membership_token": "sunt",
    "name": "accusantium",
    "team_id": 11
}

fetch(url, {
    method: "POST",
    headers,
    body: JSON.stringify(body),
}).then(response => response.json());

Example response (201, success):


"data": {
     "items": [
         {
             "name": "Scortini",
             "updated_at": "2021-01-13T08:46:55.000000Z",
             "created_at": "2021-01-13T08:46:55.000000Z",
             "id": 134,
              "team": {
                  "id": 8,
                  "name": "Pfannerstill, Halvorson and Marquardt",
                  "domain": "herman",
                  "logo": "https://lorempixel.com/640/480/?51237",
                  "created_at": "2021-02-02T12:15:41.000000Z",
                  "updated_at": "2021-02-02T12:15:41.000000Z",
                  "brand": {
                      "id": 6,
                      "name": "ut",
                      "created_at": "2021-02-02T12:15:41.000000Z",
                      "updated_at": "2021-02-02T12:15:41.000000Z",
                      "organization": {
                          "id": 10,
                          "name": "Wintheiser, Barton and Beahan",
                          "created_at": null,
                          "updated_at": null
                      }
                  }
              }
         }
     ]
}

Example response (400, Wrong values):


The given values to create the Group either already exist within the database or are of the wrong type.

Example response (409, Could not be created):


The Group you are trying to create does not belong to your Team.

Request   

POST api/group/create

Body Parameters

membership_token  string  
The Membership access-token that came back when logged in.

name  string  
The name of the Group that you are trying to create.

team_id  integer  
The ID of the Team that the Group you are creating belongs to.

Update

requires authentication

Updates a single Group with the given parameters as the new attributes of the given Group.

Example request:

curl -X PATCH \
    "api-apostle.com/api/group/edit/13" \
    -H "Authorization: Bearer {YOUR_AUTH_KEY}" \
    -H "Content-Type: application/json" \
    -H "Accept: application/json" \
    -d '{"membership_token":"sapiente","name":"a"}'
const url = new URL(
    "api-apostle.com/api/group/edit/13"
);

let headers = {
    "Authorization": "Bearer {YOUR_AUTH_KEY}",
    "Content-Type": "application/json",
    "Accept": "application/json",
};

let body = {
    "membership_token": "sapiente",
    "name": "a"
}

fetch(url, {
    method: "PATCH",
    headers,
    body: JSON.stringify(body),
}).then(response => response.json());

Example response (200, success):


"data": {
     "items": [
         {
             "id": 6,
             "name": "Scorccini",
             "created_at": "2021-01-13T08:14:25.000000Z",
             "updated_at": "2021-01-13T08:56:33.000000Z",
              "team": {
                  "id": 8,
                  "name": "Pfannerstill, Halvorson and Marquardt",
                  "domain": "herman",
                  "logo": "https://lorempixel.com/640/480/?51237",
                  "created_at": "2021-02-02T12:15:41.000000Z",
                  "updated_at": "2021-02-02T12:15:41.000000Z",
                  "brand": {
                      "id": 6,
                      "name": "ut",
                      "created_at": "2021-02-02T12:15:41.000000Z",
                      "updated_at": "2021-02-02T12:15:41.000000Z",
                      "organization": {
                          "id": 10,
                          "name": "Wintheiser, Barton and Beahan",
                          "created_at": null,
                          "updated_at": null
                      }
                  }
              }
         }
     ]
}

Example response (404, Group not found):


Could not find the Group associated with the ID that was given.

Example response (409, Conflict):


The Group attempted to edit did not fall under the same Team as the given Membership and is thus unauthorized to be edited.

Request   

PATCH api/group/edit/{id}

URL Parameters

id  integer  
The ID of the Group that you want to edit.

Body Parameters

membership_token  string  
The Membership access-token that came back when logged in.

name  string optional  
The new name of the Group that you want to edit.

Destroy

requires authentication

Destroys a single or list of Groups based on the IDs given in the parameters.

Example request:

curl -X DELETE \
    "api-apostle.com/api/group/delete" \
    -H "Authorization: Bearer {YOUR_AUTH_KEY}" \
    -H "Content-Type: application/json" \
    -H "Accept: application/json" \
    -d '{"membership_token":"dolores","array":"cumque"}'
const url = new URL(
    "api-apostle.com/api/group/delete"
);

let headers = {
    "Authorization": "Bearer {YOUR_AUTH_KEY}",
    "Content-Type": "application/json",
    "Accept": "application/json",
};

let body = {
    "membership_token": "dolores",
    "array": "cumque"
}

fetch(url, {
    method: "DELETE",
    headers,
    body: JSON.stringify(body),
}).then(response => response.json());

Example response (212, Deleted):


"data": {
     "items": [
         {
             "id": 6,
             "id": 8,
         }
     ]

}

Example response (409, Could not be deleted):


Some or all Groups given could not be deleted.

Request   

DELETE api/group/delete

Body Parameters

membership_token  string  
The Membership access-token that came back when logged in.

array  of optional  
id's to delete

Images

Image handling

api/images/all

requires authentication

Example request:

curl -X GET \
    -G "api-apostle.com/api/images/all" \
    -H "Authorization: Bearer {YOUR_AUTH_KEY}" \
    -H "Content-Type: application/json" \
    -H "Accept: application/json"
const url = new URL(
    "api-apostle.com/api/images/all"
);

let headers = {
    "Authorization": "Bearer {YOUR_AUTH_KEY}",
    "Content-Type": "application/json",
    "Accept": "application/json",
};

fetch(url, {
    method: "GET",
    headers,
}).then(response => response.json());

Example response (500):

{
    "success": false,
    "code": 113,
    "locale": "nl_NL",
    "message": "Unauthenticated.",
    "data": null,
    "debug": {
        "trace": {
            "class": "Illuminate\\Auth\\AuthenticationException",
            "file": "\/home\/vagrant\/feniks\/vendor\/laravel\/framework\/src\/Illuminate\/Auth\/Middleware\/Authenticate.php",
            "line": 82
        }
    }
}

Request   

GET api/images/all

Check one or more columns against a value delimited per item on semicolon ';'

requires authentication

Example request:

curl -X GET \
    -G "api-apostle.com/api/images/resolve" \
    -H "Authorization: Bearer {YOUR_AUTH_KEY}" \
    -H "Content-Type: application/json" \
    -H "Accept: application/json"
const url = new URL(
    "api-apostle.com/api/images/resolve"
);

let headers = {
    "Authorization": "Bearer {YOUR_AUTH_KEY}",
    "Content-Type": "application/json",
    "Accept": "application/json",
};

fetch(url, {
    method: "GET",
    headers,
}).then(response => response.json());

Example response (500):

{
    "success": false,
    "code": 113,
    "locale": "nl_NL",
    "message": "Unauthenticated.",
    "data": null,
    "debug": {
        "trace": {
            "class": "Illuminate\\Auth\\AuthenticationException",
            "file": "\/home\/vagrant\/feniks\/vendor\/laravel\/framework\/src\/Illuminate\/Auth\/Middleware\/Authenticate.php",
            "line": 82
        }
    }
}

Request   

GET api/images/resolve

api/images/detail/{id}

requires authentication

Example request:

curl -X GET \
    -G "api-apostle.com/api/images/detail/quo" \
    -H "Authorization: Bearer {YOUR_AUTH_KEY}" \
    -H "Content-Type: application/json" \
    -H "Accept: application/json"
const url = new URL(
    "api-apostle.com/api/images/detail/quo"
);

let headers = {
    "Authorization": "Bearer {YOUR_AUTH_KEY}",
    "Content-Type": "application/json",
    "Accept": "application/json",
};

fetch(url, {
    method: "GET",
    headers,
}).then(response => response.json());

Example response (500):

{
    "success": false,
    "code": 113,
    "locale": "nl_NL",
    "message": "Unauthenticated.",
    "data": null,
    "debug": {
        "trace": {
            "class": "Illuminate\\Auth\\AuthenticationException",
            "file": "\/home\/vagrant\/feniks\/vendor\/laravel\/framework\/src\/Illuminate\/Auth\/Middleware\/Authenticate.php",
            "line": 82
        }
    }
}

Request   

GET api/images/detail/{id}

URL Parameters

id  string  

Store

requires authentication

Stores a single Image and generates a 40x40 thumbnail

Example request:

curl -X POST \
    "api-apostle.com/api/images/create" \
    -H "Authorization: Bearer {YOUR_AUTH_KEY}" \
    -H "Content-Type: multipart/form-data" \
    -H "Accept: application/json" \
    -F "membership_token=consectetur" \
    -F "title=dolore" \
    -F "description=voluptas" \
    -F "alt=non" \
    -F "image=@/tmp/phpduvEI8" 
const url = new URL(
    "api-apostle.com/api/images/create"
);

let headers = {
    "Authorization": "Bearer {YOUR_AUTH_KEY}",
    "Content-Type": "multipart/form-data",
    "Accept": "application/json",
};

const body = new FormData();
body.append('membership_token', 'consectetur');
body.append('title', 'dolore');
body.append('description', 'voluptas');
body.append('alt', 'non');
body.append('image', document.querySelector('input[name="image"]').files[0]);

fetch(url, {
    method: "POST",
    headers,
    body,
}).then(response => response.json());

Example response (201, Created):


"data": {
      "items": [
         {
          "id": 132,
          "title": "title",
          "description": "description",
          "src": "images/LdQgUpRo0scMynLtEQGxK7x9VyI2jH0ly8aDHNEd.jpg",
          "filename": "php0i6liU",
          "extension": "jpeg",
          "filesize": 116082000,
          "width": 1600,
          "height": 1600,
          "alt": null,
          "thumbnail_id": 132,
          "created_at": null,
          "updated_at": null,
          "thumbnail": {
              "id": 132,
              "src": "thumbnails/php0i6liU.jpg",
              "created_at": null,
              "updated_at": null
          }
          }
      ]
  }

Request   

POST api/images/create

Body Parameters

membership_token  string  
The Membership access-token that came back when logged in.

image  file  
The Image file that you want to upload mimes:jpg,png,jpeg,gif,svg|max:4096 dimensions:min_width=100,min_height=100,max_width=1960,max_height=1080'.

title  string optional  
The Image title

description  string optional  
The Image description

alt  string optional  
The alt title

Store Multiple

requires authentication

Stores multiple Images and generates 40x40 thumbnails

Example request:

curl -X POST \
    "api-apostle.com/api/images/create/multiple" \
    -H "Authorization: Bearer {YOUR_AUTH_KEY}" \
    -H "Content-Type: multipart/form-data" \
    -H "Accept: application/json" \
    -F "membership_token=hic" \
    -F "image=@/tmp/phpqW0PWX" 
const url = new URL(
    "api-apostle.com/api/images/create/multiple"
);

let headers = {
    "Authorization": "Bearer {YOUR_AUTH_KEY}",
    "Content-Type": "multipart/form-data",
    "Accept": "application/json",
};

const body = new FormData();
body.append('membership_token', 'hic');
body.append('image', document.querySelector('input[name="image"]').files[0]);

fetch(url, {
    method: "POST",
    headers,
    body,
}).then(response => response.json());

Example response (201, Created):


"data": {
      "items": [
         {
          "id": 132,
          "title": "title",
          "description": "description",
          "src": "images/LdQgUpRo0scMynLtEQGxK7x9VyI2jH0ly8aDHNEd.jpg",
          "filename": "php0i6liU",
          "extension": "jpeg",
          "filesize": 116082000,
          "width": 1600,
          "height": 1600,
          "alt": null,
          "thumbnail_id": 132,
          "created_at": null,
          "updated_at": null,
          "thumbnail": {
              "id": 132,
              "src": "thumbnails/php0i6liU.jpg",
              "created_at": null,
              "updated_at": null
          }
          }
      ]
  }

Request   

POST api/images/create/multiple

Body Parameters

membership_token  string  
The Membership access-token that came back when logged in.

image  file  
The Image file that you want to upload mimes:jpg,png,jpeg,gif,svg|max:4096 dimensions:min_width=100,min_height=100,max_width=1960,max_height=1080'. Multiple files can be added to request. indexed or assoc keys possible, doesnt matter

api/images/edit/{id}

requires authentication

Example request:

curl -X PATCH \
    "api-apostle.com/api/images/edit/veritatis" \
    -H "Authorization: Bearer {YOUR_AUTH_KEY}" \
    -H "Content-Type: application/json" \
    -H "Accept: application/json"
const url = new URL(
    "api-apostle.com/api/images/edit/veritatis"
);

let headers = {
    "Authorization": "Bearer {YOUR_AUTH_KEY}",
    "Content-Type": "application/json",
    "Accept": "application/json",
};

fetch(url, {
    method: "PATCH",
    headers,
}).then(response => response.json());

Request   

PATCH api/images/edit/{id}

URL Parameters

id  string  

api/images/delete

requires authentication

Example request:

curl -X DELETE \
    "api-apostle.com/api/images/delete" \
    -H "Authorization: Bearer {YOUR_AUTH_KEY}" \
    -H "Content-Type: application/json" \
    -H "Accept: application/json"
const url = new URL(
    "api-apostle.com/api/images/delete"
);

let headers = {
    "Authorization": "Bearer {YOUR_AUTH_KEY}",
    "Content-Type": "application/json",
    "Accept": "application/json",
};

fetch(url, {
    method: "DELETE",
    headers,
}).then(response => response.json());

Request   

DELETE api/images/delete

Invites

API-calls to manage and view the Invites.

Accept

requires authentication

Accepts an Invite based on the token given in the email.

Example request:

curl -X POST \
    "api-apostle.com/api/invite/accept/dolor" \
    -H "Authorization: Bearer {YOUR_AUTH_KEY}" \
    -H "Content-Type: application/json" \
    -H "Accept: application/json" \
    -d '{"password":"illo","email":"velit","first_name":"est","last_name":"fuga"}'
const url = new URL(
    "api-apostle.com/api/invite/accept/dolor"
);

let headers = {
    "Authorization": "Bearer {YOUR_AUTH_KEY}",
    "Content-Type": "application/json",
    "Accept": "application/json",
};

let body = {
    "password": "illo",
    "email": "velit",
    "first_name": "est",
    "last_name": "fuga"
}

fetch(url, {
    method: "POST",
    headers,
    body: JSON.stringify(body),
}).then(response => response.json());

Example response (200, success):


"data": {
     "user_token": "eyJ0eXAiOiJKV1QiLCJhbGciOiJSUzI1NiJ9.eyJhdWQiOiIxIiwianRpIjoiY2NlOTYzNTI3ZGNhZTE3ZDA5N2Q4ZDRkZTFkZTg2YmM0ODU4OGU3MzI4YWZlN2UwODhjOGY3ZDg5ODVlOWJjNWQ3MDY4OTc4MWQxZDRlNTAiLCJpYXQiOiIxNjEwOTcxNTg0LjUyNTQwNiIsIm5iZiI6IjE2MTA5NzE1ODQuNTI1NDM5IiwiZXhwIjoiMTY0MjUwNzU4NC40ODczNDIiLCJzdWIiOiIxMDEiLCJzY29wZXMiOltdfQ.rShoJwanYO6zgXmkR3aEoZYYGOUgyRh4qcKWat_B5l42-jFMLbWrw2CoTvLSijJTGQ-rApCH0qyZTjm8eTKQ3aRVwdXYUc24jjjVRrpzosWDGXl8OnkSueM6V23QUU8rUYjwoPoQlBiPihS3xFDRDyR0szuD0YIhVDN_CsO14naW2SbqSuPqtVolW2GAXICN8Ily7N0kk-4vZ4ZeeIhGJocHlBlmwEtjjcM5yN6he7oL1QhN8UeCdJDDREIa3aflf6xrN9mGtYUDDRhZ6ScA5GrQrfyMHfteT6iZZpMyXFKZbufYlzyub2m4lyeYTqZdTHM38d1X9ByBmHgsiS0ZWHyWDe5u9mh2bDXzFPNp91ssOmgUaLjG683FgxgjqWqznzBi0exD-wXRCMRoTaYN1-A2xQWYDZy_AxR9mEZPKgy5YByMPACnEhBwKhhfEdz7eO8itZZOohy2766KIJ_aOl0Fw_tm4dZLdQPJRungDGXG2dWWA35OaW3H9Yi6Z8LyEnxIclrACTcdiXvirYP6pb86bkAhzxBUHRKbHYEyNKalEMVIBoThGKkoiZ_yZ2s1vh0ZQl7lHQvlBbIfMGRDBT62Kxu3vvajUo_Fkgy5dqFM8aLpqbjlzMVqB9sQkVg1niK8B7QtA-3Z8gwNUB0nCpH_MKZTxn02pYBr-DjVwVQ",
     "membership_token": "eyJpdiI6ImJVUGNNZldDcDFXOWZjSEhxWko2TUE9PSIsInZhbHVlIjoiKzNOYnArdjNMeWE0eXNYWUVpTGNUUT09IiwibWFjIjoiNjI4NGM3OTdkNDI3ZDM2ZjA3ZTI2MzQ2OGQ4MGQxYjY0OGZjNDgxZTQ0OTYyMWMzOTMzNTY1NzE2MDZhOTYyYiJ9"
}

Example response (401, Unauthorized):


The Invite you're trying to send does not belong to your Team.

Example response (404, Invite not found):


The invite you're trying to accept can not be found.

Example response (409, Conflict):


The new user could not be logged in.

Example response (400, Bad Request):


Either the token could not be found, or the User already has a Membership with that Team.

Request   

POST api/invite/accept/{inviteToken}

URL Parameters

inviteToken  string  

token  string  
The token that came in the email, used to log in for the first time.

Body Parameters

password  string  
The password of the account you're either trying to log in with, or the password you want to use for the newly made account.

email  string optional  
The email associated with the account that you already have an account with.

first_name  string optional  
The first name you want your user account to display.

last_name  string optional  
The last name you want your use account to display.

Send

requires authentication

Send a created Invite to the email address in the object.

Example request:

curl -X GET \
    -G "api-apostle.com/api/invite/send/suscipit" \
    -H "Authorization: Bearer {YOUR_AUTH_KEY}" \
    -H "Content-Type: application/json" \
    -H "Accept: application/json" \
    -d '{"membership_token":"modi"}'
const url = new URL(
    "api-apostle.com/api/invite/send/suscipit"
);

let headers = {
    "Authorization": "Bearer {YOUR_AUTH_KEY}",
    "Content-Type": "application/json",
    "Accept": "application/json",
};

let body = {
    "membership_token": "modi"
}

fetch(url, {
    method: "GET",
    headers,
    body: JSON.stringify(body),
}).then(response => response.json());

Example response (200, success):


"data": {
     "items": [
         {
             "id": 101,
             "state": "pending",
             "token": "ZiBzVqTGkConoJQ0GVVhI65KE7cA38HG8P8CovPOC12nfdXlaSwN7sISnY2gmv5v",
             "email": "test@gmail.com",
             "name": "mister master man",
             "role": {
                   "id": 1,
                   "name": "Ambassador",
                   "level": "user",
                   "created_at": "2021-01-13T08:14:25.000000Z",
                   "updated_at": "2021-01-13T08:14:25.000000Z",
             },
             "sent_at": "2021-01-18T12:02:45.677520Z",
             "accepted_at": null,
             "message": "Ik ben een testbericht!",
             "created_at": "2021-01-18T12:01:29.000000Z",
             "updated_at": "2021-01-18T12:02:45.000000Z",
              "team": {
                  "id": 8,
                  "name": "Pfannerstill, Halvorson and Marquardt",
                  "domain": "herman",
                  "logo": "https://lorempixel.com/640/480/?51237",
                  "created_at": "2021-02-02T12:15:41.000000Z",
                  "updated_at": "2021-02-02T12:15:41.000000Z",
                  "brand": {
                      "id": 6,
                      "name": "ut",
                      "created_at": "2021-02-02T12:15:41.000000Z",
                      "updated_at": "2021-02-02T12:15:41.000000Z",
                      "organization": {
                          "id": 10,
                          "name": "Wintheiser, Barton and Beahan",
                          "created_at": null,
                          "updated_at": null
                      }
                  }
              }
         }
     ]
}

Example response (401, Unauthorized):


The Invite you're trying to send does not belong to your Team.

Example response (404, No Invite found):


There was no Invite found with that ID.

Request   

GET api/invite/send/{invite}

URL Parameters

invite  string  

id  integer  
The ID of the Invite that you want to send out.

Body Parameters

membership_token  string  
The Invite access-token that came back when logged in

Resolve

requires authentication

Search an Invite with the given attributes.

Example request:

curl -X GET \
    -G "api-apostle.com/api/invite/resolve" \
    -H "Authorization: Bearer {YOUR_AUTH_KEY}" \
    -H "Content-Type: application/json" \
    -H "Accept: application/json" \
    -d '{"membership_token":"nostrum","search_query":"dolore"}'
const url = new URL(
    "api-apostle.com/api/invite/resolve"
);

let headers = {
    "Authorization": "Bearer {YOUR_AUTH_KEY}",
    "Content-Type": "application/json",
    "Accept": "application/json",
};

let body = {
    "membership_token": "nostrum",
    "search_query": "dolore"
}

fetch(url, {
    method: "GET",
    headers,
    body: JSON.stringify(body),
}).then(response => response.json());

Example response (200, success):


"data": {
     "items": [
         {
             "id": 1,
             "state": "pending",
             "token": "PakN8cRgw2vydzxYj4m7pplJMTYX35O0aCkl3mXBYTWrxqtrOvumOZKoy7xQbl6o",
             "email": "iharris@hotmail.com",
             "name": "Blaze Veum",
             "role": {
                   "id": 1,
                   "name": "Ambassador",
                   "level": "user",
                   "created_at": "2021-01-13T08:14:25.000000Z",
                   "updated_at": "2021-01-13T08:14:25.000000Z"
             },
             "sent_at": null,
             "accepted_at": null,
             "message": "Lorem Ipsum is slechts een proeftekst uit het drukkerij- en zetterijwezen.",
             "created_at": "1994-09-13T13:44:09.000000Z",
             "updated_at": "1991-03-14T03:15:05.000000Z",
              "team": {
                  "id": 8,
                  "name": "Pfannerstill, Halvorson and Marquardt",
                  "domain": "herman",
                  "logo": "https://lorempixel.com/640/480/?51237",
                  "created_at": "2021-02-02T12:15:41.000000Z",
                  "updated_at": "2021-02-02T12:15:41.000000Z",
                  "brand": {
                      "id": 6,
                      "name": "ut",
                      "created_at": "2021-02-02T12:15:41.000000Z",
                      "updated_at": "2021-02-02T12:15:41.000000Z",
                      "organization": {
                          "id": 10,
                          "name": "Wintheiser, Barton and Beahan",
                          "created_at": null,
                          "updated_at": null
                      }
                  }
              }
         }
     ]
}

Example response (404, No Invites found):


There were no Invites found based on the query given.

Request   

GET api/invite/resolve

Body Parameters

membership_token  string  
The Invite access-token that came back when logged in

search_query  string  
Any kind of attribute you want to query on, separating the attribute from the value with a semicolon. ("id;4 team_id;8")

Index

requires authentication

Retrieve all Invites under the same Team of the given Membership

Example request:

curl -X GET \
    -G "api-apostle.com/api/invite/all" \
    -H "Authorization: Bearer {YOUR_AUTH_KEY}" \
    -H "Content-Type: application/json" \
    -H "Accept: application/json" \
    -d '{"membership_token":"dicta","pagination":"\"2,3\" The first number will be the amount of items per page, the second is the current page you want to access"}'
const url = new URL(
    "api-apostle.com/api/invite/all"
);

let headers = {
    "Authorization": "Bearer {YOUR_AUTH_KEY}",
    "Content-Type": "application/json",
    "Accept": "application/json",
};

let body = {
    "membership_token": "dicta",
    "pagination": "\"2,3\" The first number will be the amount of items per page, the second is the current page you want to access"
}

fetch(url, {
    method: "GET",
    headers,
    body: JSON.stringify(body),
}).then(response => response.json());

Example response (200, success):


"data": {
     "items": [
         {
             "id": 1,
             "state": "pending",
             "token": "PakN8cRgw2vydzxYj4m7pplJMTYX35O0aCkl3mXBYTWrxqtrOvumOZKoy7xQbl6o",
             "email": "iharris@hotmail.com",
             "name": "Blaze Veum",
             "role_id": 1,
             "role": {
                   "id": 1,
                   "name": "Ambassador",
                   "level": "user",
                   "created_at": "2021-01-13T08:14:25.000000Z",
                   "updated_at": "2021-01-13T08:14:25.000000Z",
             },
             "sent_at": null,
             "accepted_at": null,
             "message": "Lorem Ipsum is slechts een proeftekst uit het drukkerij- en zetterijwezen.",
             "created_at": "1994-09-13T13:44:09.000000Z",
             "updated_at": "1991-03-14T03:15:05.000000Z",
              "team_id": 8,
              "team": {
                  "id": 8,
                  "name": "Pfannerstill, Halvorson and Marquardt",
                  "domain": "herman",
                  "logo": "https://lorempixel.com/640/480/?51237",
                  "created_at": "2021-02-02T12:15:41.000000Z",
                  "updated_at": "2021-02-02T12:15:41.000000Z",
                  "brand_id": 6,
                  "brand": {
                      "id": 6,
                      "name": "ut",
                      "created_at": "2021-02-02T12:15:41.000000Z",
                      "updated_at": "2021-02-02T12:15:41.000000Z",
                      "organization_id": 10,
                      "organization": {
                          "id": 10,
                          "name": "Wintheiser, Barton and Beahan",
                          "created_at": null,
                          "updated_at": null
                      }
                  }
              }
         }
     ]
}

Example response (404, No Invites found):


There were no Invites found within our database.

Request   

GET api/invite/all

Body Parameters

membership_token  string  
The Membership access-token that came back when logged in

pagination  string  
The amount of items you want per page and the page you want to access separated by a comma.

Show

requires authentication

Show the details of an Invite that is available under the same Team,.

Example request:

curl -X GET \
    -G "api-apostle.com/api/invite/detail/13" \
    -H "Authorization: Bearer {YOUR_AUTH_KEY}" \
    -H "Content-Type: application/json" \
    -H "Accept: application/json" \
    -d '{"membership_token":"eius"}'
const url = new URL(
    "api-apostle.com/api/invite/detail/13"
);

let headers = {
    "Authorization": "Bearer {YOUR_AUTH_KEY}",
    "Content-Type": "application/json",
    "Accept": "application/json",
};

let body = {
    "membership_token": "eius"
}

fetch(url, {
    method: "GET",
    headers,
    body: JSON.stringify(body),
}).then(response => response.json());

Example response (200, success):


"data": {
     "items": [
         {
              "id": 1,
              "state": "pending",
              "token": "PakN8cRgw2vydzxYj4m7pplJMTYX35O0aCkl3mXBYTWrxqtrOvumOZKoy7xQbl6o",
              "email": "iharris@hotmail.com",
              "name": "Blaze Veum",
              "role": {
                    "id": 1,
                    "name": "Ambassador",
                    "level": "user",
                    "created_at": "2021-01-13T08:14:25.000000Z",
                    "updated_at": "2021-01-13T08:14:25.000000Z",
              },
              "sent_at": null,
              "accepted_at": null,
              "message": "Lorem Ipsum is slechts een proeftekst uit het drukkerij- en zetterijwezen.",
              "created_at": "1994-09-13T13:44:09.000000Z",
              "updated_at": "1991-03-14T03:15:05.000000Z",
              "team": {
                  "id": 8,
                  "name": "Pfannerstill, Halvorson and Marquardt",
                  "domain": "herman",
                  "logo": "https://lorempixel.com/640/480/?51237",
                  "created_at": "2021-02-02T12:15:41.000000Z",
                  "updated_at": "2021-02-02T12:15:41.000000Z",
                  "brand": {
                      "id": 6,
                      "name": "ut",
                      "created_at": "2021-02-02T12:15:41.000000Z",
                      "updated_at": "2021-02-02T12:15:41.000000Z",
                      "organization": {
                          "id": 10,
                          "name": "Wintheiser, Barton and Beahan",
                          "created_at": null,
                          "updated_at": null
                      }
                  }
              }
           }
      ]
}

Example response (404, No Invite found):


There was no Invite found with that ID.

Example response (409, Conflict):


The Invite you're trying to see does not fall under your Team, thus you are unauthorized.

Request   

GET api/invite/detail/{id}

URL Parameters

id  integer  
The ID of the Membership that you want to show.

Body Parameters

membership_token  string  
The Membership access-token that came back when logged in.

Store

requires authentication

Stores a single Invite with the given parameters as attributes of said Invite.

Example request:

curl -X POST \
    "api-apostle.com/api/invite/create" \
    -H "Authorization: Bearer {YOUR_AUTH_KEY}" \
    -H "Content-Type: application/json" \
    -H "Accept: application/json" \
    -d '{"membership_token":"perspiciatis","team_id":12,"state":"cupiditate","name":"ea","token":"voluptatibus","email":"fugit","role_id":1,"message":"maiores"}'
const url = new URL(
    "api-apostle.com/api/invite/create"
);

let headers = {
    "Authorization": "Bearer {YOUR_AUTH_KEY}",
    "Content-Type": "application/json",
    "Accept": "application/json",
};

let body = {
    "membership_token": "perspiciatis",
    "team_id": 12,
    "state": "cupiditate",
    "name": "ea",
    "token": "voluptatibus",
    "email": "fugit",
    "role_id": 1,
    "message": "maiores"
}

fetch(url, {
    method: "POST",
    headers,
    body: JSON.stringify(body),
}).then(response => response.json());

Example response (201, success):


"data": {
     "items": [
         {
             "state": "pending",
             "name": "mister master man",
             "token": "ZiBzVqTGkConoJQ0GVVhI65KE7cA38HG8P8CovPOC12nfdXlaSwN7sISnY2gmv5v",
             "email": "test@gmail.com",
             "role": {
                   "id": 1,
                   "name": "Ambassador",
                   "level": "user",
                   "created_at": "2021-01-13T08:14:25.000000Z",
                   "updated_at": "2021-01-13T08:14:25.000000Z",
             },
             "message": "Ik ben een testbericht!",
             "updated_at": "2021-01-18T12:01:29.000000Z",
             "created_at": "2021-01-18T12:01:29.000000Z",
             "id": 101,
              "team": {
                  "id": 8,
                  "name": "Pfannerstill, Halvorson and Marquardt",
                  "domain": "herman",
                  "logo": "https://lorempixel.com/640/480/?51237",
                  "created_at": "2021-02-02T12:15:41.000000Z",
                  "updated_at": "2021-02-02T12:15:41.000000Z",
                  "brand": {
                      "id": 6,
                      "name": "ut",
                      "created_at": "2021-02-02T12:15:41.000000Z",
                      "updated_at": "2021-02-02T12:15:41.000000Z",
                      "organization": {
                          "id": 10,
                          "name": "Wintheiser, Barton and Beahan",
                          "created_at": null,
                          "updated_at": null
                      }
                  }
              }
         }
     ]
}

Example response (400, Wrong values):


The given values to create the Invite either already exist within the database or are of the wrong type.

Example response (409, Could not be created):


The Invite could not be created.

Request   

POST api/invite/create

Body Parameters

membership_token  string  
The Membership access-token that came back when logged in.

team_id  integer  
The ID of the Team that the Invite belongs to.

state  string optional  
The state of the Invite.

name  string optional  
The Name of the recipient of the Invite.

token  string optional  
The token required to log in for the first time through the Invite.

email  string  
The email address that the Invite will be sent to.

role_id  integer  
The Role-level that the invitee will have upon logging in for the first time.

message  string optional  
A message to be sent together with the email to the invitee.

Update

requires authentication

Updates a single Invite with the given parameters as the new attributes of the given Invite.

Example request:

curl -X PATCH \
    "api-apostle.com/api/invite/edit/illum" \
    -H "Authorization: Bearer {YOUR_AUTH_KEY}" \
    -H "Content-Type: application/json" \
    -H "Accept: application/json" \
    -d '{"membership_token":"illo","state":"aut","role_id":8,"message":"provident","sent_at":"voluptate","accepted_at":"beatae"}'
const url = new URL(
    "api-apostle.com/api/invite/edit/illum"
);

let headers = {
    "Authorization": "Bearer {YOUR_AUTH_KEY}",
    "Content-Type": "application/json",
    "Accept": "application/json",
};

let body = {
    "membership_token": "illo",
    "state": "aut",
    "role_id": 8,
    "message": "provident",
    "sent_at": "voluptate",
    "accepted_at": "beatae"
}

fetch(url, {
    method: "PATCH",
    headers,
    body: JSON.stringify(body),
}).then(response => response.json());

Example response (200, success):


"data": {
     "items": [
         {
             "id": 1,
             "state": "pending",
             "token": "PakN8cRgw2vydzxYj4m7pplJMTYX35O0aCkl3mXBYTWrxqtrOvumOZKoy7xQbl6o",
             "email": "iharris@hotmail.com",
             "name": "Blaze Veum",
             "role": {
                   "id": 1,
                   "name": "Ambassador",
                   "level": "user",
                   "created_at": "2021-01-13T08:14:25.000000Z",
                   "updated_at": "2021-01-13T08:14:25.000000Z",
             },
             "sent_at": null,
             "accepted_at": null,
             "message": "Lorem Ipsum is slechts een proeftekst uit het drukkerij- en zetterijwezen.",
             "created_at": "1994-09-13T13:44:09.000000Z",
             "updated_at": "2021-01-19T09:03:15.000000Z",
              "team": {
                  "id": 8,
                  "name": "Pfannerstill, Halvorson and Marquardt",
                  "domain": "herman",
                  "logo": "https://lorempixel.com/640/480/?51237",
                  "created_at": "2021-02-02T12:15:41.000000Z",
                  "updated_at": "2021-02-02T12:15:41.000000Z",
                  "brand": {
                      "id": 6,
                      "name": "ut",
                      "created_at": "2021-02-02T12:15:41.000000Z",
                      "updated_at": "2021-02-02T12:15:41.000000Z",
                      "organization": {
                          "id": 10,
                          "name": "Wintheiser, Barton and Beahan",
                          "created_at": null,
                          "updated_at": null
                      }
                  }
              }
         }
     ]
}

Example response (404, Invite not found):


Could not find the Invite associated with the ID that was given.

Example response (409, Conflict):


The Invite you're trying to access does not belong to your Team.

Request   

PATCH api/invite/edit/{id}

URL Parameters

id  string  

Body Parameters

membership_token  string  
The Membership access-token that came back when logged in.

state  string optional  
The new state that the Invite will have.

role_id  integer optional  
The new ID of the role-level the user will have upon logging in for the first time.

message  string optional  
The new message to be sent together with the email to the invitee.

sent_at  date optional  
The date the message was sent on.

accepted_at  date optional  
The date the Invite was accepted on.

Destroy

requires authentication

Destroys a single or list of Invites based on the IDs given in the parameters.

Example request:

curl -X DELETE \
    "api-apostle.com/api/invite/delete" \
    -H "Authorization: Bearer {YOUR_AUTH_KEY}" \
    -H "Content-Type: application/json" \
    -H "Accept: application/json" \
    -d '{"membership_token":"recusandae","array":"ratione"}'
const url = new URL(
    "api-apostle.com/api/invite/delete"
);

let headers = {
    "Authorization": "Bearer {YOUR_AUTH_KEY}",
    "Content-Type": "application/json",
    "Accept": "application/json",
};

let body = {
    "membership_token": "recusandae",
    "array": "ratione"
}

fetch(url, {
    method: "DELETE",
    headers,
    body: JSON.stringify(body),
}).then(response => response.json());

Example response (212, Deleted):


"data": {
     "items": [
         {
             "id": 1,
             "id": 3,
         }
     ]
}

Example response (409, Could not be deleted):


Some or all Invites given could not be deleted.

Request   

DELETE api/invite/delete

Body Parameters

membership_token  string  
The Membership access-token that came back when logged in.

array  of optional  
id's to delete

Memberships

API-calls to manage and view the Memberships.

Assign Role

requires authentication

Assign a Role to a Membership

Example request:

curl -X POST \
    "api-apostle.com/api/membership/assign/role/reiciendis/ut" \
    -H "Authorization: Bearer {YOUR_AUTH_KEY}" \
    -H "Content-Type: application/json" \
    -H "Accept: application/json" \
    -d '{"membership_token":"voluptate","membership_id":"maxime"}'
const url = new URL(
    "api-apostle.com/api/membership/assign/role/reiciendis/ut"
);

let headers = {
    "Authorization": "Bearer {YOUR_AUTH_KEY}",
    "Content-Type": "application/json",
    "Accept": "application/json",
};

let body = {
    "membership_token": "voluptate",
    "membership_id": "maxime"
}

fetch(url, {
    method: "POST",
    headers,
    body: JSON.stringify(body),
}).then(response => response.json());

Example response (404, No Roles found):


There were no Roles found based on the query given.

Request   

POST api/membership/assign/role/{membership}/{role}

URL Parameters

membership  string  

role  string  

Body Parameters

membership_token  string  
The Membership access-token that came back when logged in

membership_id  string  
The Membership id tho assign a Role to

Resolve

requires authentication

Search and filter trough Memberships within your team/brand/org and retrieve the User objects related to those Memberships Every search parameter can bu used with multiple search-terms by concatenating the term with a semicolon like this (term1;term2;term3)

Example request:

curl -X GET \
    -G "api-apostle.com/api/membership/resolve" \
    -H "Authorization: Bearer {YOUR_AUTH_KEY}" \
    -H "Content-Type: application/json" \
    -H "Accept: application/json" \
    -d '{"membership_token":"facilis","type":"nihil","pagination":"\"2,3\" The first number will be the amount of items per page, the second is the current page you want to access","membership_role":11,"membership_ghost":true,"user_first_name":"sequi","user_last_name":"eaque","user_dob":"qui","user_email":"quidem","user_phone":"dolorem","user_language":"expedita"}'
const url = new URL(
    "api-apostle.com/api/membership/resolve"
);

let headers = {
    "Authorization": "Bearer {YOUR_AUTH_KEY}",
    "Content-Type": "application/json",
    "Accept": "application/json",
};

let body = {
    "membership_token": "facilis",
    "type": "nihil",
    "pagination": "\"2,3\" The first number will be the amount of items per page, the second is the current page you want to access",
    "membership_role": 11,
    "membership_ghost": true,
    "user_first_name": "sequi",
    "user_last_name": "eaque",
    "user_dob": "qui",
    "user_email": "quidem",
    "user_phone": "dolorem",
    "user_language": "expedita"
}

fetch(url, {
    method: "GET",
    headers,
    body: JSON.stringify(body),
}).then(response => response.json());

Example response (404, No Memberships found):


There were no Memberships found based on the query given.

Request   

GET api/membership/resolve

Body Parameters

membership_token  string  
The Membership access-token that came back when logged in

type  string optional  
The level of indexing you want to have of all Memberships. (team, brand, organization)

pagination  string  
The amount of items you want per page and the page you want to access separated by a comma.

membership_role  integer optional  
Filter on Role

membership_ghost  boolean optional  
Filter on Ghost

user_first_name  string optional  
Filter on First name

user_last_name  string optional  
Filter on Last name

user_dob  string optional  
Filter on Date of birth format(d-m-Y)

user_email  string optional  
Filter on E-mail

user_phone  string optional  
Filter on Phone number

user_language  string optional  
Filter on Language

Me

requires authentication

Get the details of the authenticated Membership

Example request:

curl -X GET \
    -G "api-apostle.com/api/membership/me" \
    -H "Authorization: Bearer {YOUR_AUTH_KEY}" \
    -H "Content-Type: application/json" \
    -H "Accept: application/json" \
    -d '{"membership_token":"eaque"}'
const url = new URL(
    "api-apostle.com/api/membership/me"
);

let headers = {
    "Authorization": "Bearer {YOUR_AUTH_KEY}",
    "Content-Type": "application/json",
    "Accept": "application/json",
};

let body = {
    "membership_token": "eaque"
}

fetch(url, {
    method: "GET",
    headers,
    body: JSON.stringify(body),
}).then(response => response.json());

Request   

GET api/membership/me

Body Parameters

membership_token  string  
The Membership access-token that came back when logged in

Index

requires authentication

Retrieve all Memberships under the same Team, Brand or Organization

Example request:

curl -X GET \
    -G "api-apostle.com/api/membership/all" \
    -H "Authorization: Bearer {YOUR_AUTH_KEY}" \
    -H "Content-Type: application/json" \
    -H "Accept: application/json" \
    -d '{"membership_token":"saepe","type":"et","pagination":"\"2,3\" The first number will be the amount of items per page, the second is the current page you want to access"}'
const url = new URL(
    "api-apostle.com/api/membership/all"
);

let headers = {
    "Authorization": "Bearer {YOUR_AUTH_KEY}",
    "Content-Type": "application/json",
    "Accept": "application/json",
};

let body = {
    "membership_token": "saepe",
    "type": "et",
    "pagination": "\"2,3\" The first number will be the amount of items per page, the second is the current page you want to access"
}

fetch(url, {
    method: "GET",
    headers,
    body: JSON.stringify(body),
}).then(response => response.json());

Example response (404, No Memberships found):


There were no Memberships found within our database.

Request   

GET api/membership/all

Body Parameters

membership_token  string  
The Membership access-token that came back when logged in

type  string optional  
The level of indexing you want to have of all Memberships. (team, brand, organization)

pagination  string  
The amount of items you want per page and the page you want to access separated by a comma.

Store

requires authentication

Stores a single Membership with the given parameters as attributes of said Membership.

Example request:

curl -X POST \
    "api-apostle.com/api/membership/create" \
    -H "Authorization: Bearer {YOUR_AUTH_KEY}" \
    -H "Content-Type: application/json" \
    -H "Accept: application/json" \
    -d '{"membership_token":"culpa","user_id":19,"team_id":10,"role_id":11,"ghost":true}'
const url = new URL(
    "api-apostle.com/api/membership/create"
);

let headers = {
    "Authorization": "Bearer {YOUR_AUTH_KEY}",
    "Content-Type": "application/json",
    "Accept": "application/json",
};

let body = {
    "membership_token": "culpa",
    "user_id": 19,
    "team_id": 10,
    "role_id": 11,
    "ghost": true
}

fetch(url, {
    method: "POST",
    headers,
    body: JSON.stringify(body),
}).then(response => response.json());

Example response (201, success):


"data": {
     "items": [
         {
             "updated_at": "2021-01-13T08:46:55.000000Z",
             "created_at": "2021-01-13T08:46:55.000000Z",
             "id": 134,
              "team": {
                  "id": 8,
                  "name": "Pfannerstill, Halvorson and Marquardt",
                  "domain": "herman",
                  "logo": "https://lorempixel.com/640/480/?51237",
                  "created_at": "2021-02-02T12:15:41.000000Z",
                  "updated_at": "2021-02-02T12:15:41.000000Z",
                  "brand": {
                      "id": 6,
                      "name": "ut",
                      "created_at": "2021-02-02T12:15:41.000000Z",
                      "updated_at": "2021-02-02T12:15:41.000000Z",
                      "organization": {
                          "id": 10,
                          "name": "Wintheiser, Barton and Beahan",
                          "created_at": null,
                          "updated_at": null
                      }
                  }
              },
              "role": {
                     "id": 6,
                     "name": "Apostle Software-engineer",
                     "level": "developer",
                     "created_at": "2021-02-02T12:15:42.000000Z",
                     "updated_at": "2021-02-02T12:15:42.000000Z"
               },
               "user": {
                     "id": 1,
                     "first_name": "Wava",
                     "last_name": "Purdy",
                     "dob": "1999-08-20",
                     "email": "test@apostle.nl",
                     "phone": "441-775-9608",
                     "email_verified_at": "1977-12-28T23:00:00.000000Z",
                     "consent": 0,
                     "avatar": "https://lorempixel.com/640/480/?37555",
                     "language": "nl",
                     "created_at": "2021-02-02T12:15:43.000000Z",
                     "deleted_at": null,
                     "provider": null,
                     "provider_id": null
               }
         }
     ]
}

Example response (400, Wrong values):


The given values to create the Membership either already exist within the database or are of the wrong type.

Example response (409, Could not be created):


The Membership could not be created.

Request   

POST api/membership/create

Body Parameters

membership_token  string  
The Membership access-token that came back when logged in.

user_id  integer  
The ID of the User that the Membership you are creating belongs to.

team_id  integer  
The ID of the Team that the Membership you are creating belongs to.

role_id  integer  
The ID of the Role that the Membership you are creating has.

ghost  boolean optional  
A boolean representing if the User is a ghost within the Team. (0, 1)

Show

requires authentication

Show the details of a Membership that is available under the same Team, Brand or Organization.

Example request:

curl -X GET \
    -G "api-apostle.com/api/membership/detail/12" \
    -H "Authorization: Bearer {YOUR_AUTH_KEY}" \
    -H "Content-Type: application/json" \
    -H "Accept: application/json" \
    -d '{"membership_token":"et","type":"inventore"}'
const url = new URL(
    "api-apostle.com/api/membership/detail/12"
);

let headers = {
    "Authorization": "Bearer {YOUR_AUTH_KEY}",
    "Content-Type": "application/json",
    "Accept": "application/json",
};

let body = {
    "membership_token": "et",
    "type": "inventore"
}

fetch(url, {
    method: "GET",
    headers,
    body: JSON.stringify(body),
}).then(response => response.json());

Example response (200, success):


"data": {
     "items": [
         {
             "id": 6,
             "last_login": "1995-09-18 00:00:00",
             "ghost": 0,
             "created_at": "2021-01-13T08:14:25.000000Z",
             "updated_at": "2021-01-13T08:14:25.000000Z",
              "team": {
                  "id": 8,
                  "name": "Pfannerstill, Halvorson and Marquardt",
                  "domain": "herman",
                  "logo": "https://lorempixel.com/640/480/?51237",
                  "created_at": "2021-02-02T12:15:41.000000Z",
                  "updated_at": "2021-02-02T12:15:41.000000Z",
                  "brand": {
                      "id": 6,
                      "name": "ut",
                      "created_at": "2021-02-02T12:15:41.000000Z",
                      "updated_at": "2021-02-02T12:15:41.000000Z",
                      "organization": {
                          "id": 10,
                          "name": "Wintheiser, Barton and Beahan",
                          "created_at": null,
                          "updated_at": null
                      }
                  }
              },
              "role": {
                     "id": 6,
                     "name": "Apostle Software-engineer",
                     "level": "developer",
                     "created_at": "2021-02-02T12:15:42.000000Z",
                     "updated_at": "2021-02-02T12:15:42.000000Z"
               },
               "user": {
                     "id": 1,
                     "first_name": "Wava",
                     "last_name": "Purdy",
                     "dob": "1999-08-20",
                     "email": "test@apostle.nl",
                     "phone": "441-775-9608",
                     "email_verified_at": "1977-12-28T23:00:00.000000Z",
                     "consent": 0,
                     "avatar": "https://lorempixel.com/640/480/?37555",
                     "language": "nl",
                     "created_at": "2021-02-02T12:15:43.000000Z",
                     "deleted_at": null,
                     "provider": null,
                     "provider_id": null
               }
         }
     ]
}

Example response (404, No Membership found):


There was no Membership found with that ID.

Example response (409, Conflict):


The Membership you're trying to see does not fall under your Team, Brand or Organization thus you are unauthorized.

Request   

GET api/membership/detail/{id}

URL Parameters

id  integer  
The ID of the Membership that you want to show.

Body Parameters

membership_token  string  
The Membership access-token that came back when logged in.

type  string optional  
The level of indexing you want to have of all Memberships. (team, brand, organization)

Update

requires authentication

Updates a single Membership with the given parameters as the new attributes of the given Membership.

Example request:

curl -X PATCH \
    "api-apostle.com/api/membership/edit/9" \
    -H "Authorization: Bearer {YOUR_AUTH_KEY}" \
    -H "Content-Type: application/json" \
    -H "Accept: application/json" \
    -d '{"membership_token":"nam","role_id":2,"ghost":false}'
const url = new URL(
    "api-apostle.com/api/membership/edit/9"
);

let headers = {
    "Authorization": "Bearer {YOUR_AUTH_KEY}",
    "Content-Type": "application/json",
    "Accept": "application/json",
};

let body = {
    "membership_token": "nam",
    "role_id": 2,
    "ghost": false
}

fetch(url, {
    method: "PATCH",
    headers,
    body: JSON.stringify(body),
}).then(response => response.json());

Example response (200, success):


"data": {
     "items": [
         {
             "id": 21,
             "last_login": "2014-09-15 00:00:00",
             "ghost": 0,
             "created_at": "2021-01-13T08:14:25.000000Z",
             "updated_at": "2021-01-13T08:56:33.000000Z",
              "team": {
                  "id": 8,
                  "name": "Pfannerstill, Halvorson and Marquardt",
                  "domain": "herman",
                  "logo": "https://lorempixel.com/640/480/?51237",
                  "created_at": "2021-02-02T12:15:41.000000Z",
                  "updated_at": "2021-02-02T12:15:41.000000Z",
                  "brand": {
                      "id": 6,
                      "name": "ut",
                      "created_at": "2021-02-02T12:15:41.000000Z",
                      "updated_at": "2021-02-02T12:15:41.000000Z",
                      "organization": {
                          "id": 10,
                          "name": "Wintheiser, Barton and Beahan",
                          "created_at": null,
                          "updated_at": null
                      }
                  }
              },
              "role": {
                     "id": 6,
                     "name": "Apostle Software-engineer",
                     "level": "developer",
                     "created_at": "2021-02-02T12:15:42.000000Z",
                     "updated_at": "2021-02-02T12:15:42.000000Z"
               },
               "user": {
                     "id": 1,
                     "first_name": "Wava",
                     "last_name": "Purdy",
                     "dob": "1999-08-20",
                     "email": "test@apostle.nl",
                     "phone": "441-775-9608",
                     "email_verified_at": "1977-12-28T23:00:00.000000Z",
                     "consent": 0,
                     "avatar": "https://lorempixel.com/640/480/?37555",
                     "language": "nl",
                     "created_at": "2021-02-02T12:15:43.000000Z",
                     "deleted_at": null,
                     "provider": null,
                     "provider_id": null
               }
         }
     ]
}

Example response (404, Membership not found):


Could not find the Membership associated with the ID that was given.

Example response (409, Conflict):


The Membership attempted to edit did not fall under the same Team as the given Membership and is thus unauthorized to be edited.

Request   

PATCH api/membership/edit/{id}

URL Parameters

id  integer  
The ID of the Membership that you want to edit.

Body Parameters

membership_token  string  
The Membership access-token that came back when logged in.

role_id  integer optional  
The new ID of the Role that you want to give to the Membership.

ghost  boolean optional  
The new value of the boolean signifying whether the Membership is a ghost within it's Team.

Update Me

requires authentication

Updates the authenticated Membership with the given parameters as the new attributes of the given Membership.

Example request:

curl -X PATCH \
    "api-apostle.com/api/membership/me/edit" \
    -H "Authorization: Bearer {YOUR_AUTH_KEY}" \
    -H "Content-Type: application/json" \
    -H "Accept: application/json" \
    -d '{"membership_token":"ea","role_id":7,"ghost":false}'
const url = new URL(
    "api-apostle.com/api/membership/me/edit"
);

let headers = {
    "Authorization": "Bearer {YOUR_AUTH_KEY}",
    "Content-Type": "application/json",
    "Accept": "application/json",
};

let body = {
    "membership_token": "ea",
    "role_id": 7,
    "ghost": false
}

fetch(url, {
    method: "PATCH",
    headers,
    body: JSON.stringify(body),
}).then(response => response.json());

Example response (200, success):


"data": {
     "items": [
         {
             "id": 21,
             "last_login": "2014-09-15 00:00:00",
             "ghost": 0,
             "created_at": "2021-01-13T08:14:25.000000Z",
             "updated_at": "2021-01-13T08:56:33.000000Z",
             "deleted_at": null,
              "team": {
                  "id": 8,
                  "name": "Pfannerstill, Halvorson and Marquardt",
                  "domain": "herman",
                  "logo": "https://lorempixel.com/640/480/?51237",
                  "created_at": "2021-02-02T12:15:41.000000Z",
                  "updated_at": "2021-02-02T12:15:41.000000Z",
                  "brand": {
                      "id": 6,
                      "name": "ut",
                      "created_at": "2021-02-02T12:15:41.000000Z",
                      "updated_at": "2021-02-02T12:15:41.000000Z",
                      "organization": {
                          "id": 10,
                          "name": "Wintheiser, Barton and Beahan",
                          "created_at": null,
                          "updated_at": null
                      }
                  }
              },
              "role": {
                     "id": 6,
                     "name": "Apostle Software-engineer",
                     "level": "developer",
                     "created_at": "2021-02-02T12:15:42.000000Z",
                     "updated_at": "2021-02-02T12:15:42.000000Z"
               },
               "user": {
                     "id": 1,
                     "first_name": "Wava",
                     "last_name": "Purdy",
                     "dob": "1999-08-20",
                     "email": "test@apostle.nl",
                     "phone": "441-775-9608",
                     "email_verified_at": "1977-12-28T23:00:00.000000Z",
                     "consent": 0,
                     "avatar": "https://lorempixel.com/640/480/?37555",
                     "language": "nl",
                     "created_at": "2021-02-02T12:15:43.000000Z",
                     "deleted_at": null,
                     "provider": null,
                     "provider_id": null
               }
         }
     ]
}

Request   

PATCH api/membership/me/edit

URL Parameters

id  integer  
The ID of the Membership that you want to edit.

Body Parameters

membership_token  string  
The Membership access-token that came back when logged in.

role_id  integer optional  
The new ID of the Role that you want to give to the Membership.

ghost  boolean optional  
The new value of the boolean signifying whether the Membership is a ghost within it's Team.

Destroy

requires authentication

Destroys a single or list of Memberships based on the IDs given in the parameters.

Example request:

curl -X DELETE \
    "api-apostle.com/api/membership/delete" \
    -H "Authorization: Bearer {YOUR_AUTH_KEY}" \
    -H "Content-Type: application/json" \
    -H "Accept: application/json" \
    -d '{"membership_token":"voluptas","array":"voluptate"}'
const url = new URL(
    "api-apostle.com/api/membership/delete"
);

let headers = {
    "Authorization": "Bearer {YOUR_AUTH_KEY}",
    "Content-Type": "application/json",
    "Accept": "application/json",
};

let body = {
    "membership_token": "voluptas",
    "array": "voluptate"
}

fetch(url, {
    method: "DELETE",
    headers,
    body: JSON.stringify(body),
}).then(response => response.json());

Example response (212, Deleted):


"data": {
     "items": [
         {
             "id": 21,
             "id": 44,
         }
     ]
}

Example response (409, Could not be deleted):


Some or all Memberships given could not be deleted.

Request   

DELETE api/membership/delete

Body Parameters

membership_token  string  
The Membership access-token that came back when logged in.

array  of optional  
id's to delete

Destroy Me

requires authentication

Destroys a the authenticated Membership.

Example request:

curl -X DELETE \
    "api-apostle.com/api/membership/me/delete" \
    -H "Authorization: Bearer {YOUR_AUTH_KEY}" \
    -H "Content-Type: application/json" \
    -H "Accept: application/json" \
    -d '{"membership_token":"quia"}'
const url = new URL(
    "api-apostle.com/api/membership/me/delete"
);

let headers = {
    "Authorization": "Bearer {YOUR_AUTH_KEY}",
    "Content-Type": "application/json",
    "Accept": "application/json",
};

let body = {
    "membership_token": "quia"
}

fetch(url, {
    method: "DELETE",
    headers,
    body: JSON.stringify(body),
}).then(response => response.json());

Request   

DELETE api/membership/me/delete

Body Parameters

membership_token  string  
The Membership access-token that came back when logged in.

Organizations

A slug to group all Brands under.

Resolve

requires authentication

Search an Organization with the given attributes.

Example request:

curl -X GET \
    -G "api-apostle.com/api/organization/resolve" \
    -H "Authorization: Bearer {YOUR_AUTH_KEY}" \
    -H "Content-Type: application/json" \
    -H "Accept: application/json" \
    -d '{"membership_token":"aut","search_query":"autem"}'
const url = new URL(
    "api-apostle.com/api/organization/resolve"
);

let headers = {
    "Authorization": "Bearer {YOUR_AUTH_KEY}",
    "Content-Type": "application/json",
    "Accept": "application/json",
};

let body = {
    "membership_token": "aut",
    "search_query": "autem"
}

fetch(url, {
    method: "GET",
    headers,
    body: JSON.stringify(body),
}).then(response => response.json());

Example response (200, success):


"data": {
     "items": [
         {
              "id": 1,
              "name": "sit",
              "created_at": "2021-01-13T08:14:25.000000Z",
              "updated_at": "2021-01-13T08:14:25.000000Z"
          }
     ]
}

Example response (404, No Organizations found):


There were no Organizations found based on the query given.

Request   

GET api/organization/resolve

Body Parameters

membership_token  string  
The Membership access-token that came back when logged in

search_query  string  
Any kind of attribute you want to query on, separating the attribute from the value with a semicolon. ("id;4 name;organizationname")

Me

requires authentication

Get the details of the Organization belonging to the logged in Member

Example request:

curl -X GET \
    -G "api-apostle.com/api/organization/me" \
    -H "Authorization: Bearer {YOUR_AUTH_KEY}" \
    -H "Content-Type: application/json" \
    -H "Accept: application/json" \
    -d '{"membership_token":"eum"}'
const url = new URL(
    "api-apostle.com/api/organization/me"
);

let headers = {
    "Authorization": "Bearer {YOUR_AUTH_KEY}",
    "Content-Type": "application/json",
    "Accept": "application/json",
};

let body = {
    "membership_token": "eum"
}

fetch(url, {
    method: "GET",
    headers,
    body: JSON.stringify(body),
}).then(response => response.json());

Example response (200, success):


"data": {
     "items": [
         {
              "id": 59,
              "name": "Mitchell",
              "created_at": "2021-01-13T08:14:25.000000Z",
              "updated_at": "2021-01-13T08:14:25.000000Z"
         }
     ]
}

Example response (404, No Organization found):


There could not be an Organization found belonging to the given Membership.

Request   

GET api/organization/me

Body Parameters

membership_token  string  
The Membership access-token that came back when logged in

Index

requires authentication

Retrieve all Organizations

Example request:

curl -X GET \
    -G "api-apostle.com/api/organization/all" \
    -H "Authorization: Bearer {YOUR_AUTH_KEY}" \
    -H "Content-Type: application/json" \
    -H "Accept: application/json" \
    -d '{"membership_token":"aut","pagination":"\"2,3\" The first number will be the amount of items per page, the second is the current page you want to access"}'
const url = new URL(
    "api-apostle.com/api/organization/all"
);

let headers = {
    "Authorization": "Bearer {YOUR_AUTH_KEY}",
    "Content-Type": "application/json",
    "Accept": "application/json",
};

let body = {
    "membership_token": "aut",
    "pagination": "\"2,3\" The first number will be the amount of items per page, the second is the current page you want to access"
}

fetch(url, {
    method: "GET",
    headers,
    body: JSON.stringify(body),
}).then(response => response.json());

Example response (200, success):


"data": {
     "items": [
         {
             "id": 1,
             "name": "Greenfelder",
             "created_at": "2021-01-12T12:21:56.000000Z",
             "updated_at": "2021-01-12T12:21:56.000000Z",
         },
         {
             "id": 2,
             "name": "Franecki",
             "created_at": "2021-01-12T12:21:56.000000Z",
             "updated_at": "2021-01-12T12:21:56.000000Z"
         }
     ]
}

Example response (404, No Organizations found):


There were no Organizations found within our database.

Request   

GET api/organization/all

Body Parameters

membership_token  string  
The Membership access-token that came back when logged in

pagination  string  
The amount of items you want per page and the page you want to access separated by a comma.

Show

requires authentication

Show the details of an Organization.

Example request:

curl -X GET \
    -G "api-apostle.com/api/organization/detail/8" \
    -H "Authorization: Bearer {YOUR_AUTH_KEY}" \
    -H "Content-Type: application/json" \
    -H "Accept: application/json" \
    -d '{"membership_token":"velit"}'
const url = new URL(
    "api-apostle.com/api/organization/detail/8"
);

let headers = {
    "Authorization": "Bearer {YOUR_AUTH_KEY}",
    "Content-Type": "application/json",
    "Accept": "application/json",
};

let body = {
    "membership_token": "velit"
}

fetch(url, {
    method: "GET",
    headers,
    body: JSON.stringify(body),
}).then(response => response.json());

Example response (200, success):


"data": {
     "items": [
         {
              "id": 6,
              "name": "corrupti",
              "created_at": "2021-01-13T08:14:25.000000Z",
              "updated_at": "2021-01-13T08:14:25.000000Z",
         }
     ]
}

Example response (404, No Organization found):


There was no Organization found with that ID.

Request   

GET api/organization/detail/{id}

URL Parameters

id  integer  
The ID of the Organization that you want to show.

Body Parameters

membership_token  string  
The Membership access-token that came back when logged in.

Store

requires authentication

Stores a single Organization with the given parameters as attributes of said Organization.

Example request:

curl -X POST \
    "api-apostle.com/api/organization/create" \
    -H "Authorization: Bearer {YOUR_AUTH_KEY}" \
    -H "Content-Type: application/json" \
    -H "Accept: application/json" \
    -d '{"membership_token":"commodi","name":"nobis"}'
const url = new URL(
    "api-apostle.com/api/organization/create"
);

let headers = {
    "Authorization": "Bearer {YOUR_AUTH_KEY}",
    "Content-Type": "application/json",
    "Accept": "application/json",
};

let body = {
    "membership_token": "commodi",
    "name": "nobis"
}

fetch(url, {
    method: "POST",
    headers,
    body: JSON.stringify(body),
}).then(response => response.json());

Example response (201, success):


"data": {
     "items": [
         {
             "name": "Scortini",
             "id": 134
         }
     ]
}

Example response (400, Wrong values):


The given values to create the Organization either already exist within the database or are of the wrong type.

Example response (409, Could not be created):


The Organization could not be created.

Request   

POST api/organization/create

Body Parameters

membership_token  string  
The Membership access-token that came back when logged in.

name  string  
The name of the Brand that you are trying to create.

Update

requires authentication

Updates a single Organization with the given parameters as the new attributes of the given Organization.

Example request:

curl -X PATCH \
    "api-apostle.com/api/organization/edit/15" \
    -H "Authorization: Bearer {YOUR_AUTH_KEY}" \
    -H "Content-Type: application/json" \
    -H "Accept: application/json" \
    -d '{"membership_token":"quaerat","name":"ut"}'
const url = new URL(
    "api-apostle.com/api/organization/edit/15"
);

let headers = {
    "Authorization": "Bearer {YOUR_AUTH_KEY}",
    "Content-Type": "application/json",
    "Accept": "application/json",
};

let body = {
    "membership_token": "quaerat",
    "name": "ut"
}

fetch(url, {
    method: "PATCH",
    headers,
    body: JSON.stringify(body),
}).then(response => response.json());

Example response (200, success):


"data": {
     "items": [
         {
             "id": 6,
             "name": "Scorccini",
             "created_at": "2021-01-13T08:14:25.000000Z",
             "updated_at": "2021-01-13T08:56:33.000000Z"
         }
     ]
}

Example response (404, Organization not found):


Could not find the Organization associated with the ID that was given.

Example response (409, Conflict):


The Organization could not be edited.

Request   

PATCH api/organization/edit/{id}

URL Parameters

id  integer  
The ID of the Organization that you want to edit.

Body Parameters

membership_token  string  
The Membership access-token that came back when logged in.

name  string optional  
The new name of the Organization that you want to edit.

Update Me

requires authentication

Updates the Organization belonging to the authenticated Membership with the given parameters as the new attributes of the given Organization.

Example request:

curl -X PATCH \
    "api-apostle.com/api/organization/me/edit" \
    -H "Authorization: Bearer {YOUR_AUTH_KEY}" \
    -H "Content-Type: application/json" \
    -H "Accept: application/json" \
    -d '{"membership_token":"fuga","name":"sit"}'
const url = new URL(
    "api-apostle.com/api/organization/me/edit"
);

let headers = {
    "Authorization": "Bearer {YOUR_AUTH_KEY}",
    "Content-Type": "application/json",
    "Accept": "application/json",
};

let body = {
    "membership_token": "fuga",
    "name": "sit"
}

fetch(url, {
    method: "PATCH",
    headers,
    body: JSON.stringify(body),
}).then(response => response.json());

Example response (200, success):


"data": {
     "items": [
         {
             "id": 21,
             "name": "jenny",
             "created_at": "2021-01-13T08:14:25.000000Z",
             "updated_at": "2021-01-13T08:56:33.000000Z",
             "deleted_at": null,
         }
     }
}

Example response (404, No Organizations found):


No Organization linked to the given Membership could be found.

Request   

PATCH api/organization/me/edit

Body Parameters

membership_token  string  
The Membership access-token that came back when logged in.

name  string optional  
The name that you want to update the Organization with.

Destroy

requires authentication

Destroys a single or list of Organizations based on the IDs given in the parameters.

Example request:

curl -X DELETE \
    "api-apostle.com/api/organization/delete" \
    -H "Authorization: Bearer {YOUR_AUTH_KEY}" \
    -H "Content-Type: application/json" \
    -H "Accept: application/json" \
    -d '{"membership_token":"nihil","array":"aliquam"}'
const url = new URL(
    "api-apostle.com/api/organization/delete"
);

let headers = {
    "Authorization": "Bearer {YOUR_AUTH_KEY}",
    "Content-Type": "application/json",
    "Accept": "application/json",
};

let body = {
    "membership_token": "nihil",
    "array": "aliquam"
}

fetch(url, {
    method: "DELETE",
    headers,
    body: JSON.stringify(body),
}).then(response => response.json());

Example response (212, Deleted):


"data": {
     "items": [
         {
             "id": 6,
             "id": 61,
         }
     ]

}

Example response (409, Could not be deleted):


Some or all Organizations given could not be deleted.

Request   

DELETE api/organization/delete

Body Parameters

membership_token  string  
The Membership access-token that came back when logged in.

array  of optional  
id's to delete

Destroy Me

requires authentication

Destroys the Organization linked with the authenticated Membership.

Example request:

curl -X DELETE \
    "api-apostle.com/api/organization/me/delete" \
    -H "Authorization: Bearer {YOUR_AUTH_KEY}" \
    -H "Content-Type: application/json" \
    -H "Accept: application/json" \
    -d '{"membership_token":"quo"}'
const url = new URL(
    "api-apostle.com/api/organization/me/delete"
);

let headers = {
    "Authorization": "Bearer {YOUR_AUTH_KEY}",
    "Content-Type": "application/json",
    "Accept": "application/json",
};

let body = {
    "membership_token": "quo"
}

fetch(url, {
    method: "DELETE",
    headers,
    body: JSON.stringify(body),
}).then(response => response.json());

Request   

DELETE api/organization/me/delete

Body Parameters

membership_token  string  
The Membership access-token that came back when logged in.

Roles

API-calls to manage and view the Roles.

Index

requires authentication

Retrieve all Roles

Example request:

curl -X GET \
    -G "api-apostle.com/api/role/all" \
    -H "Authorization: Bearer {YOUR_AUTH_KEY}" \
    -H "Content-Type: application/json" \
    -H "Accept: application/json" \
    -d '{"membership_token":"ut","pagination":"\"2,3\" The first number will be the amount of items per page, the second is the current page you want to access"}'
const url = new URL(
    "api-apostle.com/api/role/all"
);

let headers = {
    "Authorization": "Bearer {YOUR_AUTH_KEY}",
    "Content-Type": "application/json",
    "Accept": "application/json",
};

let body = {
    "membership_token": "ut",
    "pagination": "\"2,3\" The first number will be the amount of items per page, the second is the current page you want to access"
}

fetch(url, {
    method: "GET",
    headers,
    body: JSON.stringify(body),
}).then(response => response.json());

Example response (200, success):


"data": {
     "items": [
         {
             "id": 1,
             "name": "Ambassador",
             "level": "user",
             "created_at": "2021-01-12T12:21:56.000000Z",
             "updated_at": "2021-01-12T12:21:56.000000Z",
         },
         {
             "id": 2,
             "name": "Social Master",
             "level": "team_admin",
             "created_at": "2021-01-12T12:21:56.000000Z",
             "updated_at": "2021-01-12T12:21:56.000000Z"
         }
     ]
}

Example response (404, No Roles found):


There were no Roles found within our database.

Request   

GET api/role/all

Body Parameters

membership_token  string  
The Membership access-token that came back when logged in

pagination  string  
The amount of items you want per page and the page you want to access separated by a comma.

Resolve

requires authentication

Search a Role with the given attributes.

Example request:

curl -X GET \
    -G "api-apostle.com/api/role/resolve" \
    -H "Authorization: Bearer {YOUR_AUTH_KEY}" \
    -H "Content-Type: application/json" \
    -H "Accept: application/json" \
    -d '{"membership_token":"voluptatem","search_query":"quia"}'
const url = new URL(
    "api-apostle.com/api/role/resolve"
);

let headers = {
    "Authorization": "Bearer {YOUR_AUTH_KEY}",
    "Content-Type": "application/json",
    "Accept": "application/json",
};

let body = {
    "membership_token": "voluptatem",
    "search_query": "quia"
}

fetch(url, {
    method: "GET",
    headers,
    body: JSON.stringify(body),
}).then(response => response.json());

Example response (200, success):


"data": {
     "items": [
         {
             "id": 1,
             "name": "Ambassador",
             "level": "user",
             "created_at": "2021-01-13T08:14:25.000000Z",
             "updated_at": "2021-01-13T08:14:25.000000Z"
         }
     ]
}

Example response (404, No Roles found):


There were no Roles found based on the query given.

Request   

GET api/role/resolve

Body Parameters

membership_token  string  
The Membership access-token that came back when logged in

search_query  string  
Any kind of attribute you want to query on, separating the attribute from the value with a semicolon. ("id;4 name;rolename")

Me

requires authentication

Get the details of Role of the logged in Member

Example request:

curl -X GET \
    -G "api-apostle.com/api/role/me" \
    -H "Authorization: Bearer {YOUR_AUTH_KEY}" \
    -H "Content-Type: application/json" \
    -H "Accept: application/json" \
    -d '{"membership_token":"dolor"}'
const url = new URL(
    "api-apostle.com/api/role/me"
);

let headers = {
    "Authorization": "Bearer {YOUR_AUTH_KEY}",
    "Content-Type": "application/json",
    "Accept": "application/json",
};

let body = {
    "membership_token": "dolor"
}

fetch(url, {
    method: "GET",
    headers,
    body: JSON.stringify(body),
}).then(response => response.json());

Example response (404, No Team found):


There was no Team found associated to the given Membership.

Example response (500):

{
    "success": false,
    "code": 113,
    "locale": "nl_NL",
    "message": "Unauthenticated.",
    "data": null,
    "debug": {
        "trace": {
            "class": "Illuminate\\Auth\\AuthenticationException",
            "file": "\/home\/vagrant\/feniks\/vendor\/laravel\/framework\/src\/Illuminate\/Auth\/Middleware\/Authenticate.php",
            "line": 82
        }
    }
}

Request   

GET api/role/me

Body Parameters

membership_token  string  
The Membership access-token that came back when logged in

Show

requires authentication

Show the details of a Role

Example request:

curl -X GET \
    -G "api-apostle.com/api/role/detail/8" \
    -H "Authorization: Bearer {YOUR_AUTH_KEY}" \
    -H "Content-Type: application/json" \
    -H "Accept: application/json" \
    -d '{"membership_token":"voluptatem"}'
const url = new URL(
    "api-apostle.com/api/role/detail/8"
);

let headers = {
    "Authorization": "Bearer {YOUR_AUTH_KEY}",
    "Content-Type": "application/json",
    "Accept": "application/json",
};

let body = {
    "membership_token": "voluptatem"
}

fetch(url, {
    method: "GET",
    headers,
    body: JSON.stringify(body),
}).then(response => response.json());

Example response (200, success):


"data": {
     "items": [
         {
             "id": 3,
             "name": "Brand Master",
             "level": "brand_admin",
             "created_at": "2021-01-12T12:21:56.000000Z",
             "updated_at": "2021-01-12T12:21:56.000000Z"
         }
     ]
}

Example response (404, No Role found):


There was no Role found with that ID.

Request   

GET api/role/detail/{id}

URL Parameters

id  integer  
The ID of the Role that you want to show.

Body Parameters

membership_token  string  
The Membership access-token that came back when logged in.

Store

requires authentication

Stores a single Role with the given parameters as attributes of said Role.

Example request:

curl -X POST \
    "api-apostle.com/api/role/create" \
    -H "Authorization: Bearer {YOUR_AUTH_KEY}" \
    -H "Content-Type: application/json" \
    -H "Accept: application/json" \
    -d '{"membership_token":"consequatur","name":"optio"}'
const url = new URL(
    "api-apostle.com/api/role/create"
);

let headers = {
    "Authorization": "Bearer {YOUR_AUTH_KEY}",
    "Content-Type": "application/json",
    "Accept": "application/json",
};

let body = {
    "membership_token": "consequatur",
    "name": "optio"
}

fetch(url, {
    method: "POST",
    headers,
    body: JSON.stringify(body),
}).then(response => response.json());

Example response (201, success):


"data": {
     "items": [
         {
             "name": "Big Boss",
             "updated_at": "2021-01-13T08:46:55.000000Z",
             "created_at": "2021-01-13T08:46:55.000000Z",
             "id": 134
         }
     ]
}

Example response (400, Wrong values):


The given values to create the Role either already exist within the database or are of the wrong type.

Example response (409, Could not be created):


The Role could not be created.

Request   

POST api/role/create

Body Parameters

membership_token  string  
The Membership access-token that came back when logged in.

name  string  
The name of the Role that you are trying to create.

Update

requires authentication

Updates a single Role with the given parameters as the new attributes of the given Role.

Example request:

curl -X PATCH \
    "api-apostle.com/api/role/edit/tenetur" \
    -H "Authorization: Bearer {YOUR_AUTH_KEY}" \
    -H "Content-Type: application/json" \
    -H "Accept: application/json" \
    -d '{"membership_token":"eum","name":"incidunt"}'
const url = new URL(
    "api-apostle.com/api/role/edit/tenetur"
);

let headers = {
    "Authorization": "Bearer {YOUR_AUTH_KEY}",
    "Content-Type": "application/json",
    "Accept": "application/json",
};

let body = {
    "membership_token": "eum",
    "name": "incidunt"
}

fetch(url, {
    method: "PATCH",
    headers,
    body: JSON.stringify(body),
}).then(response => response.json());

Example response (200, success):


"data": {
     "items": [
         {
             "name": "Big Boss",
             "created_at": "2021-01-13T08:14:25.000000Z",
             "updated_at": "2021-01-13T08:56:33.000000Z",
             "id": 134
         }
     ]
}

Example response (404, Role not found):


Could not find the Role associated with the ID that was given.

Request   

PATCH api/role/edit/{id}

URL Parameters

id  string  

Body Parameters

membership_token  string  
The Membership access-token that came back when logged in.

name  string optional  
The new name of the Role that you want to edit.

Destroy

requires authentication

Destroys a single or list of Role based on the IDs given in the parameters.

Example request:

curl -X DELETE \
    "api-apostle.com/api/role/delete" \
    -H "Authorization: Bearer {YOUR_AUTH_KEY}" \
    -H "Content-Type: application/json" \
    -H "Accept: application/json" \
    -d '{"membership_token":"accusantium","array":"ut"}'
const url = new URL(
    "api-apostle.com/api/role/delete"
);

let headers = {
    "Authorization": "Bearer {YOUR_AUTH_KEY}",
    "Content-Type": "application/json",
    "Accept": "application/json",
};

let body = {
    "membership_token": "accusantium",
    "array": "ut"
}

fetch(url, {
    method: "DELETE",
    headers,
    body: JSON.stringify(body),
}).then(response => response.json());

Example response (212, Deleted):


"data": {
     "items": [
         {
             "id": 6,
             "id": 16,
         }
     ]

}

Example response (409, Could not be deleted):


Some or all Roles given could not be deleted.

Request   

DELETE api/role/delete

Body Parameters

membership_token  string  
The Membership access-token that came back when logged in.

array  of optional  
id's to delete

Teams

A grouping of Memberships, belonging to a Brand.

Resolve

requires authentication

Search a Team with the given attributes.

Example request:

curl -X GET \
    -G "api-apostle.com/api/team/resolve" \
    -H "Authorization: Bearer {YOUR_AUTH_KEY}" \
    -H "Content-Type: application/json" \
    -H "Accept: application/json" \
    -d '{"membership_token":"optio","search_query":"error"}'
const url = new URL(
    "api-apostle.com/api/team/resolve"
);

let headers = {
    "Authorization": "Bearer {YOUR_AUTH_KEY}",
    "Content-Type": "application/json",
    "Accept": "application/json",
};

let body = {
    "membership_token": "optio",
    "search_query": "error"
}

fetch(url, {
    method: "GET",
    headers,
    body: JSON.stringify(body),
}).then(response => response.json());

Example response (200, success):


"data": {
     "items": [
         {
             "id": 1,
             "name": "sit",
             "domain": "marquadth",
             "logo": "https://lorempixel.com/640/480/?95714",
             "created_at": "2021-01-13T08:14:25.000000Z",
             "updated_at": "2021-01-13T08:14:25.000000Z",
             "brand": {
                 "id": 1,
                 "name": "aspernatur",
                 "created_at": "2021-02-02T12:15:41.000000Z",
                 "updated_at": "2021-02-02T12:15:41.000000Z",
                 "organization": {
                     "id": 5,
                     "name": "Bartell-Carter",
                     "created_at": null,
                     "updated_at": null
                 }
             }
         }
     ]
}

Example response (404, No Teams found):


There were no Teams found based on the query given.

Request   

GET api/team/resolve

Body Parameters

membership_token  string  
The Membership access-token that came back when logged in

search_query  string  
Any kind of attribute you want to query on, separating the attribute from the value with a semicolon. ("id;4 name;teamname")

Me

requires authentication

Get the details of Team of the logged in Member

Example request:

curl -X GET \
    -G "api-apostle.com/api/team/me" \
    -H "Authorization: Bearer {YOUR_AUTH_KEY}" \
    -H "Content-Type: application/json" \
    -H "Accept: application/json" \
    -d '{"membership_token":"cum"}'
const url = new URL(
    "api-apostle.com/api/team/me"
);

let headers = {
    "Authorization": "Bearer {YOUR_AUTH_KEY}",
    "Content-Type": "application/json",
    "Accept": "application/json",
};

let body = {
    "membership_token": "cum"
}

fetch(url, {
    method: "GET",
    headers,
    body: JSON.stringify(body),
}).then(response => response.json());

Example response (200, success):


"data": {
     "items": [
         {
             "id": 59,
             "name": "Kessler Ltd",
             "domain": "walsh",
             "logo": "https://lorempixel.com/640/480/?32874",
             "created_at": "2021-01-18T10:38:02.000000Z",
             "updated_at": "2021-01-18T10:38:02.000000Z",
             "brand": {
                 "id": 1,
                 "name": "aspernatur",
                 "created_at": "2021-02-02T12:15:41.000000Z",
                 "updated_at": "2021-02-02T12:15:41.000000Z",
                 "organization": {
                     "id": 5,
                     "name": "Bartell-Carter",
                     "created_at": null,
                     "updated_at": null
                 }
             }
         }
     ]
}

Example response (404, No Team found):


There was no Team found associated to the given Membership.

Request   

GET api/team/me

Body Parameters

membership_token  string  
The Membership access-token that came back when logged in

Index

requires authentication

Retrieve all Teams under the same Brand or Organization

Example request:

curl -X GET \
    -G "api-apostle.com/api/team/all" \
    -H "Authorization: Bearer {YOUR_AUTH_KEY}" \
    -H "Content-Type: application/json" \
    -H "Accept: application/json" \
    -d '{"membership_token":"modi","type":"voluptatibus","pagination":"\"2,3\" The first number will be the amount of items per page, the second is the current page you want to access"}'
const url = new URL(
    "api-apostle.com/api/team/all"
);

let headers = {
    "Authorization": "Bearer {YOUR_AUTH_KEY}",
    "Content-Type": "application/json",
    "Accept": "application/json",
};

let body = {
    "membership_token": "modi",
    "type": "voluptatibus",
    "pagination": "\"2,3\" The first number will be the amount of items per page, the second is the current page you want to access"
}

fetch(url, {
    method: "GET",
    headers,
    body: JSON.stringify(body),
}).then(response => response.json());

Example response (200, success):


"data": {
     "items": [
         {
             "id": 59,
             "name": "Kessler Ltd",
             "domain": "walsh",
             "logo": "https://lorempixel.com/640/480/?32874",
             "created_at": "2021-01-18T10:38:02.000000Z",
             "updated_at": "2021-01-18T10:38:02.000000Z",
             "brand_id": 1,
             "brand": {
                 "id": 1,
                 "name": "aspernatur",
                 "created_at": "2021-02-02T12:15:41.000000Z",
                 "updated_at": "2021-02-02T12:15:41.000000Z",
                 "organization_id": 5,
                 "organization": {
                     "id": 5,
                     "name": "Bartell-Carter",
                     "created_at": null,
                     "updated_at": null
                 }
             }
         }
     ]
}

Example response (404, No Team found):


There were no Teams found associated to the given Membership under the same Brand or Organization.

Request   

GET api/team/all

Body Parameters

membership_token  string  
The Membership access-token that came back when logged in

type  string optional  
The level of indexing you want to have of all Teams. (brand, organization)

pagination  string  
The amount of items you want per page and the page you want to access separated by a comma.

Show

requires authentication

Show the details of a Team that is available under the same Brand or Organization.

Example request:

curl -X GET \
    -G "api-apostle.com/api/team/detail/8" \
    -H "Authorization: Bearer {YOUR_AUTH_KEY}" \
    -H "Content-Type: application/json" \
    -H "Accept: application/json" \
    -d '{"membership_token":"incidunt","type":"nulla"}'
const url = new URL(
    "api-apostle.com/api/team/detail/8"
);

let headers = {
    "Authorization": "Bearer {YOUR_AUTH_KEY}",
    "Content-Type": "application/json",
    "Accept": "application/json",
};

let body = {
    "membership_token": "incidunt",
    "type": "nulla"
}

fetch(url, {
    method: "GET",
    headers,
    body: JSON.stringify(body),
}).then(response => response.json());

Example response (200, success):


"data": {
     "items": [
         {
             "id": 6,
             "name": "Spinka, Roob and Bogan",
             "domain": "yundt",
             "logo": "https://lorempixel.com/640/480/?77923",
             "created_at": "2021-01-13T08:14:25.000000Z",
             "updated_at": "2021-01-13T08:14:25.000000Z",
             "brand": {
                 "id": 1,
                 "name": "aspernatur",
                 "created_at": "2021-02-02T12:15:41.000000Z",
                 "updated_at": "2021-02-02T12:15:41.000000Z",
                 "organization": {
                     "id": 5,
                     "name": "Bartell-Carter",
                     "created_at": null,
                     "updated_at": null
                 }
             }
         }
     ]
}

Example response (404, No Team found):


There was no Team found with that ID.

Example response (409, Conflict):


The Team you're trying to see does not fall under your Brand or Organization thus you are unauthorized.

Request   

GET api/team/detail/{id}

URL Parameters

id  integer  
The ID of the Team that you want to show.

Body Parameters

membership_token  string  
The Membership access-token that came back when logged in.

type  string optional  
The level of indexing you want to have of all Teams. (Brand, Organization)

Store

requires authentication

Stores a single Team with the given parameters as attributes of said Team.

Example request:

curl -X POST \
    "api-apostle.com/api/team/create" \
    -H "Authorization: Bearer {YOUR_AUTH_KEY}" \
    -H "Content-Type: application/json" \
    -H "Accept: application/json" \
    -d '{"membership_token":"corporis","name":"alias","domain":"qui","logo":"nihil","brand_id":"ratione","theme_id":"atque"}'
const url = new URL(
    "api-apostle.com/api/team/create"
);

let headers = {
    "Authorization": "Bearer {YOUR_AUTH_KEY}",
    "Content-Type": "application/json",
    "Accept": "application/json",
};

let body = {
    "membership_token": "corporis",
    "name": "alias",
    "domain": "qui",
    "logo": "nihil",
    "brand_id": "ratione",
    "theme_id": "atque"
}

fetch(url, {
    method: "POST",
    headers,
    body: JSON.stringify(body),
}).then(response => response.json());

Example response (200, success):


"data": {
     "items": [
         {
             "id": 59,
             "name": "Kessler Ltd",
             "domain": "walsh",
             "logo": "https://lorempixel.com/640/480/?32874",
             "created_at": "2021-01-18T10:38:02.000000Z",
             "updated_at": "2021-01-18T10:38:02.000000Z",
             "brand": {
                 "id": 1,
                 "name": "aspernatur",
                 "created_at": "2021-02-02T12:15:41.000000Z",
                 "updated_at": "2021-02-02T12:15:41.000000Z",
                 "organization": {
                     "id": 5,
                     "name": "Bartell-Carter",
                     "created_at": null,
                     "updated_at": null
                 }
             }
         }
     ]
}

Example response (400, Wrong values):


The given values to create the Team either already exist within the database or are of the wrong type.

Example response (409, Could not be created):


The Team could not be created.

Example response (200, Brand not found):


status= 404 No Brand associated with the Membership could be found and thus no Team could be created.

Request   

POST api/team/create

Body Parameters

membership_token  string  
The Membership access-token that came back when logged in.

name  string  
The name of the Team that you are trying to create.

domain  string  
The domain name of the Team that you are trying to create.

logo  url optional  
A link to the logo of the Team that you are trying to create.

brand_id  required optional  
The ID of the brand associated with the Team that you are trying to create.

theme_id  The optional  
ID of the Theme that you want to use for the Team that you are trying to create.

Update

requires authentication

Updates a single Team with the given parameters as the new attributes of the given Team.

Example request:

curl -X PATCH \
    "api-apostle.com/api/team/edit/20" \
    -H "Authorization: Bearer {YOUR_AUTH_KEY}" \
    -H "Content-Type: application/json" \
    -H "Accept: application/json" \
    -d '{"membership_token":"atque","name":"laboriosam","theme_id":2,"domain":"quis","logo":"sed"}'
const url = new URL(
    "api-apostle.com/api/team/edit/20"
);

let headers = {
    "Authorization": "Bearer {YOUR_AUTH_KEY}",
    "Content-Type": "application/json",
    "Accept": "application/json",
};

let body = {
    "membership_token": "atque",
    "name": "laboriosam",
    "theme_id": 2,
    "domain": "quis",
    "logo": "sed"
}

fetch(url, {
    method: "PATCH",
    headers,
    body: JSON.stringify(body),
}).then(response => response.json());

Example response (200, success):


"data": {
     "items": [
         {
             "id": 59,
             "name": "Kessler Ltd",
             "domain": "walsh",
             "logo": "https://lorempixel.com/640/480/?32874",
             "created_at": "2021-01-18T10:38:02.000000Z",
             "updated_at": "2021-01-18T10:38:02.000000Z",
             "brand": {
                 "id": 1,
                 "name": "aspernatur",
                 "created_at": "2021-02-02T12:15:41.000000Z",
                 "updated_at": "2021-02-02T12:15:41.000000Z",
                 "organization": {
                     "id": 5,
                     "name": "Bartell-Carter",
                     "created_at": null,
                     "updated_at": null
                 }
             }
         }
     ]
}

Example response (404, Team not found):


Could not find the Team associated with the ID that was given.

Request   

PATCH api/team/edit/{id}

URL Parameters

id  integer  
The ID of the Team that you want to edit.

Body Parameters

membership_token  string  
The Membership access-token that came back when logged in.

name  string optional  
The new name of the Team that you're updating.

theme_id  integer optional  
The new ID of the Theme that you want to use for the Team that you're updating.

domain  The optional  
new name of the domain you want to use for the Team that you're editing.

logo  url optional  
The new URL to the picture that you want to use for the Team.

Update Me

requires authentication

Updates the Team of the authenticated Membership with the given parameters as the new attributes of the given Team.

Example request:

curl -X PATCH \
    "api-apostle.com/api/team/me/edit" \
    -H "Authorization: Bearer {YOUR_AUTH_KEY}" \
    -H "Content-Type: application/json" \
    -H "Accept: application/json" \
    -d '{"membership_token":"est","name":"libero","theme_id":15,"domain":"harum","logo":"ipsa"}'
const url = new URL(
    "api-apostle.com/api/team/me/edit"
);

let headers = {
    "Authorization": "Bearer {YOUR_AUTH_KEY}",
    "Content-Type": "application/json",
    "Accept": "application/json",
};

let body = {
    "membership_token": "est",
    "name": "libero",
    "theme_id": 15,
    "domain": "harum",
    "logo": "ipsa"
}

fetch(url, {
    method: "PATCH",
    headers,
    body: JSON.stringify(body),
}).then(response => response.json());

Example response (200, success):


"data": {
     "items": [
         {
             "id": 59,
             "name": "Kessler Ltd",
             "domain": "walsh",
             "logo": "https://lorempixel.com/640/480/?32874",
             "created_at": "2021-01-18T10:38:02.000000Z",
             "updated_at": "2021-01-18T10:38:02.000000Z",
             "brand": {
                 "id": 1,
                 "name": "aspernatur",
                 "created_at": "2021-02-02T12:15:41.000000Z",
                 "updated_at": "2021-02-02T12:15:41.000000Z",
                 "organization": {
                     "id": 5,
                     "name": "Bartell-Carter",
                     "created_at": null,
                     "updated_at": null
                 }
             }
         }
     ]
}

Request   

PATCH api/team/me/edit

Body Parameters

membership_token  string  
The Membership access-token that came back when logged in.

name  string optional  
The new name of the Team that you're updating.

theme_id  integer optional  
The new ID of the Theme that you want to use for the Team that you're updating.

domain  The optional  
new name of the domain you want to use for the Team that you're editing.

logo  url optional  
The new URL to the picture that you want to use for the Team.

Destroy

requires authentication

Destroys a single or list of Teams based on the IDs given in the parameters.

Example request:

curl -X DELETE \
    "api-apostle.com/api/team/delete" \
    -H "Authorization: Bearer {YOUR_AUTH_KEY}" \
    -H "Content-Type: application/json" \
    -H "Accept: application/json" \
    -d '{"membership_token":"dolores","array":"magnam"}'
const url = new URL(
    "api-apostle.com/api/team/delete"
);

let headers = {
    "Authorization": "Bearer {YOUR_AUTH_KEY}",
    "Content-Type": "application/json",
    "Accept": "application/json",
};

let body = {
    "membership_token": "dolores",
    "array": "magnam"
}

fetch(url, {
    method: "DELETE",
    headers,
    body: JSON.stringify(body),
}).then(response => response.json());

Example response (212, Deleted):


"data": {
     "items": [
         {
              "id": 37,
              "id": 17,
         }
     ]
}

Example response (409, Could not be deleted):


Some or all Teams given could not be deleted.

Request   

DELETE api/team/delete

Body Parameters

membership_token  string  
The Membership access-token that came back when logged in.

array  of optional  
id's to delete

Destroy Me

requires authentication

Destroys the current Team.

Example request:

curl -X DELETE \
    "api-apostle.com/api/team/me/delete" \
    -H "Authorization: Bearer {YOUR_AUTH_KEY}" \
    -H "Content-Type: application/json" \
    -H "Accept: application/json" \
    -d '{"membership_token":"harum"}'
const url = new URL(
    "api-apostle.com/api/team/me/delete"
);

let headers = {
    "Authorization": "Bearer {YOUR_AUTH_KEY}",
    "Content-Type": "application/json",
    "Accept": "application/json",
};

let body = {
    "membership_token": "harum"
}

fetch(url, {
    method: "DELETE",
    headers,
    body: JSON.stringify(body),
}).then(response => response.json());

Request   

DELETE api/team/me/delete

Body Parameters

membership_token  string  
The Membership access-token that came back when logged in.

Themes

API-calls to manage and view the Themes.

Index

requires authentication

Retrieve all Themes under the same Team as the given Membership

Example request:

curl -X GET \
    -G "api-apostle.com/api/theme/all" \
    -H "Authorization: Bearer {YOUR_AUTH_KEY}" \
    -H "Content-Type: application/json" \
    -H "Accept: application/json" \
    -d '{"membership_token":"dolore","pagination":"\"2,3\" The first number will be the amount of items per page, the second is the current page you want to access"}'
const url = new URL(
    "api-apostle.com/api/theme/all"
);

let headers = {
    "Authorization": "Bearer {YOUR_AUTH_KEY}",
    "Content-Type": "application/json",
    "Accept": "application/json",
};

let body = {
    "membership_token": "dolore",
    "pagination": "\"2,3\" The first number will be the amount of items per page, the second is the current page you want to access"
}

fetch(url, {
    method: "GET",
    headers,
    body: JSON.stringify(body),
}).then(response => response.json());

Example response (200, success):


"data": {
     "items": [
         {
             "id": 1,
             "name": "sunt",
             "active": 0,
             "logo": "https://lorempixel.com/640/480/?70291",
             "font": "Prof. Ole Upton",
             "text_color": "WhiteSmoke",
             "primary_color": "Tan",
             "secondary_color": "SeaShell",
             "background_color": "Purple",
             "created_at": "2021-01-18T10:38:02.000000Z",
             "updated_at": "2021-01-18T10:38:02.000000Z",
              "team_id": 8,
              "team": {
                  "id": 8,
                  "name": "Pfannerstill, Halvorson and Marquardt",
                  "domain": "herman",
                  "logo": "https://lorempixel.com/640/480/?51237",
                  "created_at": "2021-02-02T12:15:41.000000Z",
                  "updated_at": "2021-02-02T12:15:41.000000Z",
                  "brand_id": 6,
                  "brand": {
                      "id": 6,
                      "name": "ut",
                      "created_at": "2021-02-02T12:15:41.000000Z",
                      "updated_at": "2021-02-02T12:15:41.000000Z",
                      "organization_id": 10,
                      "organization": {
                          "id": 10,
                          "name": "Wintheiser, Barton and Beahan",
                          "created_at": null,
                          "updated_at": null
                      }
                  }
              }
         }
     ]
}

Example response (404, No Themes found):


There were no Themes found associated to the Team of the given Membership.

Request   

GET api/theme/all

Body Parameters

membership_token  string  
The Membership access-token that came back when logged in

pagination  string  
The amount of items you want per page and the page you want to access separated by a comma.

Resolve

requires authentication

Search a Theme with the given attributes.

Example request:

curl -X GET \
    -G "api-apostle.com/api/theme/resolve" \
    -H "Authorization: Bearer {YOUR_AUTH_KEY}" \
    -H "Content-Type: application/json" \
    -H "Accept: application/json" \
    -d '{"membership_token":"non","search_query":"sequi"}'
const url = new URL(
    "api-apostle.com/api/theme/resolve"
);

let headers = {
    "Authorization": "Bearer {YOUR_AUTH_KEY}",
    "Content-Type": "application/json",
    "Accept": "application/json",
};

let body = {
    "membership_token": "non",
    "search_query": "sequi"
}

fetch(url, {
    method: "GET",
    headers,
    body: JSON.stringify(body),
}).then(response => response.json());

Example response (200, success):


"data": {
     "items": [
         {
             "id": 1,
             "name": "sunt",
             "active": 0,
             "logo": "https://lorempixel.com/640/480/?70291",
             "font": "Prof. Ole Upton",
             "text_color": "WhiteSmoke",
             "primary_color": "Tan",
             "secondary_color": "SeaShell",
             "background_color": "Purple",
             "created_at": "2021-01-18T10:38:02.000000Z",
             "updated_at": "2021-01-18T10:38:02.000000Z",
              "team": {
                  "id": 8,
                  "name": "Pfannerstill, Halvorson and Marquardt",
                  "domain": "herman",
                  "logo": "https://lorempixel.com/640/480/?51237",
                  "created_at": "2021-02-02T12:15:41.000000Z",
                  "updated_at": "2021-02-02T12:15:41.000000Z",
                  "brand": {
                      "id": 6,
                      "name": "ut",
                      "created_at": "2021-02-02T12:15:41.000000Z",
                      "updated_at": "2021-02-02T12:15:41.000000Z",
                      "organization": {
                          "id": 10,
                          "name": "Wintheiser, Barton and Beahan",
                          "created_at": null,
                          "updated_at": null
                      }
                  }
              }
         }
     ]
}

Example response (404, No Themes found):


There were no Themes found based on the query given.

Request   

GET api/theme/resolve

Body Parameters

membership_token  string  
The Membership access-token that came back when logged in

search_query  string  
Any kind of attribute you want to query on, separating the attribute from the value with a semicolon. ("id;4 name;themename")

Show

requires authentication

Show the details of a Theme

Example request:

curl -X GET \
    -G "api-apostle.com/api/theme/detail/1" \
    -H "Authorization: Bearer {YOUR_AUTH_KEY}" \
    -H "Content-Type: application/json" \
    -H "Accept: application/json" \
    -d '{"membership_token":"in"}'
const url = new URL(
    "api-apostle.com/api/theme/detail/1"
);

let headers = {
    "Authorization": "Bearer {YOUR_AUTH_KEY}",
    "Content-Type": "application/json",
    "Accept": "application/json",
};

let body = {
    "membership_token": "in"
}

fetch(url, {
    method: "GET",
    headers,
    body: JSON.stringify(body),
}).then(response => response.json());

Example response (200, success):


"data": {
     "items": [
         {
             "id": 1,
                 "name": "sunt",
                 "active": 0,
                 "logo": "https://lorempixel.com/640/480/?70291",
                 "font": "Prof. Ole Upton",
                 "text_color": "WhiteSmoke",
                 "primary_color": "Tan",
                 "secondary_color": "SeaShell",
                 "background_color": "Purple",
                 "created_at": "2021-01-18T10:38:02.000000Z",
                 "updated_at": "2021-01-18T10:38:02.000000Z",
                 "team": {
                     "id": 8,
                     "name": "Pfannerstill, Halvorson and Marquardt",
                     "domain": "herman",
                     "logo": "https://lorempixel.com/640/480/?51237",
                     "created_at": "2021-02-02T12:15:41.000000Z",
                     "updated_at": "2021-02-02T12:15:41.000000Z",
                     "brand": {
                         "id": 6,
                         "name": "ut",
                         "created_at": "2021-02-02T12:15:41.000000Z",
                         "updated_at": "2021-02-02T12:15:41.000000Z",
                         "organization": {
                             "id": 10,
                             "name": "Wintheiser, Barton and Beahan",
                             "created_at": null,
                             "updated_at": null
                         }
                     }
                 }
         }
     ]
}

Example response (404, No Theme found):


There was no Theme found with that ID.

Example response (409, Conflict):


The Theme you're trying to access does not belong to your Team.

Request   

GET api/theme/detail/{id}

URL Parameters

id  integer  
The ID of the Theme that you want to show.

Body Parameters

membership_token  string  
The Membership access-token that came back when logged in.

Store

requires authentication

Stores a single Theme with the given parameters as attributes of said Theme.

Example request:

curl -X POST \
    "api-apostle.com/api/theme/create" \
    -H "Authorization: Bearer {YOUR_AUTH_KEY}" \
    -H "Content-Type: application/json" \
    -H "Accept: application/json" \
    -d '{"membership_token":"eius","name":"similique","logo":"facere","font":"aut","text_color":"est","primary_color":"voluptatum","secondary_color":"et","background_color":"neque"}'
const url = new URL(
    "api-apostle.com/api/theme/create"
);

let headers = {
    "Authorization": "Bearer {YOUR_AUTH_KEY}",
    "Content-Type": "application/json",
    "Accept": "application/json",
};

let body = {
    "membership_token": "eius",
    "name": "similique",
    "logo": "facere",
    "font": "aut",
    "text_color": "est",
    "primary_color": "voluptatum",
    "secondary_color": "et",
    "background_color": "neque"
}

fetch(url, {
    method: "POST",
    headers,
    body: JSON.stringify(body),
}).then(response => response.json());

Example response (201, success):


"data": {
     "items": [
         {
                 "id": 1,
                 "name": "sunt",
                 "active": 0,
                 "logo": "https://lorempixel.com/640/480/?70291",
                 "font": "Prof. Ole Upton",
                 "text_color": "WhiteSmoke",
                 "primary_color": "Tan",
                 "secondary_color": "SeaShell",
                 "background_color": "Purple",
                 "created_at": "2021-01-18T10:38:02.000000Z",
                 "updated_at": "2021-01-18T10:38:02.000000Z",
                 "team": {
                     "id": 8,
                     "name": "Pfannerstill, Halvorson and Marquardt",
                     "domain": "herman",
                     "logo": "https://lorempixel.com/640/480/?51237",
                     "created_at": "2021-02-02T12:15:41.000000Z",
                     "updated_at": "2021-02-02T12:15:41.000000Z",
                     "brand": {
                         "id": 6,
                         "name": "ut",
                         "created_at": "2021-02-02T12:15:41.000000Z",
                         "updated_at": "2021-02-02T12:15:41.000000Z",
                         "organization": {
                             "id": 10,
                             "name": "Wintheiser, Barton and Beahan",
                             "created_at": null,
                             "updated_at": null
                         }
                     }
                 }
         }
     ]
}

Example response (400, Wrong values):


The given values to create the Theme either already exist within the database or are of the wrong type.

Example response (409, Could not be created):


The Theme could not be created.

Request   

POST api/theme/create

Body Parameters

membership_token  string  
The Membership access-token that came back when logged in.

name  string  
The name of the Theme that you are trying to create.

logo  url optional  
The URL of the logo you want to use for the Theme.

font  string optional  
The name of the font you'll be using for the new Theme.

text_color  string optional  
The colour of the text for the new Theme.

primary_color  string optional  
The primary colour of the new Theme.

secondary_color  string optional  
The secondary colour of the new Theme.

background_color  string optional  
The colour of the background for the new Theme.

Update

requires authentication

Updates a single Theme with the given parameters as the new attributes of the given Theme.

Example request:

curl -X PATCH \
    "api-apostle.com/api/theme/edit/aspernatur" \
    -H "Authorization: Bearer {YOUR_AUTH_KEY}" \
    -H "Content-Type: application/json" \
    -H "Accept: application/json" \
    -d '{"membership_token":"voluptate","name":"repellat","logo":"quas","font":"quaerat","text_color":"perferendis","primary_color":"architecto","secondary_color":"praesentium","background_color":"quasi"}'
const url = new URL(
    "api-apostle.com/api/theme/edit/aspernatur"
);

let headers = {
    "Authorization": "Bearer {YOUR_AUTH_KEY}",
    "Content-Type": "application/json",
    "Accept": "application/json",
};

let body = {
    "membership_token": "voluptate",
    "name": "repellat",
    "logo": "quas",
    "font": "quaerat",
    "text_color": "perferendis",
    "primary_color": "architecto",
    "secondary_color": "praesentium",
    "background_color": "quasi"
}

fetch(url, {
    method: "PATCH",
    headers,
    body: JSON.stringify(body),
}).then(response => response.json());

Example response (200, success):


"data": {
     "items": [
         {
                 "id": 1,
                 "name": "sunt",
                 "active": 0,
                 "logo": "https://lorempixel.com/640/480/?70291",
                 "font": "Prof. Ole Upton",
                 "text_color": "WhiteSmoke",
                 "primary_color": "Tan",
                 "secondary_color": "SeaShell",
                 "background_color": "Purple",
                 "created_at": "2021-01-18T10:38:02.000000Z",
                 "updated_at": "2021-01-18T10:38:02.000000Z",
                 "team": {
                     "id": 8,
                     "name": "Pfannerstill, Halvorson and Marquardt",
                     "domain": "herman",
                     "logo": "https://lorempixel.com/640/480/?51237",
                     "created_at": "2021-02-02T12:15:41.000000Z",
                     "updated_at": "2021-02-02T12:15:41.000000Z",
                     "brand": {
                         "id": 6,
                         "name": "ut",
                         "created_at": "2021-02-02T12:15:41.000000Z",
                         "updated_at": "2021-02-02T12:15:41.000000Z",
                         "organization": {
                             "id": 10,
                             "name": "Wintheiser, Barton and Beahan",
                             "created_at": null,
                             "updated_at": null
                         }
                     }
                 }
         }
     ]
}

Example response (404, Theme not found):


Could not find the Theme associated with the ID that was given.

Request   

PATCH api/theme/edit/{id}

URL Parameters

id  string  

Body Parameters

membership_token  string  
The Membership access-token that came back when logged in.

name  string  
The name of the Theme that you are trying to create.

logo  url optional  
The URL of the logo you want to use for the Theme.

font  string optional  
The name of the font you'll be using for the new Theme.

text_color  string optional  
The colour of the text for the new Theme.

primary_color  string optional  
The primary colour of the new Theme.

secondary_color  string optional  
The secondary colour of the new Theme.

background_color  string optional  
The colour of the background for the new Theme.

Destroy

requires authentication

Destroys a single or list of Themes based on the IDs given in the parameters.

Example request:

curl -X DELETE \
    "api-apostle.com/api/theme/delete" \
    -H "Authorization: Bearer {YOUR_AUTH_KEY}" \
    -H "Content-Type: application/json" \
    -H "Accept: application/json" \
    -d '{"membership_token":"ipsa","array":"sit"}'
const url = new URL(
    "api-apostle.com/api/theme/delete"
);

let headers = {
    "Authorization": "Bearer {YOUR_AUTH_KEY}",
    "Content-Type": "application/json",
    "Accept": "application/json",
};

let body = {
    "membership_token": "ipsa",
    "array": "sit"
}

fetch(url, {
    method: "DELETE",
    headers,
    body: JSON.stringify(body),
}).then(response => response.json());

Example response (212, Deleted):


"data": {
     "items": [
         {
             "id": 4,
             "id": 14,
         }
     ]
}

Example response (409, Could not be deleted):


Some or all Themes given could not be deleted.

Request   

DELETE api/theme/delete

Body Parameters

membership_token  string  
The Membership access-token that came back when logged in.

array  of optional  
id's to delete

Users

API-calls to manage and view the Users.

Resolve

requires authentication

Search an User with the given attributes.

Example request:

curl -X GET \
    -G "api-apostle.com/api/user/resolve" \
    -H "Authorization: Bearer {YOUR_AUTH_KEY}" \
    -H "Content-Type: application/json" \
    -H "Accept: application/json" \
    -d '{"membership_token":"ut","search_query":"dolore"}'
const url = new URL(
    "api-apostle.com/api/user/resolve"
);

let headers = {
    "Authorization": "Bearer {YOUR_AUTH_KEY}",
    "Content-Type": "application/json",
    "Accept": "application/json",
};

let body = {
    "membership_token": "ut",
    "search_query": "dolore"
}

fetch(url, {
    method: "GET",
    headers,
    body: JSON.stringify(body),
}).then(response => response.json());

Example response (200, success):


"data": {
     "items": [
         {
             "id": 1,
             "first_name": "Manuela",
             "last_name": "Gulgowski",
             "dob": "1994-12-07",
             "email": "spencer.madie@russel.com",
             "phone": "640.573.2808 x666",
             "email_verified_at": "1984-10-11T23:00:00.000000Z",
             "consent": 0,
             "avatar": "https://lorempixel.com/640/480/?62835",
             "language": "nl",
             "created_at": "2021-01-19T10:28:33.000000Z",
             "deleted_at": null,
             "provider": null,
             "provider_id": null
         }
     ]
}

Example response (404, No Users found):


There were no Users found based on the query given.

Request   

GET api/user/resolve

Body Parameters

membership_token  string  
The Membership access-token that came back when logged in

search_query  string  
Any kind of attribute you want to query on, separating the attribute from the value with a semicolon. ("id;4 first_name;firstname")

Me

requires authentication

Get the details of logged in Member

Example request:

curl -X GET \
    -G "api-apostle.com/api/user/me" \
    -H "Authorization: Bearer {YOUR_AUTH_KEY}" \
    -H "Content-Type: application/json" \
    -H "Accept: application/json" \
    -d '{"membership_token":"dolor"}'
const url = new URL(
    "api-apostle.com/api/user/me"
);

let headers = {
    "Authorization": "Bearer {YOUR_AUTH_KEY}",
    "Content-Type": "application/json",
    "Accept": "application/json",
};

let body = {
    "membership_token": "dolor"
}

fetch(url, {
    method: "GET",
    headers,
    body: JSON.stringify(body),
}).then(response => response.json());

Example response (200, success):


"data": {
     "items": [
         {
             "id": 1,
             "first_name": "Manuela",
             "last_name": "Gulgowski",
             "dob": "1994-12-07",
             "email": "spencer.madie@russel.com",
             "phone": "640.573.2808 x666",
             "email_verified_at": "1984-10-11T23:00:00.000000Z",
             "consent": 0,
             "avatar": "https://lorempixel.com/640/480/?62835",
             "language": "nl",
             "created_at": "2021-01-19T10:28:33.000000Z",
             "deleted_at": null,
             "provider": null,
             "provider_id": null
         }
     ]
}

Example response (404, User not found):


The User could not be found.

Request   

GET api/user/me

Body Parameters

membership_token  string  
The Membership access-token that came back when logged in

Index

requires authentication

Retrieve all Users under the same Team, Brand or Organization

Example request:

curl -X GET \
    -G "api-apostle.com/api/user/all" \
    -H "Authorization: Bearer {YOUR_AUTH_KEY}" \
    -H "Content-Type: application/json" \
    -H "Accept: application/json" \
    -d '{"membership_token":"deleniti","type":"dolorem","pagination":"\"2,3\" The first number will be the amount of items per page, the second is the current page you want to access"}'
const url = new URL(
    "api-apostle.com/api/user/all"
);

let headers = {
    "Authorization": "Bearer {YOUR_AUTH_KEY}",
    "Content-Type": "application/json",
    "Accept": "application/json",
};

let body = {
    "membership_token": "deleniti",
    "type": "dolorem",
    "pagination": "\"2,3\" The first number will be the amount of items per page, the second is the current page you want to access"
}

fetch(url, {
    method: "GET",
    headers,
    body: JSON.stringify(body),
}).then(response => response.json());

Example response (200, success):


"data": {
     "items": [
         {
             "id": 1,
             "first_name": "Manuela",
             "last_name": "Gulgowski",
             "dob": "1994-12-07",
             "email": "spencer.madie@russel.com",
             "phone": "640.573.2808 x666",
             "email_verified_at": "1984-10-11T23:00:00.000000Z",
             "consent": 0,
             "avatar": "https://lorempixel.com/640/480/?62835",
             "language": "nl",
             "created_at": "2021-01-19T10:28:33.000000Z",
             "deleted_at": null,
             "provider": null,
             "provider_id": null
         }
     ]
}

Example response (404, No Users found):


There were no Users found within our database.

Request   

GET api/user/all

Body Parameters

membership_token  string  
The Membership access-token that came back when logged in

type  string optional  
The level of indexing you want to have of all Users. (team, brand, organization)

pagination  string  
The amount of items you want per page and the page you want to access separated by a comma.

Show

requires authentication

Show the details of a User that is available under the same Team, Brand or Organization.

Example request:

curl -X GET \
    -G "api-apostle.com/api/user/detail/12" \
    -H "Authorization: Bearer {YOUR_AUTH_KEY}" \
    -H "Content-Type: application/json" \
    -H "Accept: application/json" \
    -d '{"membership_token":"voluptas","type":"aut"}'
const url = new URL(
    "api-apostle.com/api/user/detail/12"
);

let headers = {
    "Authorization": "Bearer {YOUR_AUTH_KEY}",
    "Content-Type": "application/json",
    "Accept": "application/json",
};

let body = {
    "membership_token": "voluptas",
    "type": "aut"
}

fetch(url, {
    method: "GET",
    headers,
    body: JSON.stringify(body),
}).then(response => response.json());

Example response (200, success):


"data": {
     "items": [
         {
             "id": 8,
             "first_name": "Torrey",
             "last_name": "Eichmann",
             "dob": "2007-12-31",
             "email": "layne.hagenes@osinski.com",
             "phone": "752-632-8081",
             "email_verified_at": "2015-12-15T23:00:00.000000Z",
             "consent": 0,
             "avatar": "https://lorempixel.com/640/480/?91458",
             "language": "nl",
             "created_at": "2021-01-19T10:28:33.000000Z",
             "deleted_at": null,
             "provider": null,
             "provider_id": null
         }
     ]
}

Example response (404, No User found):


There was no User found with that ID.

Example response (409, Conflict):


The User you're trying to see does not fall under your Team, Brand or Organization, thus you are unauthorized.

Request   

GET api/user/detail/{id}

URL Parameters

id  integer  
The ID of the User that you want to show.

Body Parameters

membership_token  string  
The Membership access-token that came back when logged in.

type  string optional  
The level of indexing you want to have of all Users. (team, brand, organization)

Store

requires authentication

Stores a single User with the given parameters as attributes of said User.

Example request:

curl -X POST \
    "api-apostle.com/api/user/create" \
    -H "Authorization: Bearer {YOUR_AUTH_KEY}" \
    -H "Content-Type: application/json" \
    -H "Accept: application/json" \
    -d '{"membership_token":"nihil","email":"nisi","password":"nihil","first_name":"vel","last_name":"rem","dob":"commodi","phone":"delectus","language":"sed"}'
const url = new URL(
    "api-apostle.com/api/user/create"
);

let headers = {
    "Authorization": "Bearer {YOUR_AUTH_KEY}",
    "Content-Type": "application/json",
    "Accept": "application/json",
};

let body = {
    "membership_token": "nihil",
    "email": "nisi",
    "password": "nihil",
    "first_name": "vel",
    "last_name": "rem",
    "dob": "commodi",
    "phone": "delectus",
    "language": "sed"
}

fetch(url, {
    method: "POST",
    headers,
    body: JSON.stringify(body),
}).then(response => response.json());

Example response (201, success):


"data": {
     "items": [
         {
             "email": "test@gmail.com",
             "first_name": "Rick",
             "last_name": "Martens",
             "created_at": "2021-01-19T11:40:17.000000Z",
             "id": 101
         }
     ]
}

Example response (400, Wrong values):


The given values to create the User either already exist within the database or are of the wrong type.

Example response (409, Could not be created):


The User could not be created.

Request   

POST api/user/create

Body Parameters

membership_token  string  
The Membership access-token that came back when logged in.

email  string  
The email of the User that you are trying to create.

password  string  
The password of the User that you are trying to create.

first_name  string optional  
The first name of the User that you are trying to create.

last_name  string optional  
The last name of the User that you are trying to create.

dob  date optional  
The date of birth of the User that you are trying to create.

phone  string optional  
The phone number of the User that you are trying to create.

language  string optional  
A combination of letters standing for the language of the User that you are trying to create.

Update

requires authentication

Updates a single User with the given parameters as the new attributes of the given User.

Example request:

curl -X PATCH \
    "api-apostle.com/api/user/edit/19" \
    -H "Authorization: Bearer {YOUR_AUTH_KEY}" \
    -H "Content-Type: application/json" \
    -H "Accept: application/json" \
    -d '{"membership_token":"accusamus","email":"recusandae","password":"officia","first_name":"inventore","last_name":"quis","dob":"reiciendis","phone":"itaque","language":"hic","consent":false,"avatar":"repudiandae"}'
const url = new URL(
    "api-apostle.com/api/user/edit/19"
);

let headers = {
    "Authorization": "Bearer {YOUR_AUTH_KEY}",
    "Content-Type": "application/json",
    "Accept": "application/json",
};

let body = {
    "membership_token": "accusamus",
    "email": "recusandae",
    "password": "officia",
    "first_name": "inventore",
    "last_name": "quis",
    "dob": "reiciendis",
    "phone": "itaque",
    "language": "hic",
    "consent": false,
    "avatar": "repudiandae"
}

fetch(url, {
    method: "PATCH",
    headers,
    body: JSON.stringify(body),
}).then(response => response.json());

Example response (200, success):


"data": {
     "items": [
         {
             "email": "test@gmail.com",
             "first_name": "Rick",
             "last_name": "Martens",
             "created_at": "2021-01-19T11:40:17.000000Z",
             "id": 101
         }
     ]
}

Example response (404, User not found):


Could not find the User associated with the ID that was given.

Example response (409, Conflict):


The User could not be updated.

Request   

PATCH api/user/edit/{id}

URL Parameters

id  integer  
The ID of the Membership that you want to edit.

Body Parameters

membership_token  string  
The Membership access-token that came back when logged in.

email  string  
The email of the User that you are trying to edit.

password  string  
The password of the User that you are trying to edit.

first_name  string optional  
The first name of the User that you are trying to edit.

last_name  string optional  
The last name of the User that you are trying to edit.

dob  date optional  
The date of birth of the User that you are trying to edit.

phone  string optional  
The phone number of the User that you are trying to edit.

language  string optional  
A combination of letters standing for the language of the User that you are trying to edit.

consent  boolean optional  
A boolean signifying if the User consented to the terms and conditions.

avatar  url optional  
A URL leading to the image the User wants to use as their avatar.

Update Me

requires authentication

Updates the authenticated User with the given parameters.

Example request:

curl -X PATCH \
    "api-apostle.com/api/user/me/edit" \
    -H "Authorization: Bearer {YOUR_AUTH_KEY}" \
    -H "Content-Type: application/json" \
    -H "Accept: application/json" \
    -d '{"membership_token":"soluta","email":"officiis","password":"sit","first_name":"ex","last_name":"vero","dob":"cupiditate","phone":"iste","language":"veniam","consent":false,"avatar":"a"}'
const url = new URL(
    "api-apostle.com/api/user/me/edit"
);

let headers = {
    "Authorization": "Bearer {YOUR_AUTH_KEY}",
    "Content-Type": "application/json",
    "Accept": "application/json",
};

let body = {
    "membership_token": "soluta",
    "email": "officiis",
    "password": "sit",
    "first_name": "ex",
    "last_name": "vero",
    "dob": "cupiditate",
    "phone": "iste",
    "language": "veniam",
    "consent": false,
    "avatar": "a"
}

fetch(url, {
    method: "PATCH",
    headers,
    body: JSON.stringify(body),
}).then(response => response.json());

Example response (201, success):


"data": {
     "items": [
         {
             "email": "test@gmail.com",
             "first_name": "Rick",
             "last_name": "Martens",
             "created_at": "2021-01-19T11:40:17.000000Z",
             "id": 101
         }
     ]
}

Example response (404, User not found):


Could not find the User associated with the ID that was given.

Example response (409, Conflict):


The User could not be updated.

Request   

PATCH api/user/me/edit

Body Parameters

membership_token  string  
The Membership access-token that came back when logged in.

email  string  
The email of the User that you are trying to edit.

password  string  
The password of the User that you are trying to edit.

first_name  string optional  
The first name of the User that you are trying to edit.

last_name  string optional  
The last name of the User that you are trying to edit.

dob  date optional  
The date of birth of the User that you are trying to edit.

phone  string optional  
The phone number of the User that you are trying to edit.

language  string optional  
A combination of letters standing for the language of the User that you are trying to edit.

consent  boolean optional  
A boolean signifying if the User consented to the terms and conditions.

avatar  url optional  
A URL leading to the image the User wants to use as their avatar.

Destroy

requires authentication

Destroys a single or list of Users based on the IDs given in the parameters.

Example request:

curl -X DELETE \
    "api-apostle.com/api/user/delete" \
    -H "Authorization: Bearer {YOUR_AUTH_KEY}" \
    -H "Content-Type: application/json" \
    -H "Accept: application/json" \
    -d '{"membership_token":"mollitia","array":"facilis"}'
const url = new URL(
    "api-apostle.com/api/user/delete"
);

let headers = {
    "Authorization": "Bearer {YOUR_AUTH_KEY}",
    "Content-Type": "application/json",
    "Accept": "application/json",
};

let body = {
    "membership_token": "mollitia",
    "array": "facilis"
}

fetch(url, {
    method: "DELETE",
    headers,
    body: JSON.stringify(body),
}).then(response => response.json());

Example response (212, Deleted):


"data": {
     "items": [
         {
             "id": 8,
             "id": 81,
         }
     ]
}

Example response (409, Could not be deleted):


Some or all Users given could not be deleted.

Request   

DELETE api/user/delete

Body Parameters

membership_token  string  
The User access-token that came back when logged in.

array  of optional  
id's to delete

Destroy Me

requires authentication

Destroys the authenticated User.

Example request:

curl -X DELETE \
    "api-apostle.com/api/user/me/delete" \
    -H "Authorization: Bearer {YOUR_AUTH_KEY}" \
    -H "Content-Type: application/json" \
    -H "Accept: application/json" \
    -d '{"membership_token":"perferendis"}'
const url = new URL(
    "api-apostle.com/api/user/me/delete"
);

let headers = {
    "Authorization": "Bearer {YOUR_AUTH_KEY}",
    "Content-Type": "application/json",
    "Accept": "application/json",
};

let body = {
    "membership_token": "perferendis"
}

fetch(url, {
    method: "DELETE",
    headers,
    body: JSON.stringify(body),
}).then(response => response.json());

Request   

DELETE api/user/me/delete

Body Parameters

membership_token  string  
The Membership access-token that came back when logged in.