Skip to content

Commit

Permalink
[API-193] - add endpoints api keys (#25)
Browse files Browse the repository at this point in the history
* [API-193] - add endpoint api keys

* [API-193] - files are renamed and title is updated

* [API-193] - make merge

* [API-193] - fields were arranged in alphabetical order

* api.yml file

* api.yml file

* Make merge

* running make merge

* [API-193] - missing parameters are added

* run make marge

* Update resources/api_keys/api_key.yml

Co-authored-by: Franklin Carrero <franklin.carrero@conekta.com>

* [API-193] - settings in apy keys documentation

* [API-193] - settings in apy keys documentation

---------

Co-authored-by: Nicolás Cedrón <josenicolascedron@gmail.com>
Co-authored-by: Jorge Alonso <jorge.alonso@conekta.com>
Co-authored-by: Franklin Carrero <franklin.carrero@conekta.com>
  • Loading branch information
4 people authored May 24, 2023
1 parent b9b8b43 commit 7c42487
Show file tree
Hide file tree
Showing 10 changed files with 901 additions and 28 deletions.
643 changes: 624 additions & 19 deletions _build/api.yaml

Large diffs are not rendered by default.

6 changes: 5 additions & 1 deletion api.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,10 @@ paths:
$ref: "./resources/antifraud/blacklists_index_create.yml"
/antifraud/blacklists/{id}:
$ref: "./resources/antifraud/blacklists_delete.yml"
/api_keys:
$ref: "./resources/api_keys/api_keys.yml"
/api_keys/{id}:
$ref: "./resources/api_keys/api_key.yml"
/charges:
$ref: "./resources/charges/charges.yml"
/orders/{id}/charges:
Expand All @@ -47,7 +51,7 @@ paths:
/events/{id}:
$ref: "./resources/events/event.yml"
/events/{event_id}/webhook_logs/{webhook_log_id}/resend:
$ref: "./resources/events/events_webhook_resend.yml"
$ref: "./resources/events/events_resend.yml"
/logs:
$ref: "./resources/logs/log.yml"
/logs/{id}:
Expand Down
6 changes: 6 additions & 0 deletions requestBodies/api_keys/api_keys_create.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
description: requested field for a api keys
content:
application/json:
schema:
$ref: "../../schemas/api_keys/api-key_request.yml"
required: true
115 changes: 115 additions & 0 deletions resources/api_keys/api_key.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,115 @@
get:
tags:
- Api Keys
operationId: getApiKey
summary: Get Api Key
description: "Gets a api key that corresponds to a api key ID"
responses:
200:
description: successful
content:
application/vnd.conekta-v2.1.0+json:
schema:
$ref: "../../schemas/api_keys/api-key_response.yml"
headers:
Content-Type:
description: The format of the response body
schema:
type: string
example: "application/json; charset=utf-8"
Conekta-Media-Type:
schema:
type: string
example: conekta-v2.1.0; format=application/json
401:
$ref: "../errors/401.yml"
404:
$ref: "../errors/404.yml"
500:
$ref: "../errors/500.yml"
security:
- bearerAuth: []
parameters:
- $ref: "../../parameters/commons/path_param/id.yml"
- $ref: "../../parameters/commons/headers/accept_language.yml"
- $ref: "../../parameters/commons/headers/x_child_company_id.yml"
put:
tags:
- Api Keys
operationId: updateApiKey
summary: Update Api Key
description: "Update an existing api key"
responses:
"200":
description: successful operation
content:
application/vnd.conekta-v2.1.0+json:
schema:
$ref: ../../schemas/api_keys/api-key_response.yml
404:
$ref: "../errors/404.yml"
401:
$ref: "../errors/401.yml"
500:
$ref: "../errors/500.yml"
security:
- bearerAuth: []
requestBody:
content:
application/json:
schema:
type: object
title: api_key_update_request
properties:
active:
type: boolean
example: true
description: Indicates if the webhook key is active
description:
type: string
example: online store
description: Detail of the use that will be given to the api key
parameters:
- $ref: "../../parameters/commons/path_param/id.yml"
- $ref: "../../parameters/commons/headers/accept_language.yml"
delete:
tags:
- Api Keys
operationId: deleteApiKey
summary: Delete Api Key
description: "Deletes a api key that corresponds to a api key ID"
responses:
200:
description: successful
content:
application/vnd.conekta-v2.1.0+json:
schema:
title: delete_api_keys_response
allOf:
- $ref: "../../schemas/api_keys/api-key_response.yml"
- type: object
properties:
deleted:
type: boolean
example: true
headers:
Content-Type:
description: The format of the response body
schema:
type: string
example: "application/json; charset=utf-8"
Conekta-Media-Type:
schema:
type: string
example: conekta-v2.1.0; format=application/json
401:
$ref: "../errors/401.yml"
404:
$ref: "../errors/404.yml"
500:
$ref: "../errors/500.yml"
security:
- bearerAuth: []
parameters:
- $ref: "../../parameters/commons/path_param/id.yml"
- $ref: "../../parameters/commons/headers/accept_language.yml"
87 changes: 87 additions & 0 deletions resources/api_keys/api_keys.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,87 @@
get:
tags:
- Api Keys
operationId: getApiKeys
summary: Get list of Api Keys
description: "Consume the list of api keys you have"
responses:
200:
description: successful
content:
application/vnd.conekta-v2.1.0+json:
schema:
title: get_api_keys_response
allOf:
- $ref: ../../schemas/pagination/page.yml
- $ref: ../../schemas/pagination/pagination.yml
- type: object
properties:
data:
type: array
items:
$ref: "../../schemas/api_keys/api-key_response.yml"
headers:
Content-Type:
description: The format of the response body
schema:
type: string
example: "application/json; charset=utf-8"
Conekta-Media-Type:
schema:
type: string
example: conekta-v2.1.0; format=application/json
401:
$ref: "../errors/401.yml"
500:
$ref: "../errors/500.yml"
security:
- bearerAuth: []
parameters:
- $ref: "../../parameters/commons/headers/accept_language.yml"
- $ref: "../../parameters/commons/headers/x_child_company_id.yml"
- $ref: "../../parameters/commons/query/limit.yml"
- $ref: "../../parameters/commons/query/search.yml"
- $ref: "../../parameters/commons/query/next_page.yml"
- $ref: "../../parameters/commons/query/previous_page.yml"
post:
tags:
- Api Keys
operationId: createApiKey
summary: Create Api Key
description: "Create a api key"
responses:
200:
description: successful operation
content:
application/vnd.conekta-v2.1.0+json:
schema:
title: api_key_create_response
allOf:
- type: object
properties:
authentication_token:
type: string
example: key_rpHzxufNgjFCdprEEFZRTKi
description: It is occupied as a user when authenticated with basic authentication, with a blank password. This value will only appear once, in the request to create a new key
- $ref: "../../schemas/api_keys/api-key_response.yml"
headers:
Content-Type:
description: The format of the response body
schema:
type: string
example: "application/json; charset=utf-8"
Conekta-Media-Type:
schema:
type: string
example: conekta-v2.1.0; format=application/json
401:
$ref: "../errors/401.yml"
500:
$ref: "../errors/500.yml"
security:
- bearerAuth: []
requestBody:
$ref: "../../requestBodies/api_keys/api_keys_create.yml"
parameters:
- $ref: "../../parameters/commons/headers/accept_language.yml"
- $ref: "../../parameters/commons/headers/x_child_company_id.yml"
Original file line number Diff line number Diff line change
@@ -1,16 +1,16 @@
post:
tags:
- Events
operationId: resendWebhook
summary: Resend Webhook
operationId: resendEvent
summary: Resend Event
description: "Try to send an event"
responses:
200:
description: successful operation
content:
application/vnd.conekta-v2.1.0+json:
schema:
$ref: ../../schemas/events/events_webhook_resend_response.yml
$ref: ../../schemas/events/events_resend_response.yml
401:
$ref: "../errors/401.yml"
404:
Expand Down
19 changes: 19 additions & 0 deletions schemas/api_keys/api-key_request.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
title: api_keys_request
name: api_keys_request
required:
- active
- description
- role
properties:
active:
type: boolean
example: true
description: Indicates if the api key is active
description:
type: string
description: Detail of the use that will be given to the api key
example: online store
role:
type: string
example: private
descripción: Indicates the user account private=owner or public=public
37 changes: 37 additions & 0 deletions schemas/api_keys/api-key_response.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
title: api_key_response
description: api keys model
type: object
properties:
active:
type: boolean
description: Indicates if the api key is active
example: true
created_at:
type: integer
description: Unix timestamp in seconds with the creation date of the api key
example: 1684167881
format: int64
description:
type: string
description: Detail of the use that will be given to the api key
example: online store
id:
type: string
example: "64625cc9f3e02c00163f5e4d"
description: Unique identifier of the api key
livemode:
type: boolean
description: Indicates if the api key is in live mode
example: false
object:
type: string
description: Object name, value is api_key
example: api_key
prefix:
type: string
description: The first few characters of the authentication_token
example: key_rp
role:
type: string
description: Indicates the user account private=owner or public=public
example: private
File renamed without changes.
10 changes: 5 additions & 5 deletions schemas/pagination/pagination.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,11 @@ required:
- object
- has_more
properties:
"object":
type: string
example: "list"
description: "Object type, in this case is list"
has_more:
has_more:
type: boolean
example: false
description: "Indicates if there are more pages to be requested"
object:
type: string
example: "list"
description: "Object type, in this case is list"

0 comments on commit 7c42487

Please sign in to comment.