From cd75581ccb6cd4b2d160c99ea82fe94f2bb19beb Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Daniel=20Garc=C3=ADa=20Aubert?= Date: Fri, 24 Aug 2018 10:42:08 +0200 Subject: [PATCH] Add list template endpoint --- docs/reference/swagger.yaml | 49 +++++++++++++++++++++++++++++++++---- 1 file changed, 44 insertions(+), 5 deletions(-) diff --git a/docs/reference/swagger.yaml b/docs/reference/swagger.yaml index e4200c05..57a27909 100644 --- a/docs/reference/swagger.yaml +++ b/docs/reference/swagger.yaml @@ -201,11 +201,9 @@ paths: post: summary: Upload template description: | + Upload template tags: - Named Maps - security: - - ApiKeyHTTPBasicAuth: [] - - ApiKeyQueryParam: [] operationId: instantiateAnonymousMap requestBody: required: true @@ -250,6 +248,9 @@ paths: $ref: '#/components/responses/Unauthorized' '403': $ref: '#/components/responses/Forbidden' + security: + - ApiKeyQueryParam: [] + - ApiKeyHTTPBasicAuth: [] x-code-samples: - lang: Curl source: | @@ -304,6 +305,32 @@ paths: } \ } \ }' "https://{username}.carto.com/api/v1/map/named?api_key={api_key}" + get: + summary: List user's templates + description: | + List user's templates + tags: + - Named Maps + responses: + '200': + description: Ok + content: + application/json: + schema: + type: array + items: + $ref: '#/components/schemas/NamedMapResponseList' + '401': + $ref: '#/components/responses/Unauthorized' + '403': + $ref: '#/components/responses/Forbidden' + security: + - ApiKeyQueryParam: [] + - ApiKeyHTTPBasicAuth: [] + x-code-samples: + - lang: Curl + source: | + curl -X GET 'https://{username}.carto.com/api/v1/map/named?api_key={api_key}' '/map/static/center/{layergroupid}/{z}/{lat}/{lng}/{width}/{height}.{format}': get: parameters: @@ -891,11 +918,15 @@ components: zoom: $ref: '#/components/schemas/TemplateViewZoom' center: - $ref: '#/components/schemas/TemplateViewZoom' + $ref: '#/components/schemas/TemplateViewCenter' bounds: $ref: '#/components/schemas/TemplateViewBounds' preview_layers: $ref: '#/components/schemas/TemplateViewPreviewLayers' + required: + - zoom + - center + - bounds TemplateViewZoom: type: number description: The zoom level to use @@ -944,13 +975,21 @@ components: properties: template_id: type: string + NamedMapResponseList: + type: object + properties: + template_ids: + type: array + items: + type: string + description: template name securitySchemes: ApiKeyHTTPBasicAuth: type: http scheme: basic ApiKeyQueryParam: type: apiKey - in: header + in: query name: api_key parameters: layergroupId: