Content Generation APIs

      Content Generation APIs


        Article summary

        Assette Content Generation API

        API to query for templates

        Method: GET 

        Path: /templates 

        Query Parameters:  

        • id: (optional) - the template id 
        • name: (optional) - template name
        • nameStartsWith: (optional) - check if the template name starts with this text. 
        • format: (optional) - output format (pptx, docx, xlsx, html, etc.)
        • language: (optional) - the language of the template (in standard culture format, e.g., en-US)
        • attributes: (optional) - list of attributes to be searched for in “<attribute1>:<value1>|<attribute 2>:<value 2>” format. 
        • contentType: (optional) - the intended content type of the generated content (required if the account or product parameter is provided). 
        • account: (optional) - account code, searched based on content rules. The contentType parameter must have a valid value for this parameter to work.
        • product: (optional) - product code, searched based on content rules. The contentType parameter must have a valid value for this parameter to work. 

        e.g. 

        https://api.assette.com/templates?contentType=MonthlyClientReport&account=A100 

        https://api.assette.com/templates?attributes=country:UK|currency:GBP 

        Response: 

        A list of templates with below fields: 

        • id – the template id (string) 
        • name – the template file name with extension 
        • intendedContentTypes - list of content types 
        • format - pptx, docx, xlsx, html, csv/xlsx, etc. 
        • language – the language of the template (in standard culture format, e.g., en-US) 
        • thumbnailImageURLs - list of thumbnail image URLs of all template pages 
        • createdBy - name of the user who created this template. 
        • createdAt - the time at which this template is created. 
        • lastModifiedBy – name of the user who created this template. 
        • lastModifiedAt – the time at which this template is created. 
        • attributes – list of attributes (as key value pairs) 

        API to query for template details

        Method: GET 

        Path: /templates/<template id> 

        Query Parameters:  

        • id - the template id

        Response: 

        A list of templates with below fields: 

        • id – the template id (string) 
        • name – the template file name with extension 
        • intendedContentTypes - list of content types 
        • format - pptx, vpptx, docx, xlsx, html, csv/xlsx, etc. 
        • language – the language of the template (in standard culture format, e.g., en-US) 
        • thumbnailImageURLs - list of thumbnail image URLs of all template pages 
        • createdBy - name of the user who created this template. 
        • createdAt - the time at which this template is created. 
        • lastModifiedBy – name of the user who created this template. 
        • lastModifiedAt – the time at which this template is created. 
        • generationTimeParameters - a list of generation time parameters with below fields 
          • code – the parameter code 
          • controlType – text, integer, decimal, date, options 
          • options – if the control type is options, then the list of options with below fields 
            • code – the options code that must be passed as the parameter value. 
            • displayName – the display name of this option 
          • displayName – the display name of the parameter 
        • outputFormats – list of supported output formats 
        • attributes – list of attributes (as key value pairs) 

        API to generate content

        Method: POST 

        Path: /generations 

        Request: 

        • name – the name of the generated content 
        • templateId – the Id of the template to be used to generate the output. 
        • attributes: (optional) - attributes (as key value pairs) to be added to the generated contents.
        • parameters - generation time parameters (e.g., account code, as of date, etc.) as key value pairs 

        Response: 

        • contentId – the id of the generated content 
        • version – the content version 
        • status – the status of the generated content (queued, generating, failed, pending approval, rejected, available, accepted) 
        • errorMessages – if the status is failed, return the reason for the failure. 

        API to query for generation status 

        Method: POST 

        Path: /generations/<contentId>/version 

        Query Parameters:  

        • contentId: - the id of the generated content  

        Response: 

        • contentId – the id of the generated content 
        • version – the content version 
        • status – the status of the generated content (queued, generating, failed, pending approval, rejected, available) 
        • errorMessages – if the status is failed, return the reason for the failure. 

        Assette Content Sharing API

        API to query content

        Method: GET 

        Path: /contents 

        Query Parameters: 

        • id: (optional) - the content id
        • name: (optional) - content name
        • nameContains: (optional) - check if this value is a part of the content name
        • format: (optional) - pptx, docx, xlsx, html, etc.
        • contentType: (optional) - the content type
        • attributeQuery: (optional) - list of attributes (as key value pairs) to be searched for. Attribute query must be of the format, key1:value1|key2:value2  

        Response: 

        A list of contents with below fields: 

        • id – the content id 
        • name – the content name 
        • version – the version number of the latest available version 
        • contentTypes - the content type 
        • format - pptx, docx, xlsx, html, etc. 
        • language – the language of the template (in standard culture format, e.g., en-US) 
        • thumbnailImageURLs - list of thumbnail image URLs of all template pages 
        • generatedBy - name of the user who created this template. 
        • generatedAt - the time at which this template is created. 
        • attributes – list of attributes (as key value pairs) 

        API to download content

        Method: GET 

        Path: /contents/<id>/<version> 

        Query Parameters: 

        • version – optional, default to the latest available version. 
        • format – optional, this parameter is required only if it is required to download the file in a different format that the originally generated format (e.g., pdf) 

        Response: 

        The content as a byte array.