Send a conversation message
const url = 'https://api.hiddendoor.co/experience/v1/instances/da1cc53b-9d9e-4edb-83e4-d5a9ee713130/stories/b79d72ef-92fb-4bcd-917a-9886e62d41d8/conversations/d0bc5bda-9876-4086-8b2c-39119a811f7e/messages';const options = { method: 'POST', headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'}, body: '{"text":"Have you seen a cobbler traveling toward the Emerald City?"}'};
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://api.hiddendoor.co/experience/v1/instances/da1cc53b-9d9e-4edb-83e4-d5a9ee713130/stories/b79d72ef-92fb-4bcd-917a-9886e62d41d8/conversations/d0bc5bda-9876-4086-8b2c-39119a811f7e/messages \ --header 'Authorization: Bearer <token>' \ --header 'Content-Type: application/json' \ --data '{ "text": "Have you seen a cobbler traveling toward the Emerald City?" }'Append your application’s dialogue and generate the NPC or narrator reply using the server-held transcript. Return the updated conversation and its current expiry. Story effects are applied when the conversation ends, not on every message. A resolved conversation cannot accept more messages; end it to apply its effects.
Authorizations
Section titled “ Authorizations ”Parameters
Section titled “ Parameters ”Path Parameters
Section titled “ Path Parameters ”Example
da1cc53b-9d9e-4edb-83e4-d5a9ee713130POST /instances/:instanceId/stories/:storyId/conversations/:conversationId/messages Parameter
Example
b79d72ef-92fb-4bcd-917a-9886e62d41d8POST /instances/:instanceId/stories/:storyId/conversations/:conversationId/messages Parameter
Example
d0bc5bda-9876-4086-8b2c-39119a811f7ePOST /instances/:instanceId/stories/:storyId/conversations/:conversationId/messages Parameter
Request Bodyrequired
Section titled “ Request Bodyrequired ”POST /instances/:instanceId/stories/:storyId/conversations/:conversationId/messages Request body
object
Example
Have you seen a cobbler traveling toward the Emerald City?Responses
Section titled “ Responses ”POST /instances/:instanceId/stories/:storyId/conversations/:conversationId/messages Positive response
object
object
Player marks dialogue supplied by your application; entity marks the character or narrator’s reply.
The current expiry time. Expiry discards the conversation without applying its pending effects.
Example
{ "conversationId": "d0bc5bda-9876-4086-8b2c-39119a811f7e", "instanceId": "da1cc53b-9d9e-4edb-83e4-d5a9ee713130", "storyId": "b79d72ef-92fb-4bcd-917a-9886e62d41d8", "mode": "character", "transcript": [ { "speaker": "player" } ]}Request parameters or the JSON body do not conform to this operation’s input schema. Correct the request before retrying.
object
The HTTP error category. Use the status code to handle failures.
A human-readable explanation. Do not parse this text for program logic.
Example
{ "error": "Bad Request", "message": "Request parameters or the JSON body do not conform to this operation’s input schema. Correct the request before retrying."}Authentication is missing or invalid. Supply a valid API key in the Authorization: Bearer header.
object
The HTTP error category. Use the status code to handle failures.
A human-readable explanation. Do not parse this text for program logic.
Example
{ "error": "Unauthorized", "message": "Authentication is missing or invalid. Supply a valid API key in the Authorization: Bearer header."}The authenticated account does not have access to the Experience API.
object
The HTTP error category. Use the status code to handle failures.
A human-readable explanation. Do not parse this text for program logic.
Example
{ "error": "Forbidden", "message": "The authenticated account does not have access to the Experience API."}The resource does not exist or is not accessible to your application.
object
The HTTP error category. Use the status code to handle failures.
A human-readable explanation. Do not parse this text for program logic.
Example
{ "error": "Not Found", "message": "The resource does not exist or is not accessible to your application."}The operation conflicts with the current instance or story state. Read the current state before choosing the next action.
object
The HTTP error category. Use the status code to handle failures.
A human-readable explanation. Do not parse this text for program logic.
Example
{ "error": "Conflict", "message": "The operation conflicts with the current instance or story state. Read the current state before choosing the next action."}The JSON request body exceeds 100 KB. Reduce its size before retrying.
object
The HTTP error category. Use the status code to handle failures.
A human-readable explanation. Do not parse this text for program logic.
Example
{ "error": "Payload Too Large", "message": "The JSON request body exceeds 100 KB. Reduce its size before retrying."}The server could not complete the request. Internal error details are not exposed.
object
The HTTP error category. Use the status code to handle failures.
A human-readable explanation. Do not parse this text for program logic.
Example
{ "error": "Internal Server Error", "message": "Internal server error"}