Skip to content

Commit

Permalink
quick fix
Browse files Browse the repository at this point in the history
  • Loading branch information
OlegPhenomenon committed Aug 8, 2024
1 parent de33924 commit 3578694
Showing 1 changed file with 125 additions and 101 deletions.
226 changes: 125 additions & 101 deletions openapi/openapi.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4,121 +4,145 @@ info:
version: 1.0.0
description: |
API for managing domain name registration and reservation in the business registry.
Key features:
- Domain name reservation
- Retrieval of registration codes for reserved domains
- Status checks for reserved domains
Important: The registration code obtained through this API is essential for completing
the domain registration process with authorized registrars. This code serves as a
password and should be kept confidential until provided to the chosen registrar.
Note: Access to all endpoints in this API is restricted to authorized IP addresses only.
Some endpoints additionally require a custom token for authentication.
Process Overview:
1. Domain Name Suggestions:
Use the '/business_registry/domain_names' endpoint to receive suggestions for available domain names based on the organization's name.
2. Domain Reservation:
Utilize the '/business_registry/reserve' endpoint to reserve a chosen domain name. This endpoint returns a token for tracking the reservation status and a payment link.
3. Reservation Status:
The '/business_registry/status' endpoint allows tracking of the payment receipt and domain reservation status. Upon successful payment and reservation, it provides the reserved domain name and a registration password.
4. Registration Code Retrieval:
If the registration password is lost or forgotten, use the '/business_registry/registration_code' endpoint to retrieve it using the provided token.
5. Token Refresh:
Tokens have a 30-day validity period. Use the '/business_registry/refresh_token' endpoint to renew an expired token or in case of a potential token compromise.
6. Reservation Cancellation:
To cancel a domain reservation, use the '/business_registry/release' endpoint.
Important Notes:
- The registration code obtained through this API is essential for completing the domain registration process with authorized registrars. This code serves as a password and should be kept confidential until provided to the chosen registrar.
- Most endpoints require the token to be included in the Authorization header as a Bearer token. This token is initially provided when reserving a domain.
- Access to all endpoints in this API is restricted to authorized IP addresses only.
Security:
- All communication with this API should be conducted over HTTPS to ensure data privacy and integrity.
- Protect the received token and registration code. Do not share them with unauthorized parties.
- Regularly refresh your token to maintain security.
For detailed information on each endpoint, including required parameters and possible responses, please refer to the individual endpoint documentation below.
servers:
- url: https://api.example.com/v1
description: Main API server

paths:
/business_registry/domain_names:
get:
summary: Get available domain name variants
description: |
Generates and returns a list of available domain name variants based on the organization name.
Note: This endpoint does not require a token, but access is restricted to authorized IP addresses only.
parameters:
- in: query
name: organization_name
required: true
schema:
type: string
description: Organization name to generate domain name variants
responses:
'200':
description: Successful response
content:
application/json:
schema:
type: object
properties:
variants:
type: array
items:
type: string
'400':
description: Bad request
content:
application/json:
schema:
$ref: '#/components/schemas/Error'
/business_registry/domain_names:
get:
summary: Get available domain name variants
description: |
Generates and returns a list of available domain name variants based on the organization name.
Note: This endpoint does not require a token, but access is restricted to authorized IP addresses only.
parameters:
- in: query
name: organization_name
required: true
schema:
type: string
description: Organization name to generate domain name variants
responses:
'200':
description: Successful response
content:
application/json:
schema:
type: object
properties:
variants:
type: array
items:
type: string
'400':
description: Bad request
content:
application/json:
schema:
$ref: '#/components/schemas/Error'

/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/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
description: |
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.
security:
- CustomTokenAuth: []
responses:
'200':
description: Successful response
content:
application/json:
schema:
type: object
properties:
name:
type: string
description: The name of the reserved domain
example: "example-company.ee"
registration_code:
type: string
description: The registration code (password) to be used when registering the domain with a registrar
example: "secure_registration_code_123xyz"
'401':
$ref: '#/components/responses/Unauthorized'
'404':
description: Reserved domain not found
content:
application/json:
schema:
$ref: '#/components/schemas/Error'
/business_registry/registration_code:
get:
summary: Get registration code for reserved domain
description: |
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.
security:
- CustomTokenAuth: []
responses:
'200':
description: Successful response
content:
application/json:
schema:
type: object
properties:
name:
type: string
description: The name of the reserved domain
example: "example-company.ee"
registration_code:
type: string
description: The registration code (password) to be used when registering the domain with a registrar
example: "secure_registration_code_123xyz"
'401':
$ref: '#/components/responses/Unauthorized'
'404':
description: Reserved domain not found
content:
application/json:
schema:
$ref: '#/components/schemas/Error'

/business_registry/release:
delete:
Expand Down

0 comments on commit 3578694

Please sign in to comment.