Foundry API

<back to all web services

GenerateMachineApiKeyRequest

Requires Authentication
The following routes are available for this service:
POST/machines/{Id}/generate-api-key

export class PostOperationUnTenanted<TResponse> implements IPost
{

    public constructor(init?: Partial<PostOperationUnTenanted<TResponse>>) { (Object as any).assign(this, init); }
}

export class PostOperationTenanted<TResponse> extends PostOperationUnTenanted<TResponse> implements ITenantedRequest
{
    public organisationId?: string;

    public constructor(init?: Partial<PostOperationTenanted<TResponse>>) { super(init); (Object as any).assign(this, init); }
}

export class ApiKey implements IIdentifiableResource
{
    public userId?: string;
    public description?: string;
    public expiresUtc?: string;
    public key?: string;
    public id?: string;

    public constructor(init?: Partial<ApiKey>) { (Object as any).assign(this, init); }
}

export class GenerateMachineApiKeyResponse
{
    public apiKey?: ApiKey;
    public responseStatus?: ResponseStatus;

    public constructor(init?: Partial<GenerateMachineApiKeyResponse>) { (Object as any).assign(this, init); }
}

export class GenerateMachineApiKeyRequest extends PostOperationTenanted<GenerateMachineApiKeyResponse>
{
    public id?: string;

    public constructor(init?: Partial<GenerateMachineApiKeyRequest>) { super(init); (Object as any).assign(this, init); }
}

TypeScript GenerateMachineApiKeyRequest 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 /machines/{Id}/generate-api-key HTTP/1.1 
Host: foundrystage-api-app.azurewebsites.net 
Accept: text/jsv
Content-Type: text/jsv
Content-Length: length

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

{
	apiKey: 
	{
		userId: String,
		description: String,
		expiresUtc: ,
		key: String,
		id: String
	},
	responseStatus: 
	{
		errorCode: String,
		message: String,
		stackTrace: String,
		errors: 
		[
			{
				errorCode: String,
				fieldName: String,
				message: String,
				meta: 
				{
					String: String
				}
			}
		],
		meta: 
		{
			String: String
		}
	}
}