API - Companies calls

Tip

Test all of those requests in our API-Explorer.

/companies

POST /api/v1/companies
Example request body
{
    "name"              :"New App-Arena customer. {{$timestamp}}",
    "subdomain"         :"apparena_customer_{{$timestamp}}",
    "address1"          :"My street 1",
    "address2"          :"My street 2",
    "zip"               :"12345",
    "city"              :"My city",
    "country"           :"DE",
    "logo"              :"https://app-manager.s3.amazonaws.com/apps/models/3/0/4/0/de_DE/AppArena_Logo_aufweiss300x80_1413369016_0.png",
    "color1"            :"#478AB8",
    "color2"            :"#2D343D",
    "font"              :"helvetica-neue"
}
Data:
  • name (string) – (Required) Name of the company
  • parent_id (integer) – (Optional) ID of the company whos customer the newly created company should be like
  • subdomain (string) – (Required) Subdomain for all apps the company will create
  • address1 (string) – (Optional) Address field 1, e.g. Street 1
  • address2 (string) – (Optional) Address field 2, e.g. Street 2
  • zip (string) – (Optional) Zip code
  • city (string) – (Optional) City
  • country (string) – (Optional) Two letter country code http://en.wikipedia.org/wiki/ISO3166-1alpha-2
  • logo (string) – (Optional) Url to the company logo
  • color1 (string) – (Optional) Primary company color
  • color2 (string) – (Optional) Secondary company color
  • font (string) – (Optional) Company font name
Example response body
{
    "address1": "My street 1",
    "address2": "My street 2",
    "city": "My city",
    "color1": "#478AB8",
    "color2": "#2D343D",
    "country": "DE",
    "id": 440,
    "logo": "https:\/\/app-manager.s3.amazonaws.com\/apps\/models\/3\/0\/4\/0\/de_DE\/AppArena_Logo_aufweiss300x80_1413369016_0.png",
    "name": "New App-Arena customer. 1430140889",
    "parent_id": 1,
    "subdomain": "apparena_customer_1430140889",
    "timestamp": 1430140930,
    "zip": "12345",
    "_links": {
        "self": {
            "href": "https:\/\/v2.app-arena.com\/api\/v1\/companies\/440"
        }
    }
}
GET /api/v1/companies
Example request body
{
    "_links": {
        "self": {
            "href": "https:\/\/v2.app-arena.com\/api\/v1\/companies?page=1"
        },
        "first": {
            "href": "https:\/\/v2.app-arena.com\/api\/v1\/companies"
        },
        "last": {
            "href": "https:\/\/v2.app-arena.com\/api\/v1\/companies?page=1"
        }
},
"_embedded": {
    "data": [
        {  ... },
        {
            "id": 1,
            "name": "iConsultants GmbH",
            "subdomain": "app-arena",
            "address1": "Kleingedankstr. 12",
            "zip": "50677",
            "city": "Kölle",
            "country": "DE",
            "logo": "https:\/\/app-manager.s3.amazonaws.com\/apps\/models\/3\/0\/4\/0\/de_DE\/AppArena_Logo_aufweiss300x80_1413369016_0.png",
            "color1": "#478AB8",
            "color2": "#2D343D",
            "users": { },
            "_links": {
                "self": {
                    "href": "https:\/\/v2.app-arena.com\/api\/v1\/companies\/1"
                }
            }
        }
        {  ... },
    ]
}

Parameter documentation of the companies.

/companies/:company_id

GET /api/v1/companies/:company_id
Path arguments:company_id – id of the company.
Example request body
{
    "id": 363,
    "name": "New App-Arena customer. 1429097807",
    "subdomain": "apparena_customer_1429097807",
    "address1": "My street 1",
    "address2": "My street 2",
    "zip": "12345",
    "city": "My city",
    "country": "DE",
    "logo": "https:\/\/app-manager.s3.amazonaws.com\/apps\/models\/3\/0\/4\/0\/de_DE\/AppArena_Logo_aufweiss300x80_1413369016_0.png",
    "color1": "#478AB8",
    "color2": "#2D343D",
    "_links": {
        "self": {
            "href": "https:\/\/v2.app-arena.com\/api\/v1\/companies\/363"
        }
    }
}

Parameter documentation of the companies.

PUT /api/v1/companies/:company_id
Path arguments:company_id – id of the company.
Example request body
{
    "name"          :"Updated New Company Name _{{$timestamp}}",
    "subdomain"     :"updated_my_subdomain_{{$timestamp}}",
    "address1"      :"Updated My street 1",
    "address2"      :"Updated My street 2",
    "zip"           :"11112345",
    "city"          :"Updated My city",
    "country"       :"AT",
    "logo"          :"https://app-manager.s3.amazonaws.com/apps/models/3/0/4/0/de_DE/AppArena_Logo_aufweiss300x80_1413369016_0.png",
    "color1"        :"#111111",
    "color2"        :"#222222",
    "font"          :"verdana"
}
Data:
  • name (string) – (Required) Name of the company
  • subdomain (string) – (Optional) Subdomain for all apps the company will create
  • address1 (string) – (Optional) Address field 1, e.g. Street 1
  • address2 (string) – (Optional) Address field 1, e.g. Street 2
  • zip (string) – (Optional) Zip code
  • city (string) – (Optional) city
  • country (string) – (Optional) Two letter country code http://en.wikipedia.org/wiki/ISO3166-1alpha-2
  • corporate_identity (object) – (Optional) Corporate Identity configuration for faster app setup (values will be used as default settings, when creating apps)
  • logo (string) – (Optional) Url to the company logo
  • color1 (string) – (Optional) Primary company color
  • color2 (string) – (Optional) Secondary company color
  • font (string) – (Optional) Company font name
Example response body
{
    "address1": "Updated My street 1",
    "address2": "Updated My street 2",
    "city": "Updated My city",
    "color1": "#111111",
    "color2": "#222222",
    "country": "AT",
    "id": 440,
    "logo": "https:\/\/app-manager.s3.amazonaws.com\/apps\/models\/3\/0\/4\/0\/de_DE\/AppArena_Logo_aufweiss300x80_1413369016_0.png",
    "name": "Updated New Company Name_1430141082",
    "parent_id": 1,
    "subdomain": "updated_my_subdomain_1430141082",
    "timestamp": 1430141123,
    "zip": "11112345",
    "_links": {
        "self": {
            "href": "https:\/\/v2.app-arena.com\/api\/v1\/companies\/440"
        }
    }
}
DELETE /api/v1/companies/:company_id

Successful DELETE requests will return HTTP-Status code 204.

/companies/:company_id/customers

GET /api/v1/companies/:company_id/customers
Path arguments:company_id – id of the company.
Example request body
{
    "_links": {
        "self": {
            "href": "https:\/\/v2.app-arena.com\/api\/v1\/companies\/383\/customers"
        }
    },
    "_embedded": {
        "data": [
            {
                "id": 363,
                "name": "New App-Arena customer. 1429097807",
                "subdomain": "apparena_customer_1429097807",
                "address1": "My street 1",
                "address2": "My street 2",
                "zip": "12345",
                "city": "My city",
                "country": "DE",
                "logo": "https:\/\/app-manager.s3.amazonaws.com\/apps\/models\/3\/0\/4\/0\/de_DE\/AppArena_Logo_aufweiss300x80_1413369016_0.png",
                "color1": "#478AB8",
                "color2": "#2D343D",
                "_links": {
                    "self": {
                        "href": "https:\/\/v2.app-arena.com\/api\/v1\/companies\/363"
                    }
                }
            }
        ]
    },
    "page_count": 0,
    "page_size": 25,
    "total_items": 0
}

Parameter documentation of the companies.

/companies/:company_id/instances

GET /api/v1/companies/:company_id/instances
Path arguments:company_id – id of the company.
Example request body
{
    "_links": {
        "self": {
            "href": "https:\/\/v2.app-arena.com\/api\/v1\/companies\/383\/instances"
        }
    },
    "_embedded": {
        "data": [
            {
                "active": 1,
                "base_url": "https:\/\/adventskranz.onlineapp.co\/",
                "description": "The description of my new instance.",
                "id": 9627,
                "lang_tag": "en_US",
                "m_id": 299,
                "name": "New Instance 1427295997",
                "template_id": 780,
                "timestamp": 1427296778,
                "_links": {
                    "self": {
                        "href": "https:\/\/v2-stage.app-arena.com\/api\/v1\/instances\/9627"
                    }
                }
            }
        ]
    },
    "page_count": 0,
    "page_size": 25,
    "total_items": 0
}

Link to the parameter documentation.

/companies/:company_id/users

GET /api/v1/companies/:company_id/users
Path arguments:company_id – id of the company.
Example request body
{
    "_links": {
        "self": {
            "href": "https:\/\/v2.app-arena.com\/api\/v1\/companies\/383\/users"
        }
    },
    "_embedded": {
        "data": [
            {
                "id": 8012,
                "username": "user-1429943426",
                "password": "$2y$15$6pE0VJ0CPHrnTzyx49HBjOtTQ4ywPl2CGgoewZLVV3yXKKomTyK\/C",
                "email": "extremterro@outlook.de",
                "displayName": null,
                "lang_tag": "de_DE",
                "state": 1,
                "roles": [
                    "user",
                    "admin"
                ],
                "company_id": 427,
                "_links": {
                    "self": {
                        "href": "https:\/\/v2.app-arena.com\/api\/v1\/companies\/427\/users\/8012"
                    }
                }
            }
        ]
    },
    "page_count": 1,
    "page_size": 25,
    "total_items": 1
}
Data:
  • id (string) – ID of the User
  • username (string) – Username created by the User
  • password (string) – Password for the User
  • email (string) – Email of the current User
  • displayName (string) – Username which is displayed
  • lang_tag (string) – Language of the current User
  • state (int) – (NOCH EINFÜGEN)
  • roles (string) – Die dem User zugeteilte Rolle z.B. Admin oder User
  • company_id (int) – ID of the company of the User