Let a consumer answer through the assistant
const url = 'http://localhost:11044/api/v1/channels/consumers/example/example/assistant/grant';const options = {method: 'POST', headers: {'X-Embabel-Api-Key': '<X-Embabel-Api-Key>'}};
try { const response = await fetch(url, options); const data = await response.json(); console.log(data);} catch (error) { console.error(error);}curl --request POST \ --url http://localhost:11044/api/v1/channels/consumers/example/example/assistant/grant \ --header 'X-Embabel-Api-Key: <X-Embabel-Api-Key>'JSON fields: installationId, expectedRevision. Only a consumer declared with assistant: true.
Authorizations
Section titled “Authorizations”Parameters
Section titled “Parameters”Path Parameters
Section titled “Path Parameters”Name of the captured realm installed in the signed-in owner’s world; non-blank, at most 256 UTF-8 bytes, no control characters and not all * (400 otherwise). 409 when its live installation is not the one named by the body’s installationId and expectedRevision
Name of a consumer the realm declares; same text rules as the realm name, declared with assistant: true (400 otherwise). 404 when undeclared, 409 when it already has the assistant grant
Responses
Section titled “Responses”OK
Whether a captured realm consumer may answer through the owner’s assistant, and which sender threads it answers; returned by the /channels/consumers/{realmName}/{consumerName}/assistant routes
object
Name of the consumer, as the realm declares it
Whether the realm declared the consumer with assistant: true; only such a consumer can be granted
Whether the owner has granted the consumer leave to answer through the assistant
The live installation of that realm this was read from; send it back as installationId on a change
The sender threads paired with the consumer, which it answers, sorted; empty when none, or when not granted
Name of the realm the consumer belongs to
That installation’s revision; send it back as expectedRevision on a change. Pairing and unpairing do not move it

