Mesh-Animation
4 Text Animation

Introduction

Submit text prompts for text to animation.

Multi Text Animation

Request

Parameters

session_code REQUIRED
type : string
in : body
description : Session code of mesh animation
example : "SESSION_11_253458745"


texts REQUIRED
type : array
in : body
description : Provide text for a animation
example : ["A person starts doing squats, keeping their back straight and bending at the knees like they are sitting on an imaginary chair.", "The person lies flat on their back, raises their legs and does a cycling motion in the air."]


POST /mesh-animation/text-multi

Code Snippets

Python

import requests
import json

url = "https://api.csm.ai:5566/mesh-animation/text-multi"

payload = json.dumps({
  "session_code": "SESSION_11_253458745",
  "texts": [
    "A person starts doing squats, keeping their back straight and bending at the knees like they are sitting on an imaginary chair.",
    "The person lies flat on their back, raises their legs and does a cycling motion in the air."
  ]
})

headers = {
  'x-api-key': '<X-API_KEY>',
  'Content-Type': 'application/json'
}

response = requests.request("POST", url, headers=headers, data=payload)

print(response.text)

Node.js

var request = require('request');
var options = {
  'method': 'POST',
  'url': 'https://api.csm.ai:5566/mesh-animation/text-multi',
  'headers': {
    'x-api-key': '<X-API_KEY>',
    'Content-Type': 'application/json'
  },
  body: JSON.stringify({
    "session_code": "SESSION_11_253458745",
    "texts": [
      "A person starts doing squats, keeping their back straight and bending at the knees like they are sitting on an imaginary chair.",
      "The person lies flat on their back, raises their legs and does a cycling motion in the air."
    ]
  })

};
request(options, function (error, response) {
  if (error) throw new Error(error);
  console.log(response.body);
});


Curl

curl --location 'https://api.csm.ai:5566/mesh-animation/text-multi' \
--header 'x-api-key: <X-API_KEY>' \
--header 'Content-Type: application/json' \
--data '{
    "session_code": "SESSION_11_253458745",
    "texts": [
        "A person starts doing squats, keeping their back straight and bending at the knees like they are sitting on an imaginary chair.",
        "The person lies flat on their back, raises their legs and does a cycling motion in the air."
    ]
}'

Response

{
    "error": "",
    "message": "Success",
    "statusCode": 200,
    "data": {
        "responses": [
            {
                "text": "A person starts doing squats, keeping their back straight and bending at the knees like they are sitting on an imaginary chair.",
                "message": "Text mesh animation processed successfully",
                "isError": false
            },
            {
                "text": "The person lies flat on their back, raises their legs and does a cycling motion in the air.",
                "message": "Text mesh animation processed successfully",
                "isError": false
            }
        ]
    }
}