From 4b8b6d2eba889f8cd13aa850f049f46b79f74002 Mon Sep 17 00:00:00 2001 From: oleghasjanov Date: Tue, 19 Nov 2024 13:32:32 +0200 Subject: [PATCH 1/3] Simplify API and enhance long_reserve_domains_status endpoint - Remove redundant endpoints (/refresh_token, /release, /reserve, /status) - Update long_reserve_domains_status: - Add required flags to invoice_number and user_unique_id parameters - Enhance response schema with enum status types and reserved_domains array - Remove security requirement (CustomTokenAuth) --- openapi/openapi.yaml | 134 +++++-------------------------------------- 1 file changed, 14 insertions(+), 120 deletions(-) diff --git a/openapi/openapi.yaml b/openapi/openapi.yaml index 408a961..2205558 100644 --- a/openapi/openapi.yaml +++ b/openapi/openapi.yaml @@ -106,15 +106,15 @@ paths: /business_registry/long_reserve_domains_status: get: summary: Get status of long-term reserved domains - security: - - CustomTokenAuth: [] parameters: - in: query name: invoice_number + required: true schema: type: string - in: query name: user_unique_id + required: true schema: type: string responses: @@ -127,8 +127,18 @@ paths: properties: status: type: string - invoice_details: - type: object + enum: [pending, paid, failed] + message: + type: string + reserved_domains: + type: array + items: + type: object + properties: + name: + type: string + password: + type: string /business_registry/reserve_domains: post: @@ -164,36 +174,6 @@ paths: items: type: object - /business_registry/refresh_token: - patch: - summary: Refresh access token - description: | - Refreshes an existing access token. - The current token must be provided in the X-Auth-Token header. - No request body is required. - Returns a new unique token to replace the current one. - Note: The initial token is issued when a domain is reserved. - security: - - CustomTokenAuth: [] - responses: - '200': - description: Token successfully refreshed - content: - application/json: - schema: - type: object - properties: - message: - type: string - example: "Token refreshed successfully" - token: - type: string - example: "new_unique_token_123xyz" - '401': - $ref: '#/components/responses/Unauthorized' - '404': - $ref: '#/components/responses/NotFound' - /business_registry/registration_code: get: summary: Get registration code for reserved domain @@ -229,92 +209,6 @@ paths: schema: $ref: '#/components/schemas/Error' - /business_registry/release: - delete: - summary: Release reserved domain - description: Releases a previously reserved domain - security: - - CustomTokenAuth: [] - responses: - '200': - description: Domain successfully released - content: - application/json: - schema: - type: object - properties: - message: - type: string - '401': - $ref: '#/components/responses/Unauthorized' - '404': - $ref: '#/components/responses/NotFound' - '422': - $ref: '#/components/responses/UnprocessableEntity' - - /business_registry/reserve: - post: - summary: Reserve a domain - description: Reserves the specified domain - security: - - CustomTokenAuth: [] - requestBody: - required: true - content: - application/json: - schema: - type: object - properties: - domain_name: - type: string - required: - - domain_name - responses: - '201': - description: Domain successfully reserved - content: - application/json: - schema: - type: object - properties: - message: - type: string - token: - type: string - linkpay: - type: string - '400': - $ref: '#/components/responses/BadRequest' - '401': - $ref: '#/components/responses/Unauthorized' - '422': - $ref: '#/components/responses/UnprocessableEntity' - - /business_registry/status: - get: - summary: Get reserved domain status - description: Returns the current status of a reserved domain - security: - - CustomTokenAuth: [] - responses: - '200': - description: Successful response - content: - application/json: - schema: - type: object - properties: - invoice_status: - type: string - reserved_domain: - type: string - password: - type: string - '401': - $ref: '#/components/responses/Unauthorized' - '422': - $ref: '#/components/responses/UnprocessableEntity' - components: securitySchemes: CustomTokenAuth: From 20fd443441da7c063b86e36d06492de991e8bbf6 Mon Sep 17 00:00:00 2001 From: oleghasjanov Date: Tue, 19 Nov 2024 14:00:25 +0200 Subject: [PATCH 2/3] updated index.html --- index.html | 46 ++++++++-------------------------------------- 1 file changed, 8 insertions(+), 38 deletions(-) diff --git a/index.html b/index.html index de2bd40..8406b04 100644 --- a/index.html +++ b/index.html @@ -2109,9 +2109,7 @@ data-styled.g114[id="sc-eEVmNe"]{content:"ilvUMs,"}/*!sc*/ .ihNycv{font-size:0.929em;line-height:20px;background-color:#2F8132;color:#ffffff;padding:3px 10px;text-transform:uppercase;font-family:Montserrat,sans-serif;margin:0;}/*!sc*/ .ldMUmp{font-size:0.929em;line-height:20px;background-color:#186FAF;color:#ffffff;padding:3px 10px;text-transform:uppercase;font-family:Montserrat,sans-serif;margin:0;}/*!sc*/ -.cDAiVX{font-size:0.929em;line-height:20px;background-color:#bf581d;color:#ffffff;padding:3px 10px;text-transform:uppercase;font-family:Montserrat,sans-serif;margin:0;}/*!sc*/ -.bJzUtf{font-size:0.929em;line-height:20px;background-color:#cc3333;color:#ffffff;padding:3px 10px;text-transform:uppercase;font-family:Montserrat,sans-serif;margin:0;}/*!sc*/ -data-styled.g115[id="sc-fmdNqN"]{content:"ihNycv,ldMUmp,cDAiVX,bJzUtf,"}/*!sc*/ +data-styled.g115[id="sc-fmdNqN"]{content:"ihNycv,ldMUmp,"}/*!sc*/ .flIrdF{position:absolute;width:100%;z-index:100;background:#fafafa;color:#263238;box-sizing:border-box;box-shadow:0px 0px 6px rgba(0,0,0,0.33);overflow:hidden;border-bottom-left-radius:4px;border-bottom-right-radius:4px;-webkit-transition:all 0.25s ease;transition:all 0.25s ease;visibility:hidden;-webkit-transform:translateY(-50%) scaleY(0);-ms-transform:translateY(-50%) scaleY(0);transform:translateY(-50%) scaleY(0);}/*!sc*/ data-styled.g116[id="sc-ljsmAU"]{content:"flIrdF,"}/*!sc*/ .fQkroN{padding:10px;}/*!sc*/ @@ -2123,11 +2121,7 @@ .lbYftx:focus{outline:auto #1d8127;}/*!sc*/ .NAUPn{display:block;border:0;width:100%;text-align:left;padding:10px;border-radius:2px;margin-bottom:4px;line-height:1.5em;cursor:pointer;color:#d41f1c;background-color:rgba(212,31,28,0.07);}/*!sc*/ .NAUPn:focus{outline:auto #d41f1c;}/*!sc*/ -.cGFwjB{display:block;border:0;width:100%;text-align:left;padding:10px;border-radius:2px;margin-bottom:4px;line-height:1.5em;cursor:pointer;color:#d41f1c;background-color:rgba(212,31,28,0.07);cursor:default;}/*!sc*/ -.cGFwjB:focus{outline:auto #d41f1c;}/*!sc*/ -.cGFwjB::before{content:"—";font-weight:bold;width:1.5em;text-align:center;display:inline-block;vertical-align:top;}/*!sc*/ -.cGFwjB:focus{outline:0;}/*!sc*/ -data-styled.g119[id="sc-htmcrh"]{content:"lbYftx,NAUPn,cGFwjB,"}/*!sc*/ +data-styled.g119[id="sc-htmcrh"]{content:"lbYftx,NAUPn,"}/*!sc*/ .cMoEZ{vertical-align:top;}/*!sc*/ data-styled.g123[id="sc-fWWYYk"]{content:"cMoEZ,"}/*!sc*/ .DvFer{font-size:1.3em;padding:0.2em 0;margin:3em 0 1.1em;color:#333333;font-weight:normal;}/*!sc*/ @@ -2167,7 +2161,7 @@ -
failed_url
string

Callback URL for failed payment

Responses

Request samples

Content type
application/json
{
  • "domain_names": [
    ],
  • "success_url": "string",
  • "failed_url": "string"
}

Response samples

Content type
application/json
{
  • "payment_link": "string",
  • "reserved_domains": [
    ]
}

Get status of long-term reserved domains

Authorizations:
CustomTokenAuth
query Parameters
invoice_number
string
user_unique_id
string

Responses

https://api.example.com/v1/business_registry/long_reserve_domains

Request samples

Content type
application/json
{
  • "domain_names": [
    ],
  • "success_url": "string",
  • "failed_url": "string"
}

Response samples

Content type
application/json
{
  • "payment_link": "string",
  • "reserved_domains": [
    ]
}

Get status of long-term reserved domains

query Parameters
invoice_number
required
string
user_unique_id
required
string

Responses

Response samples

Content type
application/json
{
  • "status": "string",
  • "invoice_details": { }
}

Reserve domains without payment

Authorizations:
CustomTokenAuth
Request Body schema: application/json
domain_names
required
Array of strings

Array of domain names to reserve (limited by MAX_DOMAIN_NAME_PER_REQUEST)

+
https://api.example.com/v1/business_registry/long_reserve_domains_status

Response samples

Content type
application/json
{
  • "status": "pending",
  • "message": "string",
  • "reserved_domains": [
    ]
}

Reserve domains without payment

Authorizations:
CustomTokenAuth
Request Body schema: application/json
domain_names
required
Array of strings

Array of domain names to reserve (limited by MAX_DOMAIN_NAME_PER_REQUEST)

Responses

Request samples

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

Response samples

Content type
application/json
{
  • "message": "string",
  • "reserved_domains": [
    ]
}

Refresh access token

Refreshes an existing access token. -The current token must be provided in the X-Auth-Token header. -No request body is required. -Returns a new unique token to replace the current one. -Note: The initial token is issued when a domain is reserved.

-
Authorizations:
CustomTokenAuth

Responses

Response samples

Content type
application/json
{
  • "message": "Token refreshed successfully",
  • "token": "new_unique_token_123xyz"
}

Get registration code for reserved domain

Returns the registration code (password) for a reserved domain. +

https://api.example.com/v1/business_registry/reserve_domains

Request samples

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

Response samples

Content type
application/json
{
  • "message": "string",
  • "reserved_domains": [
    ]
}

Get registration code for reserved domain

Returns the registration code (password) for a reserved domain. This code is crucial for the domain registration process with registrars. The registrar will require this code to verify and complete the registration of the reserved domain. Note: Keep this code confidential and provide it only to your chosen registrar when initiating the domain registration process.

@@ -2251,25 +2237,9 @@

Response samples

Content type
application/json
{
  • "name": "example-company.ee",
  • "registration_code": "secure_registration_code_123xyz"
}

Release reserved domain

Releases a previously reserved domain

-
Authorizations:
CustomTokenAuth

Responses

Response samples

Content type
application/json
{
  • "message": "string"
}

Reserve a domain

Reserves the specified domain

-
Authorizations:
CustomTokenAuth
Request Body schema: application/json
domain_name
required
string

Responses

Request samples

Content type
application/json
{
  • "domain_name": "string"
}

Response samples

Content type
application/json
{
  • "message": "string",
  • "token": "string",
  • "linkpay": "string"
}

Get reserved domain status

Returns the current status of a reserved domain

-
Authorizations:
CustomTokenAuth

Responses

Response samples

Content type
application/json
{
  • "invoice_status": "string",
  • "reserved_domain": "string",
  • "password": "string"
}
+
https://api.example.com/v1/business_registry/registration_code

Response samples

Content type
application/json
{
  • "name": "example-company.ee",
  • "registration_code": "secure_registration_code_123xyz"
}