Redeems a one-time 30-minute enrollment code.
using System.Net.Http.Headers;var client = new HttpClient();var request = new HttpRequestMessage{ Method = HttpMethod.Post, RequestUri = new Uri("https://example.com/api/workspace/file-protection/agent/v1/enroll"), Content = new StringContent("{ \"Code\": \"example\", \"DisplayName\": \"example\", \"OperatingSystem\": 0, \"AgentVersion\": \"example\", \"MachineFingerprint\": \"example\", \"DeviceToken\": \"example\", \"ExpectedAgentId\": \"example\" }") { Headers = { ContentType = new MediaTypeHeaderValue("application/json") } }};using (var response = await client.SendAsync(request)){ response.EnsureSuccessStatusCode(); var body = await response.Content.ReadAsStringAsync(); Console.WriteLine(body);}const url = 'https://example.com/api/workspace/file-protection/agent/v1/enroll';const options = { method: 'POST', headers: {'Content-Type': 'application/json'}, body: '{"Code":"example","DisplayName":"example","OperatingSystem":0,"AgentVersion":"example","MachineFingerprint":"example","DeviceToken":"example","ExpectedAgentId":"example"}'};
try { const response = await fetch(url, options); const data = await response.json(); console.log(data);} catch (error) { console.error(error);}curl --request POST \ --url https://example.com/api/workspace/file-protection/agent/v1/enroll \ --header 'Content-Type: application/json' \ --data '{ "Code": "example", "DisplayName": "example", "OperatingSystem": 0, "AgentVersion": "example", "MachineFingerprint": "example", "DeviceToken": "example", "ExpectedAgentId": "example" }'Requires TLS at the API connection. A workspace bearer token does not authenticate an Agent.
Redeems the one-time enrollment code in the request body. Store the returned device credential securely; use it for subsequent protocol operations.
Request Body
Section titled “Request Body”Redeems one short-lived, one-time enrollment code.
object
Operating systems supported by the universal File Protection tools.
Required exact identity for a reconnect code; must be absent for a new enrollment.
Redeems one short-lived, one-time enrollment code.
object
Operating systems supported by the universal File Protection tools.
Required exact identity for a reconnect code; must be absent for a new enrollment.
Redeems one short-lived, one-time enrollment code.
object
Operating systems supported by the universal File Protection tools.
Required exact identity for a reconnect code; must be absent for a new enrollment.
Responses
Section titled “Responses”OK
object
Returns the enrolled identity and a write-only device token.
object
object
object
object
object
Example
{ "Errors": [ { "Type": 0, "Severity": 0 } ], "Warnings": [ { "Type": 0, "Severity": 0 } ]}