Sub Users

Table of Contents

Overview

This is where you manage all of your sub user accounts. Update their info, remove them..

Controller: /subusers
Full Url: https://apiv1.teleapi.net/subusers/

Functions

/create

Full Url: https://apiv1.teleapi.net/subusers/create

Arguments:

Info: Create a sub user

Example Success
{
    "code" 200,
    "status": "success",
    "data": "Successfully created sub user"
}
Example Error
{
    "code" 500,
    "status": "error",
    "data": "Username already exists"
}

/list

Full Url: https://apiv1.teleapi.net/subusers/list

Arguments:

Info: Get a list of all of your sub users. Simple as that.

Example Success
{
    "code": 200,
    "status": "success",
    "data": [
        {
            "id": 42,
            "username": "bobby",
            "email": "bobby@example.com",
            "first_name": "Bobby",
            "last_name": "McFrobby",
            "phone_number": 5555555555,
            "address": "321 Some Street",
            "city": "Denver",
            "state": "CO",
            "zip": "80112",
            "create_dt": "2016-02-02 05:23:55",
            "modify_dt": "2016-02-02 05:23:55"
        },
        {
            "id": "55",
            "username": "ralph",
            "email": "ralph@example.com",
            "first_name": "Ralph",
            "last_name": "Dingo",
            "phone_number": "5555555554",
            "address" "321 Some Street",
            "city": "Englewood",
            "state": "CO",
            "zip": "80112",
            "create_dt": "2016-02-02 05:23:55",
            "modify_dt": "2016-02-02 05:23:55"
        }
    ]
}
Example Error

About the closest thing you should ever see to an error here is if you have no sub users

{
    "code": 200,
    "status": "success",
    "data": []
}

Not much of an error, I know. But this one is hard to break. Really.

/update

Full Url: https://apiv1.teleapi.net/subusers/update

Arguments:

Info: Get subuser_id from /list. Everything is optional except subuer_id. Send as much or as little as you want.

Example Success
{
    "code": 200,
    "status": "success",
    "data": "successfully updated sub user"
}
Example Error
{
    "code": "500",
    "status": "error",
    "data": "Could not update sub user"
}

Yeah, that error sucks. It's on the //TODO list

/remove

Full Url: https://apiv1.teleapi.net/subusers/remove

Arugments:

Info: Actually deleting the record. Only do this if you really really want to

Example Success
{
    "code": 200,
    "status": "success",
    "data": "Successfully removed sub user"
}
Example Error
{
    "code": 400,
    "status": "error",
    "data": "Invalid sub user id"
}