Assign Location to User
You can assign a location to a user with the specified UID.
Required Privileges
To perform this task, a user must have one of the following roles assigned: Portal Administrator, Service Provider Global Administrator, Service Provider Administrator, Company Owner, Company Administrator.
Request
To assign a location to a user, send the POST HTTP request to the URL of the /users/{userUid}/locations resource. Additionally you must create a query string that contains UID of a location.
HTTP Request
POST https://<hostname>:1280/api/v3/users/{userUid}/locations?locationUid={locationUid} |
Request Headers
The request contains the following headers.
Header | Required/Optional | Value | Description |
Authorization | Required | Bearer <Access-Token> | Authenticates a client who sends the request to the server. Must contain the access token for the current logon session in the Bearer <Access-Token> format. |
Accept | Optional | application/json | Specifies a media type of representation that is required in the response message. If the requested type is not supported, the server will return the response in the application/json media type. |
Request parameters
A list of parameters that are applicable for this operation:
Name | In | Type | Required | Default | Description |
---|---|---|---|---|---|
userUid | Path | String (uuid) | Yes | — | User UID. |
locationUid | Query | String (uuid) | Yes | — | Location UID. |
Response
The server returns the following response to the client.
Response Code
A successfully completed operation returns response code 200 OK.
Response Headers
The response to this request contains the following headers. The response may also include additional standard HTTP headers.
Header | Description |
Content-length | The length of the response body. |
Content-type | The media type and syntax of the request body message: application/json; charset=utf-8 |
Response Body
In the response body, Veeam Service Provider Console returns a resource representation based on the User schema.
Example
The following request assigns a location with UID a5866cac-cf91-4440-83bd-f7090f260f28 to a user with UID f0ce14b3-75dd-4bc0-86df-d784f4e86c8b.
Request: POST https://<hostname>:1280/api/v3/users/f0ce14b3-75dd-4bc0-86df-d784f4e86c8b/locations?locationUid=a5866cac-cf91-4440-83bd-f7090f260f28 Request Header: Authorization: Bearer <Access-Token>
Response Code: 200 OK
Response Body: { "data": { "instanceUid": "f0ce14b3-75dd-4bc0-86df-d784f4e86c8b", "organizationUid": "e554ad57-2297-4597-8fe8-12382be853ff", "userName": "Alpha", "status": "enabled", "role": "companyOwner", "profile": { "firstName": null, "lastName": null, "title": "mr", "email": null, "address": null, "phone": null }, "credentials": { "userName": "Alpha", "password": null } } } |