1. User REST API
1.1. General Jeeshop REST principles
1.1.1. Methods
Method | Operations |
---|---|
GET |
Get a single resource or get a collection of resources. |
POST |
Create a new resource. |
PUT |
Update properties of an existing resource. |
DELETE |
Delete an existing resource. |
HEAD |
Check authentication credentials. (Only available on User resource) |
The media-type of HTTP requests should be set to application/json.
The media-type of HTTP responses is always application/json unless binary content is requested (eg. deployment resource data), the media-type of the content is used.
Items relationships are always lazy loaded and must be explicitly requested to get them. (they are not eagerly fetched)
1.1.2. Authentication and authorization
Jeeshop REST API operations are protected by role based access. Therefore, most of REST operations require authentication.
Jeeshop authentication and authorization are managed using JaaS. See this documentation for details about Jeeshop JaaS configuration on Wildfly application server.
Currently, only Basic HTTP access authentication is documented, so you should include a Authorization: Basic ...== HTTP-header when performing requests to API methods which are not public.
For security purpose we only allow Basic Authentication in combination with HTTPS. See this documentation for details about Jeeshop SSL configuration on Wildfly application server. |
Each REST operation documentation declares one or many roles which are required for method use :
-
admin - Role dedicated to admin / back office operations. (Typically, it has to be set on Jeeshop administrators accounts for Jeeshop-Admin application use)
-
user - Default role bound to Jeeshop users. (Every online store registered users have this role)
-
ALL - Public. Methods which declare this role are public. Authentication is not required for their use.
1.2. User resource
Manages users.
1.2.1. Get all users
URL |
/rs/users |
||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
Method |
GET |
||||||||||||||||||
Roles allowed |
admin |
||||||||||||||||||
Parameters |
|
||||||||||||||||||
Response HTTP statuses |
|
||||||||||||||||||
Response Body |
Unresolved directive in <stdin> - include::snippets/User.list.json.adoc[] |
1.2.2. Get users count
URL |
/rs/users/count |
||||||
---|---|---|---|---|---|---|---|
Method |
GET |
||||||
Roles allowed |
admin |
||||||
Parameters |
|
||||||
Response HTTP statuses |
|
||||||
Response Body |
Unresolved directive in <stdin> - include::snippets/user_count.json.adoc[] |
1.2.3. Get a specific user
URL |
/rs/users/[id] |
||||||
---|---|---|---|---|---|---|---|
Method |
GET |
||||||
Roles allowed |
admin |
||||||
Parameters |
|
||||||
Response HTTP statuses |
|
||||||
Response Body |
Unresolved directive in <stdin> - include::snippets/user.json.adoc[] |
1.2.4. Get current authenticated user
URL |
/rs/users/current |
||||||
---|---|---|---|---|---|---|---|
Method |
GET |
||||||
Roles allowed |
admin |
||||||
Response HTTP statuses |
|
||||||
Response Body |
Unresolved directive in <stdin> - include::snippets/user.json.adoc[] |
1.2.5. Create a user
URL |
/rs/users |
||||||||
---|---|---|---|---|---|---|---|---|---|
Method |
POST |
||||||||
Roles allowed |
ALL |
||||||||
Parameters |
|
||||||||
Request Body |
Unresolved directive in <stdin> - include::snippets/user.in.json.adoc[] |
||||||||
Response HTTP statuses |
|
||||||||
Response Body |
Unresolved directive in <stdin> - include::snippets/user.json.adoc[] |
1.2.6. Modify a user
URL |
/rs/users |
||||||
---|---|---|---|---|---|---|---|
Method |
PUT |
||||||
Roles allowed |
admin, user |
||||||
Parameters |
|
||||||
Request Body |
Unresolved directive in <stdin> - include::snippets/user.json.adoc[] |
||||||
Response HTTP statuses |
|
||||||
Response Body |
Unresolved directive in <stdin> - include::snippets/user.json.adoc[] |
1.2.7. Delete a user
URL |
/rs/users/[id] |
||||||
---|---|---|---|---|---|---|---|
Method |
DELETE |
||||||
Roles allowed |
admin |
||||||
Parameters |
|
||||||
Response HTTP statuses |
|
1.2.8. Activate a user
URL |
/rs/users/[login] |
|||||||||
---|---|---|---|---|---|---|---|---|---|---|
Method |
PUT |
|||||||||
Roles allowed |
ALL |
|||||||||
Parameters |
|
|||||||||
Request Body |
Unresolved directive in <stdin> - include::snippets/UUID.json.adoc[] |
|||||||||
Response HTTP statuses |
|
|||||||||
Response Body |
1.2.9. Request user password reset
URL |
/rs/users/[login]/password |
||||||
---|---|---|---|---|---|---|---|
Method |
POST |
||||||
Roles allowed |
ALL |
||||||
Parameters |
|
||||||
Response HTTP statuses |
|
1.2.10. Reset user password
URL |
/rs/users/[login]/password |
||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|
Method |
PUT |
||||||||||||
Roles allowed |
ALL |
||||||||||||
Parameters |
|
||||||||||||
Response HTTP statuses |
|
1.3. Mail template resource
Manages mail templates.
1.3.1. Get all mail templates
URL |
/rs/mailtemplates |
||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
Method |
GET |
||||||||||||||||||
Roles allowed |
admin |
||||||||||||||||||
Parameters |
|
||||||||||||||||||
Response HTTP statuses |
|
||||||||||||||||||
Response Body |
Unresolved directive in <stdin> - include::snippets/MailTemplate.list.json.adoc[] |
1.3.2. Get mail templates count
URL |
/rs/mailtemplates/count |
||||
---|---|---|---|---|---|
Method |
GET |
||||
Roles allowed |
admin |
||||
Response HTTP statuses |
|
||||
Response Body |
Unresolved directive in <stdin> - include::snippets/mailtemplate_count.json.adoc[] |
1.3.3. Get a specific mail template
URL |
/rs/mailtemplates/[id] |
||||||
---|---|---|---|---|---|---|---|
Method |
GET |
||||||
Roles allowed |
admin |
||||||
Parameters |
|
||||||
Response HTTP statuses |
|
||||||
Response Body |
Unresolved directive in <stdin> - include::snippets/mailtemplate.json.adoc[] |
1.3.4. Create a mail template
URL |
/rs/mailtemplates |
||||||
---|---|---|---|---|---|---|---|
Method |
POST |
||||||
Roles allowed |
admin |
||||||
Parameters |
|
||||||
Request Body |
Unresolved directive in <stdin> - include::snippets/mailtemplate.in.json.adoc[] |
||||||
Response HTTP statuses |
|
||||||
Response Body |
Unresolved directive in <stdin> - include::snippets/mailtemplate.json.adoc[] |
1.3.5. Modify a mail template
URL |
/rs/mailtemplates |
||||||
---|---|---|---|---|---|---|---|
Method |
PUT |
||||||
Roles allowed |
admin |
||||||
Parameters |
|
||||||
Request Body |
Unresolved directive in <stdin> - include::snippets/ma template.json.adoc[] |
||||||
Response HTTP statuses |
|
||||||
Response Body |
Unresolved directive in <stdin> - include::snippets/mailtemplate.json.adoc[] |