Skip to main content

Retrieve Content

Retrieves an auto-generted social media post for your property.

Parameters​

query - required​

The message to the AI chatbot.

history - optional​

Any array of chat history objects for chat context.

History object properties
  • role - string

Must be "user" or "assistant".

  • content - string

The query submitted by the user or the response returned from chatbot.

Code Example​

POST - https://api.particlespace.com/api/v1/ai/chatbot/content
var axios = require('axios');
var qs = require('qs');
const BEARER_TOKEN = 'SET_ME';
var data = {
query: 'Adding oil on the hinges worked. Thank you!',
history: [{"role":"user","content":"My door is squeaking, can you help?"},{"role":"assistant","content":"Sure, I would be happy to assist you with that. Have you tried lubricating the hinges with some WD-40 or a similar lubricant? That should usually do the trick for a squeaky door. If you don't have any WD-40, I can provide some for you.\n\nIf it continues to be a problem, please don't hesitate to let me know and I will escalate the issue to the owner."}],
};
var config = {
method: 'POST',
url: 'https://api.particlespace.com/api/v1/ai/chatbot/content',
headers: {
'Authorization': 'Bearer ' + BEARER_TOKEN
},
data: data
};

axios(config)
.then(function (response) {
console.log(JSON.stringify(response.data));
})
.catch(function (error) {
console.log(error);
});