Foundry API

<back to all web services

AssignUserRolesRequest

Requires Authentication
The following routes are available for this service:
POST/users/{Id}/roles/assign
import java.math.*
import java.util.*
import net.servicestack.client.*
import com.google.gson.annotations.*
import com.google.gson.reflect.*


open class AssignUserRolesRequest : PostOperationUnTenanted<AssignUserRolesResponse>()
{
    var id:String? = null
    var roles:ArrayList<String> = ArrayList<String>()
}

open class PostOperationUnTenanted<TResponse> : IPost
{
}

open class AssignUserRolesResponse
{
    var responseStatus:ResponseStatus? = null
    var userAccount:UserAccount? = null
}

open class UserAccount : IIdentifiableResource
{
    var roles:ArrayList<String> = ArrayList<String>()
    var status:AccountStatus? = null
    var defaultOrganisationId:String? = null
    @SerializedName("type") var Type:AccountType? = null
    var id:String? = null
}

enum class AccountStatus
{
    Shadowed,
    Registered,
}

enum class AccountType
{
    Person,
    Machine,
}

Kotlin AssignUserRolesRequest DTOs

To override the Content-type in your clients, use the HTTP Accept Header, append the .jsv suffix or ?format=jsv

HTTP + JSV

The following are sample HTTP requests and responses. The placeholders shown need to be replaced with actual values.

POST /users/{Id}/roles/assign HTTP/1.1 
Host: foundrystage-api-app.azurewebsites.net 
Accept: text/jsv
Content-Type: text/jsv
Content-Length: length

{
	id: String,
	roles: 
	[
		String
	]
}
HTTP/1.1 200 OK
Content-Type: text/jsv
Content-Length: length

{
	responseStatus: 
	{
		errorCode: String,
		message: String,
		stackTrace: String,
		errors: 
		[
			{
				errorCode: String,
				fieldName: String,
				message: String,
				meta: 
				{
					String: String
				}
			}
		],
		meta: 
		{
			String: String
		}
	},
	userAccount: 
	{
		roles: 
		[
			String
		],
		status: Shadowed,
		defaultOrganisationId: String,
		type: Person,
		id: String
	}
}