ReportingCloud

GET /v1/templates/list

Endpoint

GET https://api.reporting.cloud/v1/templates/list

Description

Lists the templates in the template storage, each with its name, the time it was uploaded (UTC) and its size in bytes.

Examples

Request:

curl -u username:password \
  -X GET "https://api.reporting.cloud/v1/templates/list"

Results:

[
	{
		"templateName": "company_invoice.doc",
		"modified": "2016-06-02T09:25:33+00:00",
		"size": 6144
	},
	{
		"templateName": "sample_invoice.tx",
		"modified": "2019-06-28T07:22:34+00:00",
		"size": 35271
	},
	{
		"templateName": "template.docx",
		"modified": "2016-06-02T09:25:22+00:00",
		"size": 3246
	}
]

Authorization

This endpoint requires a "ReportingCloud-APIKey" or a "Basic" user authorization to access the user account, data and templates. Only one of these two methods is required.

API Keys describes how to create an API key, and Authentication explains both header forms.

ReportingCloud-APIKey

Header fieldDescription
AuthorizationRequired. A valid ReportingCloud account is required. The Authorization field is constructed as follows: An API key needs to be generated in the portal or with PUT /v1/account/apikey. The authorization method and a space, "ReportingCloud-APIKey ", is then put before the actual API key string. For example: Authorization: ReportingCloud-APIKey oMDM4MrAqL9QEOpyzupnQW5NjvCNtvE5cVDaaLqxI

Basic

Header fieldDescription
AuthorizationRequired. A valid ReportingCloud account is required. The Authorization field is constructed as follows: The user name and password are combined into a string separated by a colon, for example username:password. The resulting string is encoded using the RFC2045-MIME variant of Base64, except not limited to 76 char/line. The authorization method and a space, "Basic ", is then put before the encoded string. For example: Authorization: Basic QWxhZGRpbjpPcGVuU2VzYW1l

Success Response

StatusDescription
200On success, the HTTP status code in the response header is 200 (OK). The response body contains an array of ReportingCloud TemplateList objects.

TemplateList

NameTypeValueOptional
templateNameStringThe filename of the template in the template storage.no
modifiedDateTime (String)The last date on which this template has been modified. The date string includes the time zone of the server (UTC). Sample: 2016-06-06T11:25:44+00:00.no
sizeNumber (Long)The size of the template in bytes.no

Error Response

StatusDescription
403A 403 (Forbidden) is returned, if the user is not authorized.
405A 405 (Method Not Allowed) is returned, if the request uses another HTTP method than GET. The Allow header of the response names GET.
500A 500 (Internal Server Error) is returned, if the request has no Authorization header, an empty one or one that is not the authorization method, a space and the credentials.