One can request articles as required using this API endpoint.
POST /content/article/{content-model-id}/
Authentication: Token <user-generated-token>
{
"article": "cards / cards-html / continuous / continuous-html / sectioned / sectioned-html",
"params": "json encoded string with following definition",
"preview": false,
"id": "Optional article id (v4 uuid) to retrieve previously generated article."
}
JSON encoded string for params
is the set of parameters required for the content model and as requested by the models query.
{
"key(available in ‘key’ field in model response payload)": "data (appropriate user data)",
"key(available in ‘key’ field in model response payload)": "data(appropriate user data)"
}
{
"success": true,
"article": {
"html": "This attribute is present only if requested type is one of continuous-html / sectioned-continuous-html",
"text": "This attribute is present only if requested type is one of continuous / sectioned-continuous and contains a new line separated text",
"cards": [
{
"html": "Only this if requested type is cards-html else others",
"text": "Only if requested type is cards",
"title": "Title of the card",
"subheading": "Subheading of the card"
}
]
},
"id": "Article id (v4 uuid) to retrieve same article. Aimed to provide the article for which the preview was created.",
"code": 123,
"message": "some message explaining code and status"
}
curl -X POST 'https://api.brahmastra.tech/content/article/<model_id>/' -d 'article=sectioned-html¶ms={"source":"Maruti Baleno"}' -H 'Authorization: Token <your-auth-token-generated-above>'