RosaeNLG API (4.3.0)

Download OpenAPI specification:Download

Ludan Stoecklé: contact@rosaenlg.org URL: https://rosaenlg.org License: Apache-2.0

API over the Natural Language Generation library RosaeNLG

Authentication

auth0

oauth2 using auth0, machine to machine.

Don't use scope, but add audience in the token request.

Security Scheme Type OAuth2
clientCredentials OAuth Flow
Token URL: some token URL, to be configured
Scopes:

    Health check.

    Responses

    Get the deployed RosaeNLG version.

    Authorizations:
    header Parameters
    X-RapidAPI-User
    string

    ID of the user, when going through Rapid API

    Responses

    Response samples

    Content type
    application/json
    {
    • "version": "1.15.4"
    }

    Get the IDs of the templates for user.

    Contains both the loaded templates and the ones which are on the permanent storage

    Authorizations:
    header Parameters
    X-RapidAPI-User
    string

    ID of the user, when going through Rapid API

    Responses

    Response samples

    Content type
    application/json
    {
    • "ids": [
      ]
    }

    Creates a new template.

    Creates a template from a JSON containing a packaged template.

    The template is validated, loaded, autotested (if configured so), and saved on disk or S3 if persistent storage is set.

    It can be either a real template with code etc., or a template that points to another existing one (use type existing and which property).

    Authorizations:
    header Parameters
    X-RapidAPI-User
    string

    ID of the user, when going through Rapid API

    Request Body schema: application/json
    format
    string

    version of the format

    templateId
    required
    string

    ID of the template

    type
    string
    Enum: "existing" "custom"

    Type of the template.

    • Use custom type (default value) when you have src
    • Use existing type otherwise, with which pointing to the proper shared template name.
    which
    string

    Template name to refer to (target template must contain src and be custom type. Use only when type is existing.

    custom
    object

    Custom content for templates, generally when type is existing, to store specific personalization content for a generic template pointed by which

    object

    source of the template

    object

    the pre compiled template

    Responses

    Request samples

    Content type
    application/json
    {
    • "templateId": "chanson",
    • "src": {
      }
    }

    Response samples

    Content type
    application/json
    {
    • "templateId": "chanson",
    • "templateSha1": "1bfdbcd203ec8e6f889b068fbb2d7d298b1db903",
    • "ms": 37.48320007324219
    }

    Deletes an existing template for a user.

    Template will be unloaded, and deleted on the disk or S3 if permanent storage is set.

    Authorizations:
    path Parameters
    templateId
    required
    string
    Example: chanson

    ID of the template

    header Parameters
    X-RapidAPI-User
    string

    ID of the user, when going through Rapid API

    Responses

    Gets information on a template: sha1 and the original content.

    Authorizations:
    path Parameters
    templateId
    required
    string
    Example: chanson

    ID of the template

    header Parameters
    X-RapidAPI-User
    string

    ID of the user, when going through Rapid API

    Responses

    Response samples

    Content type
    application/json
    {
    • "templateSha1": "1bfdbcd203ec8e6f889b068fbb2d7d298b1db903",
    • "templateContent": {
      }
    }

    Renders an existing template using data.

    Renders an existing template using data passed in the request. Payload is in additionnal properties of the input.

    Authorizations:
    path Parameters
    templateId
    required
    string
    Example: chanson

    ID of the template

    templateSha1
    required
    string
    Example: 1bfdbcd203ec8e6f889b068fbb2d7d298b1db903

    sha1 of the template (from create call)

    header Parameters
    X-RapidAPI-User
    string

    ID of the user, when going through Rapid API

    Request Body schema: application/json
    language
    required
    string
    Enum: "fr_FR" "en_US" "de_DE" "it_IT" "es_ES" "OTHER"

    the language of the template

    forceRandomSeed
    integer

    the random seed value, if it must be forced

    defaultSynoMode
    string

    default mode for synonyms

    defaultAmong
    integer

    default value for among

    renderDebug
    boolean

    activate render debug (default false)

    property name*
    any

    Responses

    Request samples

    Content type
    application/json
    {
    • "language": "fr_FR",
    • "chanson": {
      }
    }

    Response samples

    Content type
    application/json
    {
    • "renderedText": "<p>Il chantera \"Non, je ne regrette rien\" d'Édith Piaf</p>",
    • "renderOptions": {
      },
    • "templateSha1": "someSha1",
    • "outputData": { }
    }

    Renders a template in the request using data also in the request.

    Both template and data are passed in the request. Template is automatically cached for a while to accelerate the next calls.

    Authorizations:
    header Parameters
    X-RapidAPI-User
    string

    ID of the user, when going through Rapid API

    Request Body schema: application/json
    data
    required
    object

    data to render the template

    format
    string

    version of the format

    templateId
    required
    string

    ID of the template

    type
    string
    Enum: "existing" "custom"

    Type of the template.

    • Use custom type (default value) when you have src
    • Use existing type otherwise, with which pointing to the proper shared template name.
    which
    string

    Template name to refer to (target template must contain src and be custom type. Use only when type is existing.

    custom
    object

    Custom content for templates, generally when type is existing, to store specific personalization content for a generic template pointed by which

    object

    source of the template

    object

    the pre compiled template

    Responses

    Request samples

    Content type
    application/json
    {
    • "src": {
      },
    • "data": {
      }
    }

    Response samples

    Content type
    application/json
    {
    • "status": "CREATED",
    • "renderedText": "<p>Il chantera \"Non, je ne regrette rien\" d'Édith Piaf</p>",
    • "renderOptions": {
      },
    • "outputData": { }
    }