Site:API:Authentication
From Metrixstream
(Difference between revisions)
MetrixJustin (Talk | contribs) (→Login) |
MetrixAdmin (Talk | contribs) m (→Required Parameters) |
||
(11 intermediate revisions by 2 users not shown) | |||
Line 1: | Line 1: | ||
− | = | + | = Authentication = |
− | == | + | == Login == |
− | + | This API call is responsible for logging in a user. | |
− | == | + | === Authentication Restrictions === |
− | == | + | None. |
+ | |||
+ | === Required Parameters === | ||
+ | |||
+ | * <code>action=login</code> | ||
+ | * <code>username</code>: the username of the user | ||
+ | * <code>password</code>: the password of the user | ||
+ | |||
+ | === Successful Response === | ||
+ | |||
+ | * <code>status=ok</code> | ||
+ | |||
+ | == Signup == | ||
+ | |||
+ | This API call is responsible for signing up a user. | ||
+ | |||
+ | === Authentication Restrictions === | ||
+ | |||
+ | None. | ||
+ | |||
+ | === Required Parameters === | ||
+ | |||
+ | * <code>action=signup</code> | ||
+ | * <code>username</code>: the username of the user; this must adhere to the site restrictions for username requirements | ||
+ | * <code>password</code>: the password of the user; this must adhere to the site restrictions for password requirements | ||
+ | * <code>email</code>: the email address of the user; this must be a valid email address and not already claimed by another user | ||
+ | |||
+ | === Optional Parameters === | ||
+ | |||
+ | * <code>password2</code>: this can be used to verify the user didn't make a typo mistake with their password choice | ||
+ | * <code>phone</code>: the primary phone number for this user | ||
+ | * <code>fax</code>: the primary fax number for this user | ||
+ | * <code>dob</code>: the user's date of birth; this is | ||
+ | * <code>sex</code>: the sex of the user | ||
+ | * <code>description</code>: the bio of the user | ||
+ | * <code>display_name</code>: the display name of the user; this is a non-unique field and is used for display only | ||
+ | * <code>display_status</code>: the display status of the user; this is common for social websites | ||
+ | * <code>billing_first_name</code>: the first name of the billing contact | ||
+ | * <code>billing_last_name</code>: the last name of the billing contact | ||
+ | * <code>billing_company</code>: the company name of the billing contact | ||
+ | * <code>billing_address</code>: the address of the billing contact | ||
+ | * <code>billing_address2</code>: an optional 2nd line for the address of the billing contact | ||
+ | * <code>billing_city</code>: the city of the billing contact | ||
+ | * <code>billing_state</code>: the state of the billing contact | ||
+ | * <code>billing_zip</code>: the zip code of the billing contact | ||
+ | * <code>billing_country</code>: the country of the billing contact | ||
+ | * <code>billing_phone</code>: an optional phone number related to the billing contact | ||
+ | * <code>billing_fax</code>: an optional fax number related to the billing contact | ||
+ | * <code>billing_email</code>: an optional email related to the billing contact | ||
+ | * <code>attr:user:$name</code>: $name should be replaced by the name of any custom fields that have been created for all user objects; make sure to set the permission of "editable" on each custom field you want the user to be able to specify themselves | ||
+ | |||
+ | === Successful Response === | ||
+ | |||
+ | * <code>status=ok</code> | ||
+ | |||
+ | == Logout == | ||
+ | |||
+ | This API call is responsible for logging out a user. | ||
+ | |||
+ | === Authentication Restrictions === | ||
+ | |||
+ | Any authenticated user. | ||
+ | |||
+ | === Required Parameters === | ||
+ | |||
+ | * <code>action=logout</code> | ||
+ | |||
+ | === Successful Response === | ||
+ | |||
+ | * <code>status=ok</code> | ||
+ | |||
+ | == Forgot Password == | ||
+ | |||
+ | This API call is responsible for sending a forgot password email to a successful match of a username or email address. | ||
+ | |||
+ | === Authentication Restrictions === | ||
+ | |||
+ | None. | ||
+ | |||
+ | === Required Parameters === | ||
+ | |||
+ | * <code>action=forgotpassword</code> | ||
+ | * <code>username</code>: the username of the user; an email address can also be passed to this same field as a convenience | ||
+ | |||
+ | === Successful Response === | ||
+ | |||
+ | * <code>status=ok</code>: this response is returned regardless if the param:username field actually matches a user's username or email address; the reason for this is so that someone can't run a brute force attack and discover all the email addresses that belong to your users |
Latest revision as of 22:48, 8 January 2013
Contents |
[edit] Authentication
[edit] Login
This API call is responsible for logging in a user.
[edit] Authentication Restrictions
None.
[edit] Required Parameters
-
action=login
-
username
: the username of the user -
password
: the password of the user
[edit] Successful Response
-
status=ok
[edit] Signup
This API call is responsible for signing up a user.
[edit] Authentication Restrictions
None.
[edit] Required Parameters
-
action=signup
-
username
: the username of the user; this must adhere to the site restrictions for username requirements -
password
: the password of the user; this must adhere to the site restrictions for password requirements -
email
: the email address of the user; this must be a valid email address and not already claimed by another user
[edit] Optional Parameters
-
password2
: this can be used to verify the user didn't make a typo mistake with their password choice -
phone
: the primary phone number for this user -
fax
: the primary fax number for this user -
dob
: the user's date of birth; this is -
sex
: the sex of the user -
description
: the bio of the user -
display_name
: the display name of the user; this is a non-unique field and is used for display only -
display_status
: the display status of the user; this is common for social websites -
billing_first_name
: the first name of the billing contact -
billing_last_name
: the last name of the billing contact -
billing_company
: the company name of the billing contact -
billing_address
: the address of the billing contact -
billing_address2
: an optional 2nd line for the address of the billing contact -
billing_city
: the city of the billing contact -
billing_state
: the state of the billing contact -
billing_zip
: the zip code of the billing contact -
billing_country
: the country of the billing contact -
billing_phone
: an optional phone number related to the billing contact -
billing_fax
: an optional fax number related to the billing contact -
billing_email
: an optional email related to the billing contact -
attr:user:$name
: $name should be replaced by the name of any custom fields that have been created for all user objects; make sure to set the permission of "editable" on each custom field you want the user to be able to specify themselves
[edit] Successful Response
-
status=ok
[edit] Logout
This API call is responsible for logging out a user.
[edit] Authentication Restrictions
Any authenticated user.
[edit] Required Parameters
-
action=logout
[edit] Successful Response
-
status=ok
[edit] Forgot Password
This API call is responsible for sending a forgot password email to a successful match of a username or email address.
[edit] Authentication Restrictions
None.
[edit] Required Parameters
-
action=forgotpassword
-
username
: the username of the user; an email address can also be passed to this same field as a convenience
[edit] Successful Response
-
status=ok
: this response is returned regardless if the param:username field actually matches a user's username or email address; the reason for this is so that someone can't run a brute force attack and discover all the email addresses that belong to your users