Created
November 10, 2020 16:40
-
-
Save vigikaran/09ceaac205dc6922ee718bdd1c6ea34e to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
openapi: 3.0.0 | |
info: | |
title: Web API | |
version: '1.0' | |
contact: | |
name: Lavan | |
email: [email protected] | |
license: | |
name: MIT | |
description: Rest API for User Dashboard | |
servers: | |
- url: 'https://nexmobile-api.esimpanel.com/api-v1' | |
description: Dev | |
paths: | |
/guest/countries: | |
get: | |
summary: Get countries list | |
tags: | |
- Guest | |
responses: | |
'200': | |
description: OK | |
content: | |
application/json: | |
schema: | |
description: '' | |
type: object | |
properties: | |
result: | |
type: boolean | |
data: | |
type: array | |
uniqueItems: true | |
minItems: 1 | |
items: | |
type: object | |
properties: | |
id: | |
type: number | |
country_name: | |
type: string | |
minLength: 1 | |
country_code: | |
type: string | |
minLength: 1 | |
short_code: | |
type: string | |
minLength: 1 | |
dial_code: | |
type: string | |
minLength: 1 | |
time_zone: | |
type: string | |
minLength: 1 | |
otp_type: | |
type: number | |
switch_id: | |
type: number | |
access_number: {} | |
accessnumber_support: | |
type: number | |
callback_support: | |
type: number | |
wifi_support: | |
type: number | |
conference_support: | |
type: number | |
popular: | |
type: number | |
land_price: | |
type: string | |
minLength: 1 | |
mob_price: | |
type: string | |
minLength: 1 | |
currency: | |
type: string | |
minLength: 1 | |
currency_symbol: | |
type: string | |
minLength: 1 | |
tax: | |
type: number | |
tax_type: | |
type: number | |
status: | |
type: number | |
examples: | |
Sample Result: | |
value: | |
result: true | |
data: | |
- id: 1 | |
country_name: Afghanistan | |
country_code: AFG | |
short_code: AF | |
dial_code: '+93' | |
time_zone: Asia/Kabul | |
otp_type: 1 | |
switch_id: 2 | |
access_number: null | |
accessnumber_support: 0 | |
callback_support: 1 | |
wifi_support: 0 | |
conference_support: 0 | |
popular: 0 | |
land_price: '0' | |
mob_price: '0' | |
currency: USD | |
currency_symbol: $ | |
tax: 0 | |
tax_type: 1 | |
status: 1 | |
- id: 2 | |
country_name: Aland | |
country_code: ALA | |
short_code: AX | |
dial_code: '+358' | |
time_zone: Europe/Mariehamn | |
otp_type: 1 | |
switch_id: 2 | |
access_number: null | |
accessnumber_support: 0 | |
callback_support: 1 | |
wifi_support: 0 | |
conference_support: 0 | |
popular: 0 | |
land_price: '-' | |
mob_price: '-' | |
currency: USD | |
currency_symbol: $ | |
tax: 0 | |
tax_type: 1 | |
status: 1 | |
'400': | |
description: Bad Request | |
content: | |
application/json: | |
schema: | |
description: '' | |
type: object | |
properties: | |
result: | |
type: boolean | |
error: | |
type: string | |
minLength: 1 | |
examples: | |
Sample Result: | |
value: | |
result: false | |
error: Opps! something went wrong. | |
operationId: get-guest-countries | |
description: Get All Country List | |
parameters: [] | |
'/guest/countries/{countryId}': | |
parameters: | |
- schema: | |
type: string | |
name: countryId | |
in: path | |
required: true | |
get: | |
summary: Get country by ID | |
tags: | |
- Guest | |
responses: | |
'200': | |
description: OK | |
content: | |
application/json: | |
schema: | |
description: '' | |
type: object | |
properties: | |
result: | |
type: boolean | |
data: | |
type: object | |
properties: | |
id: | |
type: number | |
country_name: | |
type: string | |
minLength: 1 | |
country_code: | |
type: string | |
minLength: 1 | |
short_code: | |
type: string | |
minLength: 1 | |
dial_code: | |
type: string | |
minLength: 1 | |
time_zone: | |
type: string | |
minLength: 1 | |
otp_type: | |
type: number | |
switch_id: | |
type: number | |
access_number: {} | |
accessnumber_support: | |
type: number | |
callback_support: | |
type: number | |
wifi_support: | |
type: number | |
conference_support: | |
type: number | |
popular: | |
type: number | |
land_price: | |
type: string | |
minLength: 1 | |
mob_price: | |
type: string | |
minLength: 1 | |
currency: | |
type: string | |
minLength: 1 | |
currency_symbol: | |
type: string | |
minLength: 1 | |
tax: | |
type: number | |
tax_type: | |
type: number | |
status: | |
type: number | |
examples: | |
Sample Result: | |
value: | |
result: true | |
data: | |
id: 1 | |
country_name: Afghanistan | |
country_code: AFG | |
short_code: AF | |
dial_code: '+93' | |
time_zone: Asia/Kabul | |
otp_type: 1 | |
switch_id: 2 | |
access_number: null | |
accessnumber_support: 0 | |
callback_support: 1 | |
wifi_support: 0 | |
conference_support: 0 | |
popular: 0 | |
land_price: '0' | |
mob_price: '0' | |
currency: USD | |
currency_symbol: $ | |
tax: 0 | |
tax_type: 1 | |
status: 1 | |
'400': | |
description: Bad Request | |
content: | |
application/json: | |
schema: | |
description: '' | |
type: object | |
properties: | |
result: | |
type: boolean | |
error: | |
type: string | |
minLength: 1 | |
examples: | |
Sample Result: | |
value: | |
result: false | |
error: Opps! something went wrong. | |
operationId: get-guest-countries-countryId | |
description: Get Country Details by ID | |
/guest/plans: | |
get: | |
summary: Get all plans | |
responses: | |
'200': | |
description: OK | |
content: | |
application/json: | |
schema: | |
description: '' | |
type: object | |
properties: | |
result: | |
type: boolean | |
data: | |
type: object | |
properties: | |
plans: | |
type: array | |
items: | |
type: object | |
bundles: | |
type: array | |
items: | |
type: object | |
examples: | |
Sample Result: | |
value: | |
result: true | |
data: | |
plans: [] | |
bundles: [] | |
'400': | |
description: Bad Request | |
content: | |
application/json: | |
schema: | |
description: '' | |
type: object | |
properties: | |
result: | |
type: boolean | |
error: | |
type: string | |
minLength: 1 | |
examples: | |
Sample Result: | |
value: | |
result: false | |
error: Opps! something went wrong. | |
operationId: get-guest-plans | |
description: List All the Plans | |
tags: | |
- Guest | |
/auth/login: | |
post: | |
summary: Login using email | |
operationId: post-auth-login | |
responses: | |
'200': | |
description: OK | |
content: | |
application/json: | |
schema: | |
description: '' | |
type: object | |
properties: | |
access_token: | |
type: string | |
minLength: 1 | |
token_type: | |
type: string | |
minLength: 1 | |
expires_in: | |
type: number | |
required: | |
- access_token | |
- token_type | |
- expires_in | |
examples: | |
Sample Result: | |
value: | |
access_token: eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJpc3MiOiJodHRwOlwvXC9uZXhyaXNld2ViLnRlc3RcL2FwaS12MVwvYXV0aFwvbG9naW4iLCJpYXQiOjE2MDUwMDk4NDQsImV4cCI6MTYwNTIyNTg0NCwibmJmIjoxNjA1MDA5ODQ0LCJqdGkiOiJFdHpYcjV3YTlEZ1BVMk9QIiwic3ViIjoxMDAwMSwicHJ2IjoiMGUxYzdiNmQ4N2ExN2Y3MWZkMTNhMjJmNjBhNmI2NGY5ZDc0ZDk2NSJ9.YRnjsAC3ws4XEItbSNMXZyQ5OqTLKBmH4Vtsp3Vldn0 | |
token_type: bearer | |
expires_in: 216000 | |
'400': | |
description: Bad Request | |
content: | |
application/json: | |
schema: | |
description: '' | |
type: object | |
properties: | |
result: | |
type: boolean | |
error: | |
type: object | |
properties: | |
email: | |
type: array | |
items: {} | |
password: | |
type: array | |
items: {} | |
examples: | |
Validation Failed: | |
value: | |
result: false | |
error: | |
email: | |
- The email field is required. | |
password: | |
- The password field is required. | |
Email or password Incorrect: | |
value: | |
result: false | |
error: | |
common: Email or password is incorrect | |
description: Default Login | |
requestBody: | |
content: | |
application/json: | |
schema: | |
description: '' | |
type: object | |
properties: | |
email: | |
type: string | |
minLength: 1 | |
password: | |
type: string | |
minLength: 1 | |
examples: | |
Sample Input: | |
value: | |
email: [email protected] | |
password: test123 | |
description: '' | |
tags: | |
- Auth | |
/auth/me: | |
get: | |
summary: Get logged in user detail | |
tags: | |
- Auth | |
responses: | |
'200': | |
description: OK | |
content: | |
application/json: | |
schema: | |
description: '' | |
type: object | |
properties: | |
result: | |
type: boolean | |
data: | |
type: object | |
properties: | |
id: | |
type: number | |
first_name: | |
type: string | |
minLength: 1 | |
last_name: | |
type: string | |
minLength: 1 | |
email: | |
type: string | |
minLength: 1 | |
i_account: {} | |
phone: | |
type: string | |
minLength: 1 | |
country_id: | |
type: number | |
profile_image: {} | |
address: | |
type: string | |
minLength: 1 | |
city: | |
type: string | |
minLength: 1 | |
switch_id: | |
type: number | |
state: | |
type: string | |
minLength: 1 | |
postal_code: | |
type: string | |
minLength: 1 | |
currency: | |
type: string | |
minLength: 1 | |
currency_symbol: | |
type: string | |
minLength: 1 | |
balance_amount: | |
type: string | |
minLength: 1 | |
balance_minutes: | |
type: number | |
accessnumber_support: | |
type: boolean | |
callback_support: | |
type: boolean | |
wifi_support: | |
type: boolean | |
conference_support: | |
type: boolean | |
examples: | |
Sample Result: | |
value: | |
result: true | |
data: | |
id: 10001 | |
first_name: Vigikaran | |
last_name: Vijayk | |
email: [email protected] | |
i_account: null | |
phone: '+93123123123' | |
country_id: 1 | |
profile_image: null | |
address: '223' | |
city: sd | |
switch_id: 2 | |
state: Afghanistan | |
postal_code: '234' | |
currency: USD | |
currency_symbol: $ | |
balance_amount: '0.00' | |
balance_minutes: 0 | |
accessnumber_support: false | |
callback_support: true | |
wifi_support: false | |
conference_support: false | |
'401': | |
description: Unauthorized | |
content: | |
application/json: | |
schema: | |
description: '' | |
type: object | |
properties: | |
result: | |
type: boolean | |
error: | |
type: string | |
minLength: 1 | |
examples: | |
Sample Result: | |
value: | |
result: false | |
error: Unauthenticated Request | |
operationId: get-api-v1-auth-me | |
security: | |
- UserToken: [] | |
description: Get logged in user detail | |
parameters: [] | |
/auth/logout: | |
parameters: [] | |
post: | |
summary: Logout user | |
operationId: post-auth-logout | |
responses: | |
'200': | |
description: OK | |
content: | |
application/json: | |
schema: | |
description: '' | |
type: object | |
properties: | |
result: | |
type: boolean | |
data: | |
type: object | |
properties: | |
message: | |
type: string | |
minLength: 1 | |
examples: | |
Sample result: | |
value: | |
result: true | |
data: | |
message: Successfully logged out | |
'401': | |
description: Unauthorized | |
content: | |
application/json: | |
schema: | |
description: '' | |
type: object | |
properties: | |
result: | |
type: boolean | |
error: | |
type: object | |
properties: | |
auth: | |
type: string | |
minLength: 1 | |
examples: | |
Sample Result: | |
value: | |
result: false | |
error: | |
auth: Unauthenticated Request | |
description: Logout user and invalidate token | |
tags: | |
- Auth | |
security: | |
- UserToken: [] | |
/auth/refresh: | |
post: | |
summary: Refresh user token | |
operationId: post-auth-refresh | |
responses: | |
'200': | |
description: OK | |
content: | |
application/json: | |
schema: | |
description: '' | |
type: object | |
properties: | |
access_token: | |
type: string | |
minLength: 1 | |
token_type: | |
type: string | |
minLength: 1 | |
expires_in: | |
type: number | |
examples: | |
Sample Result: | |
value: | |
access_token: eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJpc3MiOiJodHRwOlwvXC9uZXhyaXNld2ViLnRlc3RcL2FwaS12MVwvYXV0aFwvbG9naW4iLCJpYXQiOjE2MDUwMDk4NDQsImV4cCI6MTYwNTIyNTg0NCwibmJmIjoxNjA1MDA5ODQ0LCJqdGkiOiJFdHpYcjV3YTlEZ1BVMk9QIiwic3ViIjoxMDAwMSwicHJ2IjoiMGUxYzdiNmQ4N2ExN2Y3MWZkMTNhMjJmNjBhNmI2NGY5ZDc0ZDk2NSJ9.YRnjsAC3ws4XEItbSNMXZyQ5OqTLKBmH4Vtsp3Vldn0 | |
token_type: bearer | |
expires_in: 216000 | |
'401': | |
description: Unauthorized | |
content: | |
application/json: | |
schema: | |
description: '' | |
type: object | |
properties: | |
result: | |
type: boolean | |
error: | |
type: object | |
properties: | |
auth: | |
type: string | |
minLength: 1 | |
examples: | |
Sample Result: | |
value: | |
result: false | |
error: | |
auth: Unauthenticated Request | |
tags: | |
- Auth | |
security: | |
- UserToken: [] | |
description: Refresh user token | |
/auth/login-with-otp: | |
post: | |
summary: Login using mobile number | |
operationId: post-auth-login-with-otp | |
responses: | |
'200': | |
description: OK | |
content: | |
application/json: | |
schema: | |
description: '' | |
type: object | |
properties: | |
result: | |
type: boolean | |
data: | |
type: object | |
properties: | |
verify_token: | |
type: string | |
minLength: 1 | |
examples: | |
Sample Result: | |
value: | |
result: true | |
data: | |
verify_token: eyJpdiI6IlhXNklxeUc3ZVdzWmtZZU5GY1VWbHc9PSIsInZhbHVlIjoiVkx3bUJybUFyNVZKMGZ3RW1Hekx6eDlUOTZIRjFicVo0SFROZHA3aFRUSHpZeDl3dGlpRVJpbGY2WHZoeDZPUGg4c0wxWjh5SWIrRjNLM0U0Mkw5XC9Nb2ltblBrNGQzQ2U2eSswem5Zcm5QaFBmOHhmN2E4VU4xOW1OTWlkbFBqIiwibWFjIjoiM2ZhNGU1MGEyYjM4ZjVhYTAwYWZmYjEzMjFjZjE2M2UzYjQ3ZjMxYmRiNmMyNWM5ODVhYTY0M2QwMDU4NDI0NiJ9 | |
'400': | |
description: Bad Request | |
content: | |
application/json: | |
schema: | |
description: '' | |
type: object | |
properties: | |
result: | |
type: boolean | |
error: | |
type: object | |
properties: | |
phone: | |
type: array | |
items: {} | |
examples: | |
Sample Result: | |
value: | |
result: false | |
error: | |
phone: | |
- The phone field is required. | |
Sample for invalid phone number: | |
value: | |
result: false | |
error: | |
phone: | |
- Phone number does not exist in our records. | |
description: Login useing mobile number | |
tags: | |
- Auth | |
requestBody: | |
content: | |
application/json: | |
schema: | |
description: '' | |
type: object | |
properties: | |
phone: | |
type: string | |
minLength: 1 | |
required: | |
- phone | |
examples: | |
Sample Input: | |
value: | |
phone: '+447951199351' | |
/auth/verify-otp: | |
post: | |
summary: Verify one time password | |
operationId: post-auth-verify-otp | |
responses: | |
'200': | |
description: OK | |
content: | |
application/json: | |
schema: | |
description: '' | |
type: object | |
properties: | |
access_token: | |
type: string | |
minLength: 1 | |
token_type: | |
type: string | |
minLength: 1 | |
expires_in: | |
type: number | |
required: | |
- access_token | |
- token_type | |
- expires_in | |
examples: | |
Login Success: | |
value: | |
access_token: eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJpc3MiOiJodHRwOlwvXC9uZXhyaXNld2ViLnRlc3RcL2FwaS12MVwvYXV0aFwvbG9naW4iLCJpYXQiOjE2MDUwMDk4NDQsImV4cCI6MTYwNTIyNTg0NCwibmJmIjoxNjA1MDA5ODQ0LCJqdGkiOiJFdHpYcjV3YTlEZ1BVMk9QIiwic3ViIjoxMDAwMSwicHJ2IjoiMGUxYzdiNmQ4N2ExN2Y3MWZkMTNhMjJmNjBhNmI2NGY5ZDc0ZDk2NSJ9.YRnjsAC3ws4XEItbSNMXZyQ5OqTLKBmH4Vtsp3Vldn0 | |
token_type: bearer | |
expires_in: 216000 | |
'400': | |
description: Bad Request | |
content: | |
application/json: | |
schema: | |
description: '' | |
type: object | |
properties: | |
result: | |
type: boolean | |
error: | |
type: object | |
required: | |
- otp | |
properties: | |
otp: | |
type: array | |
items: {} | |
required: | |
- result | |
- error | |
examples: | |
Incorrect OTP: | |
value: | |
result: false | |
error: | |
otp: | |
- Incorrect One time password. | |
description: Verify one time password | |
requestBody: | |
content: | |
application/json: | |
schema: | |
description: '' | |
type: object | |
properties: | |
verify_token: | |
type: string | |
minLength: 1 | |
otp: | |
type: number | |
required: | |
- verify_token | |
- otp | |
examples: | |
Sample Input: | |
value: | |
verify_token: eyJpdiI6IlhXNklxeUc3ZVdzWmtZZU5GY1VWbHc9PSIsInZhbHVlIjoiVkx3bUJybUFyNVZKMGZ3RW1Hekx6eDlUOTZIRjFicVo0SFROZHA3aFRUSHpZeDl3dGlpRVJpbGY2WHZoeDZPUGg4c0wxWjh5SWIrRjNLM0U0Mkw5XC9Nb2ltblBrNGQzQ2U2eSswem5Zcm5QaFBmOHhmN2E4VU4xOW1OTWlkbFBqIiwibWFjIjoiM2ZhNGU1MGEyYjM4ZjVhYTAwYWZmYjEzMjFjZjE2M2UzYjQ3ZjMxYmRiNmMyNWM5ODVhYTY0M2QwMDU4NDI0NiJ9 | |
otp: 3254 | |
description: '' | |
tags: | |
- Auth | |
components: | |
schemas: {} | |
securitySchemes: | |
UserToken: | |
type: http | |
scheme: bearer | |
tags: | |
- name: Guest | |
- name: Auth |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment