Each endpoint takes form encoded data and returns a JSON response.
Each endpoint requires an API key from Snoonet Staff to access.
Every endpoint accepts an optional user_ip
parameter to specify the IP address of the user the action is being done on behalf of. Some endpoints require this parameter.
{"error":{"id":"missing_parameters","message":"Missing required request parameters","parameters":[<MISSING_PARAMS>]},"status":"error"}
- Occurs when a required parameter is not supplied for this request
username
- Username of the account to registerpassword
- Password to register the accouht withemail
optional if forceemail=false in anope - The email address to associate with this accountsource
- A string identifying where the user is registering from, form_store_server
user_ip
- The IP address of the user creating this accountident
optional - If specified, is used to populate the default access list for the new accountoauth
optional - If set to1
, requires that the API wrapper verify the email address against the IRC.com API. This parameter only applies to the IRC.com implementation of this API.
{"session":"<SESSION_ID>","status":"ok","verify":"<VERIFY_TYPE>","need_verify": true|false}
VERIFY_TYPE
may bemail
,admin
, ornone
. This indicates the account verification method that is configured.
Note: The message
field is meant only to describe the error to a user, this text may change unexpectedly
{"error":{"id":"name_in_use","message":"This username is in use by another user and can not be registered"},"status":"error"}
{"error":{"id":"user_exists","message":"A user with that name is already registered"},"status":"error"}
{"error":{"id":"no_guest","message":"Guest nicknames may not be registered"},"status":"error"}
{"error":{"id":"invalid_name","message":"Username is invalid"},"status":"error"}
{"error":{"id":"forbidden_user","message":"This nickname is forbidden from registration"},"status":"error"}
{"error":{"id":"missing_email","message":"An email address is required for registration"},"status":"error"}
{"error":{"id":"invalid_email","message":"A valid email address is required for registration"},"status":"error"}
{"error":{"id":"forbidden_email","message":"This email address is forbidden"},"status":"error"}
{"error":{"id":"max_email","message":"This email address has reached its account limit"},"status":"error"}
{"error":{"id":"invalid_password","message":"That password is invalid"},"status":"error"}
session
- Thesession
ID returned from the/api/register
callcode
- The user's verification code for their accountuser_ip
- The IP address of the user confirming this account
{"status":"ok"}
{"error":{"id":"no_login","message":"You are not logged in to an account"},"status":"error"}
{"error":{"id":"already_confirmed","message":"This account is already confirmed"},"status":"error"}
{"error":{"id":"wrong_code","message":"Incorrect confirmation code supplied"},"status":"error"}
username
- The user's usernamepassword
- The user's passworduser_ip
- The IP address of the user logging in
{"session":"<SESSION_ID>","account":"<ACCOUNT_NAME>","status":"ok","verified":true|false,"expires":3133657200}
{"error":{"id":"failed_login","message":"Invalid login credentials"},"status":"error"}
session
- The session to terminate
{"status":"ok"}
{"error":{"id":"no_login","message":"You are not logged in to an account"},"status":"error"}
account
email
{"status":"ok"}
- Returned if the password reset email was sent or the account/email don't match a valid account, meaning it will "silently" (logged internally) ignore invalid account details
{"error":{"id":"mail_failed","message":"Unable to send reset email"},"status":"error"}
account
- Account name to reset the password forcode
- Confirmation code from the usernewpass
- Sets the new password
{"status":"ok"}
{"error":{"id":"wrong_code","message":"Invalid reset token"},"status":"error"}
{"error":{"id":"expired_code","message":"Expired reset token"},"status":"error"}
{"error":{"id":"invalid_password","message":"That password is invalid"},"status":"error"}
session
newpass
{"status":"ok"}
{"error":{"id":"no_login","message":"You are not logged in to an account"},"status":"error"}
{"error":{"id":"invalid_password","message":"That password is invalid"},"status":"error"}
Authentication tokens can be used in place of passwords anywhere a password is needed
session
name
{"status":"ok","token":{"token":"<AUTH_TOKEN>","name":"<TOKEN_NAME>"}}
{"error":{"id":"token_add_failed","message":"Unable to add token"},"status":"error"}
{"error":{"id":"tokens_disabled","message":"Token authentication appears to be disabled"},"status":"error"}
session
{"status":"ok","tokens":[{"token":"<AUTH_TOKEN>","name":"<TOKEN_NAME>","id":1}]}
{"error":{"id":"tokens_disabled","message":"Token authentication appears to be disabled"},"status":"error"}
id
- Either the numeric ID or the token itself to be removed
{"status":"ok"}
{"error":{"id":"tokens_disabled","message":"Token authentication appears to be disabled"},"status":"error"}
{"error":{"id":"no_token","message":"No matching token found."},"status":"error"}
session
{"status":"ok","expires":3133657200}
{"error":{"id":"tokens_disabled","message":"Token authentication appears to be disabled"},"status":"error"}
Authentication tags can be used in place of passwords anywhere a password is needed
session
name
- Tag name.value
- Tag value.
{"session":"<AUTH_TOKEN>","status":"ok"}
{"error":{"id":"no_login","message":"Login required"},"status":"error"}
{"error":{"id":"invalid_tag_key","message":"Tag key contains an invalid character."},"status":"error"}
session
name
- Tag name.
{"session":"<AUTH_TOKEN>","status":"ok"}
{"error":{"id":"no_login","message":"Login required"},"status":"error"}
{"error":{"id":"no_tag","message":"No matching tag found."},"status":"error"}
session
{"session":"<AUTH_TOKEN>","status":"ok","tags":{"tagname":"tag value"}}
{"error":{"id":"no_login","message":"Login required"},"status":"error"}