Referrals

Sign-up codes and partner accounts.

Codes let people sign up themselves; create-referral equals create-user, except for level 4.

Keep in mind

Same records
get-referrals lists the same accounts as get-users.
Admin by default
create-referral creates level 2 unless you pass level.
Software owners
level 4 adds a co-owner to software you created. Software owners are not listed or changed through the API.

List referrals

POST https://dev.mod.wtf/api/v2/action

methodget-referrals

Same as get-users.

Body

  • soft_id integer optional

    ID of a software you own; your main software when omitted

Errors it can return

POST /api/v2/action HTTP/1.1
Host: dev.mod.wtf
Content-Type: application/json
Accept: application/json

{
    "api_key": "YOUR_API_KEY",
    "method": "get-referrals"
}

Create referral

POST https://dev.mod.wtf/api/v2/action

methodcreate-referral

Same as create-user; level defaults to 2 (Admin). In software you created, level 4 adds a Software owner.

Body

  • username string required

    4-25 alphanumeric chars

  • password string required

    8-128 chars

  • level integer optional

    2 Admin or 3 Reseller, default 2. 4 Software owner only in software you created

  • email string optional

    Up to 40 characters; a placeholder address is generated when omitted

  • fullname string optional

    Up to 155 characters: letters, digits, spaces, periods, apostrophes and hyphens

  • expiration_days integer optional

    0 to 18250. Admin and Reseller default to 30 days. Software owners never expire

  • soft_id integer optional

    ID of a software you own; your main software when omitted

Errors it can return

POST /api/v2/action HTTP/1.1
Host: dev.mod.wtf
Content-Type: application/json
Accept: application/json

{
    "api_key": "YOUR_API_KEY",
    "method": "create-referral",
    "username": "newpartner",
    "password": "abcd1234",
    "expiration_days": 30
}

List referral codes

POST https://dev.mod.wtf/api/v2/action

methodget-referral-codes

List sign-up codes of a software. used=0 for free codes, used=1 for used ones.

Body

  • soft_id integer optional

    ID of a software you own; default is your main software

  • used integer optional

    0 or 1

  • limit integer optional

    1-200, default 50

  • offset integer optional

    Default 0

Errors it can return

POST /api/v2/action HTTP/1.1
Host: dev.mod.wtf
Content-Type: application/json
Accept: application/json

{
    "api_key": "YOUR_API_KEY",
    "method": "get-referral-codes",
    "used": 0
}

Create referral code

POST https://dev.mod.wtf/api/v2/action

methodcreate-referral-code

Create a one-time sign-up code. It sets the role, balance and account term of whoever signs up with it.

Body

  • soft_id integer optional

    ID of a software you own; default is your main software

  • level integer optional

    2 Admin or 3 Reseller, 4 only in software you created; default 3

  • saldo integer optional

    Starting balance, default 0

  • days integer optional

    1, 3, 7, 14, 30, 60, 90, 180, 365 or 0 for lifetime; default 30

Errors it can return

POST /api/v2/action HTTP/1.1
Host: dev.mod.wtf
Content-Type: application/json
Accept: application/json

{
    "api_key": "YOUR_API_KEY",
    "method": "create-referral-code",
    "level": 3,
    "saldo": 500,
    "days": 30
}

Delete referral code

POST https://dev.mod.wtf/api/v2/action

methoddelete-referral-code

Delete an unused code. Used codes stay in history.

Body

  • code_id integer required

    Code ID from get-referral-codes

  • soft_id integer optional

    ID of a software you own; your main software when omitted

Errors it can return

POST /api/v2/action HTTP/1.1
Host: dev.mod.wtf
Content-Type: application/json
Accept: application/json

{
    "api_key": "YOUR_API_KEY",
    "method": "delete-referral-code",
    "code_id": 9
}
Esc