Resellers

The Reseller notion is an APIO specific concept (i.e. not managed by the underlying AS).

It allows to associoate Groups and/or Tenants to one Reseller (the object managed by the APIs below).

Users of level Tenant Admin or System Admin can be defined as “restricted” it means that they are associated to one Reseller and that they will only be allowed to see and manage resources of the Groups and Tenant that are linked to the same Reseller.

Retrieve Resellers list

GET /api/v1/local/resellers/

Retrieve the local users list.

Example request:

GET /api/v1/local/resellers/ HTTP/1.1
Host: example.com

Example response:

HTTP/1.1 200 OK
Content-Type: "application/json"

{
   "resellers": {
      [
         {
            "name": "ApioReseller",
            "externalName": "Best Reseller",
            "extraData": {},
         }
      ]
   }
}
Response JSON Object:
Status Codes:

Retrieve Reseller instance

GET /api/v1/local/resellers/(string: username)/

Retrieve a Reseller instance.

Example request:

GET /api/v1/local/resellers/MyReseller/ HTTP/1.1
Host: example.com

Example response:

HTTP/1.1 200 OK
Content-Type: "application/json"


{
   "name": "ApioReseller",
   "externalName": "Best Reseller",
   "extraData": {},
}
Response JSON Object:
Status Codes:

Create a Reseller

POST /api/v1/local/resellers/

Create a Reseller instance.

Example request:

POST /api/v1/local/resellers/ HTTP/1.1
Host: example.com
Content-Type: "application/json"

{
   "name": "ApioReseller",
   "externalName": "Best Reseller",
   "extraData": {},
}
Request JSON Object:

Example response:

Response:

Similar to GET instance method response.

Status Codes:
  • 201 Created – created

  • 400 Bad Request – failed to create with the following main error cases: * ALREADY_EXISTS (11) : A Reseller with same name already exists

Update a Reseller

PUT /api/v1/local/apio_users/(string: username)/

Update a local user instance.

Example request:

PUT /api/v1/local/apio_users/ApioSupportTest@sip.netaxis.be/ HTTP/1.1
Host: example.com
Content-Type: "application/json"

{
   "name": "ApioReseller",
   "externalName": "Best Reseller",
   "extraData": {},
}
Request JSON Object:

Example response:

Response:

Similar to GET instance method response.

Status Codes:

Delete a Reseller

DELETE /api/v1/local/resellers/(string: username)/

Delete a Reseller instance.

Example request:

DELETE /api/v1/local/resellers/MyReseller/ HTTP/1.1
Host: example.com
Content-Type: "application/json"

{}

Example response:

HTTP/1.1 200 OK
Content-Type: "application/json"

{}

Example response:

HTTP/1.1 400 Bad Request
Content-Type: "application/json"

{
   "errors": [
      {
         "code": 30,
         "message": "Can not delete Reseller object because referenced by other objects",
         "details": {
            "tenantDatas": ["ApioSpTest"],
            "groupDatas": ["ApioGrpTest"],
            "localUsers": ["reseller@netaxis.be"]
         }
      }
   ]
}
Status Codes:
  • 200 OK – instance deleted

  • 404 Not Found – not found

  • 400 Bad Request – failed to update. The most usual case will be when some objects are linked tot he Reseller (Error Code STILL_IN_USE 30). In that case the details of the error contains the ids of the related objects.

Reseller Attributes

Name

Type

Methods

Description

GET

POST

PUT

name

String

A

R

O

The reseller’s name

externalName

String

A

O

O

An external name for a reseller. Such as a name in an other system. No APIO logic associated.

extraData

Object

A

O

O

Extra data (JSON object) that can be stored. No APIO logic associated.|