Labs/Weave/User/API: Difference between revisions

Jump to navigation Jump to search
no edit summary
No edit summary
Line 13: Line 13:
The Weave User API has a set of  [https://wiki.mozilla.org/Labs/Weave/0.3/ResponseCodes Weave Response Codes] to cover errors in the request or on the server side. The format of a successful response is defined in the appropriate request method section.
The Weave User API has a set of  [https://wiki.mozilla.org/Labs/Weave/0.3/ResponseCodes Weave Response Codes] to cover errors in the request or on the server side. The format of a successful response is defined in the appropriate request method section.


The URL for User requests is structured as follows:
https://<server name>/<api pathname>/<version>/<username>/<further instruction>
For the central weave server API, the servername is "auth.services.mozilla.com", the pathname is "user", and the version is "1"
== GET ==
== GET ==


'''https://''server''/user/1/''username''/ '''
'''https://''server''/''pathname''/''version''/''username''/ '''


Returns 1 if the username is in use, 0 if it is available.
Returns 1 if the username is in use, 0 if it is available.


'''https://''server''/user/1/''username''/node/weave '''
'''https://''server''/''pathname''/''version''/''username''/node/weave '''


Returns the Weave Node that the client is located on. Weave-specific calls should be directed to that node.
Returns the Weave Node that the client is located on. Weave-specific calls should be directed to that node.


== PUT ==
== PUT ==
 
'''https://''server''/''pathname''/''version''/''username''/ '''
'''https://''server''/user/1/''username''/ '''


Requests that an account be created for ''username''.  
Requests that an account be created for ''username''.  
Line 59: Line 63:
== POST ==
== POST ==


'''https://''server''/user/1/''username''/email '''
'''https://''server''/''pathname''/''version''/''username''/email '''


''NOTE:'' Requires basic authentication with the username and password associated with the account. The auth username must match the username in the path.
''NOTE:'' Requires basic authentication with the username and password associated with the account. The auth username must match the username in the path.
Line 67: Line 71:
The server will return the new email address on success, or an error message if some portion of the process fails.
The server will return the new email address on success, or an error message if some portion of the process fails.


 
'''https://''server''/''pathname''/''version''/''username''/password '''
'''https://''server''/user/1/''username''/password '''


''NOTE:'' Requires basic authentication with the username and (current) password associated with the account. The auth username must match the username in the path.
''NOTE:'' Requires basic authentication with the username and (current) password associated with the account. The auth username must match the username in the path.
Line 78: Line 81:
== DELETE ==  
== DELETE ==  


'''https://''server''/user/1/''username''/ '''
'''https://''server''/''pathname''/''version''/''username''/ '''


''NOTE:'' Requires simple authentication with the username and password associated with the account. The auth username must match the username in the path.
''NOTE:'' Requires simple authentication with the username and password associated with the account. The auth username must match the username in the path.
canmove, Confirmed users
1,173

edits

Navigation menu