GET
Use the HTTP GET method with the login resource to request information about the user that is authenticated with the REST API.
- Resource URL
- Optional query parameters
- Request headers
- Request body format
- Security requirements
- Response status codes
- Response headers
- Response body format
- Examples
Resource URL
https://host:port/ibmmq/rest/v2/login
Optional query parameters
None.
Request headers
The following headers must be sent with the request:
- Authorization
- This header must be sent if we are using basic authentication. For more information, see Use HTTP basic authentication with the REST API.
Request body format
None.
Security requirements
The request must be authenticated by using one of the following authentication mechanisms:- For HTTP basic authentication, we must provide the user name and password to authenticate. For more information, see Use HTTP basic authentication with the REST API.
- For token based authentication, we must provide the LTPA token to authenticate. For more information, see Use token based authentication with the REST API.
- For client certificate authentication, we must provide the client certificate to authenticate. For more information, see Use client certificate authentication with the REST API.
Response status codes
- 200
- User queried successfully.
- 400
- Invalid data provided.
- 401
- Not authenticated.
- 404
- Resource was not found.
- 500
- Server issue or error code from IBM MQ .
Response headers
The following headers are returned with the response:
- Content-Type
- This header is returned with a value of application/json;charset=utf-8.
Response body format
The response is in JSON format in UTF-8 encoding. The response contains an outer JSON object that contains a single JSON array called user. This array contains the following attributes:
- name
- String.
- role
- JSON array.
Examples
The following example queries the user. The following URL is used with the HTTP GET method:https://localhost:9443/ibmmq/rest/v2/loginThe following JSON response is returned:
{ "user" : [{ "name" : "reader", "role" : [ "MQWebAdminRO", "MQWebUser" ] }] }In cURL, the log in query might look like the following Windows example that uses token based authentication. The LTPA token is retrieved from the cookiejar.txt file by using the -b flag:
curl -k "https://localhost:9443/ibmmq/rest/v2/login" -X GET -b c:\cookiejar.txtParent topic: /login