Skip to content
Permalink
Branch: master
Find file Copy path
Find file Copy path
Fetching contributors…
Cannot retrieve contributors at this time
744 lines (742 sloc) 21.5 KB
openapi: 3.0.0
info:
title: BYON API
description: This is the Bring Your Own Number service
version: "1.0"
termsOfService: urn:tos
contact:
name: tyntec API Support
url: http://www.tyntec.com/support
email: support@tyntec.com
license:
name: Apache 2.0
url: http://www.apache.org/licenses/LICENSE-2.0
x-repository: https://github.com/tyntec/api-collection/blob/master/byon
x-major-version: v1
servers:
- url: https://api.tyntec.com/byon
security:
- APIKeyHeader: []
tags:
- name: Contact Service
description: Contacts Service
- name: Phone Book Service
description: Phone Book Service
- name: Numbers Service
description: Numbers service endpoint
- name: Partner Notification Service
description: API to send notifications to the partners
paths:
/phonebook/v1/numbers:
get:
tags:
- Numbers Service
summary: Return all phone numbers
description: Returns all phone numbers created by your API key. You can specify
attributes to filter the results. The size limit is 3000
operationId: getAllPhoneNumbersForAccountUsingGET
parameters:
- name: requestId
in: query
description: A filter on the list based on the requestId field.
required: false
schema:
type: string
- name: contactId
in: query
description: A filter on the list based on the contactId field.
required: false
schema:
type: string
- name: page
in: query
description: A filter on the list based on the page field.
required: false
schema:
type: integer
format: int32
- name: size
in: query
description: A filter on the list based on the size field.
required: false
schema:
type: integer
format: int32
maximum: 3000
responses:
"200":
description: The list of phones requests
content:
application/json:
schema:
type: array
items:
$ref: "#/components/schemas/PhoneProvisioningArrayResponse"
"*/*":
schema:
type: array
items:
$ref: "#/components/schemas/PhoneProvisioningArrayResponse"
"401":
description: Unauthorized
"403":
description: Forbidden
"404":
description: Not Found
"500":
description: Something went wrong :-(
content:
application/json:
schema:
$ref: "#/components/schemas/ErrorResponse"
"*/*":
schema:
$ref: "#/components/schemas/ErrorResponse"
"/phonebook/v1/numbers/{phoneNumber}":
get:
tags:
- Numbers Service
summary: Returns the specific phone number entity
description: Returns the specific phone number entity created by your API key.
operationId: getPhoneNumberForAccountUsingGET
parameters:
- name: phoneNumber
in: path
description: Phone number to get information for.
required: true
schema:
type: string
responses:
"200":
description: The Phone Number entity
content:
application/json:
schema:
type: array
items:
$ref: "#/components/schemas/PhoneProvisioningArrayResponse"
"*/*":
schema:
type: array
items:
$ref: "#/components/schemas/PhoneProvisioningArrayResponse"
"401":
description: Unauthorized
"403":
description: Forbidden
"404":
description: Not Found
"500":
description: Something went wrong :-(
content:
application/json:
schema:
$ref: "#/components/schemas/ErrorResponse"
"*/*":
schema:
$ref: "#/components/schemas/ErrorResponse"
/contacts/v1:
get:
tags:
- Contact Service
summary: Returns all contacts created
description: Returns all contacts created by your API key. You can get the contact id
from the list for editing or deleting the contact. You can specify
friendlyName to filter the results.
operationId: getAllContactsWithFriendlyNameUsingGET
parameters:
- name: friendlyName
in: query
description: A filter on the list based on the friendlyName field.
required: false
schema:
type: string
responses:
"200":
description: The list of contacts
content:
application/json:
schema:
type: array
items:
$ref: "#/components/schemas/ContactArrayResponse"
"*/*":
schema:
type: array
items:
$ref: "#/components/schemas/ContactArrayResponse"
"204":
description: Empty list. No contacts found for this friendly name
content:
application/json:
schema:
type: array
items:
$ref: "#/components/schemas/ContactArrayResponse"
"*/*":
schema:
type: array
items:
$ref: "#/components/schemas/ContactArrayResponse"
"401":
description: Unauthorized
"403":
description: Forbidden
"404":
description: Not Found
"500":
description: Something went wrong :-(
content:
application/json:
schema:
$ref: "#/components/schemas/ErrorResponse"
"*/*":
schema:
$ref: "#/components/schemas/ErrorResponse"
post:
tags:
- Contact Service
summary: Create a contact
description: Create a new contact
operationId: createContactUsingPOST
requestBody:
$ref: "#/components/requestBodies/ContactEntity"
responses:
"200":
description: OK
content:
application/json:
schema:
$ref: "#/components/schemas/ContactEntity"
"*/*":
schema:
$ref: "#/components/schemas/ContactEntity"
"201":
description: Created
"202":
description: The contact as been created
content:
application/json:
schema:
$ref: "#/components/schemas/ContactEntity"
"*/*":
schema:
$ref: "#/components/schemas/ContactEntity"
"400":
description: Not valid contact provided
"401":
description: Unauthorized
"403":
description: Forbidden
"404":
description: Contact not found
"500":
description: Something went wrong :-(
content:
application/json:
schema:
$ref: "#/components/schemas/ErrorResponse"
"*/*":
schema:
$ref: "#/components/schemas/ErrorResponse"
"/contacts/v1/{contactId}":
get:
tags:
- Contact Service
summary: Return contact
description: Returns the contact for the provided contactId.
operationId: getContactUsingGET
parameters:
- name: contactId
in: path
description: A filter on the list based on the contactId field.
required: true
schema:
type: string
responses:
"200":
description: The contact
content:
application/json:
schema:
$ref: "#/components/schemas/ContactEntity"
"*/*":
schema:
$ref: "#/components/schemas/ContactEntity"
"401":
description: Unauthorized
"403":
description: Forbidden
"404":
description: Contact not found
"500":
description: Something went wrong :-(
content:
application/json:
schema:
$ref: "#/components/schemas/ErrorResponse"
"*/*":
schema:
$ref: "#/components/schemas/ErrorResponse"
post:
tags:
- Contact Service
summary: Edit contact
description: Edit the contact for the provided contactId.
operationId: editContactUsingPOST
parameters:
- name: contactId
in: path
description: Contact ID to be edited.
required: true
schema:
type: string
requestBody:
$ref: "#/components/requestBodies/ContactEntity"
responses:
"200":
description: The edited contact
content:
application/json:
schema:
$ref: "#/components/schemas/ContactEntity"
"*/*":
schema:
$ref: "#/components/schemas/ContactEntity"
"201":
description: Created
"400":
description: Contact can not be edited
"401":
description: Unauthorized
"403":
description: Forbidden
"404":
description: Contact not found
"500":
description: Something went wrong :-(
content:
application/json:
schema:
$ref: "#/components/schemas/ErrorResponse"
"*/*":
schema:
$ref: "#/components/schemas/ErrorResponse"
delete:
tags:
- Contact Service
summary: Delete contact
description: Delete the contact for the provided contactId.
operationId: deleteContactUsingDELETE
parameters:
- name: contactId
in: path
description: The unique identifier of the contact to delete.
required: true
schema:
type: string
responses:
"200":
description: The deleted contact
content:
application/json:
schema:
$ref: "#/components/schemas/ContactEntity"
"*/*":
schema:
$ref: "#/components/schemas/ContactEntity"
"204":
description: No Content
"400":
description: Contact can not be deleted
"401":
description: Unauthorized
"403":
description: Forbidden
"404":
description: Contact not found
"500":
description: Something went wrong :-(
content:
application/json:
schema:
$ref: "#/components/schemas/ErrorResponse"
"*/*":
schema:
$ref: "#/components/schemas/ErrorResponse"
/provisioning/v1:
get:
tags:
- Phone Book Service
summary: Returns all phones
description: |
Returns all phone numbers provisioning requests created.
You can specify _friendlyName_ or _contactId_ for filtering the results.
operationId: getAllProvisioningPhoneNumbersForAccountUsingGET
parameters:
- name: friendlyName
in: query
description: A filter on the list based on the friendlyName field.
required: false
schema:
type: string
- name: contactId
in: query
description: A filter on the list based on the contactId field.
required: false
schema:
type: string
responses:
"200":
description: The list of phone provisioning requests
content:
application/json:
schema:
type: array
items:
$ref: "#/components/schemas/PhoneProvisioningArrayResponse"
"*/*":
schema:
type: array
items:
$ref: "#/components/schemas/PhoneProvisioningArrayResponse"
"204":
description: Empty list. No phone provisioning requests found
content:
application/json:
schema:
type: array
items:
$ref: "#/components/schemas/PhoneProvisioningArrayResponse"
"*/*":
schema:
type: array
items:
$ref: "#/components/schemas/PhoneProvisioningArrayResponse"
"401":
description: Unauthorized
"403":
description: Forbidden
"404":
description: Not Found
"500":
description: Something went wrong :-(
content:
application/json:
schema:
$ref: "#/components/schemas/ErrorResponse"
"*/*":
schema:
$ref: "#/components/schemas/ErrorResponse"
post:
tags:
- Phone Book Service
description: New phone batch provisioning
operationId: createPhoneProvisioningRequestUsingPOST
parameters:
- name: friendlyName
in: query
description: A filter on the list based on the friendlyName field.
required: false
schema:
type: string
- name: contactId
in: query
description: A filter on the list based on the contactId field.
required: true
schema:
type: string
requestBody:
content:
application/json:
schema:
type: array
items:
$ref: "#/components/schemas/PhoneNumberEntity"
description: >
A comma-separated list of phone number details.
- phoneNumber
- country (only optional if the phone number already included the country code)
required: true
responses:
"200":
description: The list of applications
content:
application/json:
schema:
$ref: "#/components/schemas/PhoneProvisioningEntity"
"*/*":
schema:
$ref: "#/components/schemas/PhoneProvisioningEntity"
"201":
description: Created
"204":
description: Empty list. No applications found for your account
content:
application/json:
schema:
$ref: "#/components/schemas/PhoneProvisioningEntity"
"*/*":
schema:
$ref: "#/components/schemas/PhoneProvisioningEntity"
"400":
description: Your request was not valid
"401":
description: Unauthorized
"403":
description: Forbidden
"404":
description: The contact was not found
"500":
description: Something went wrong :-(
content:
application/json:
schema:
$ref: "#/components/schemas/ErrorResponse"
"*/*":
schema:
$ref: "#/components/schemas/ErrorResponse"
"/provisioning/v1/{requestId}":
get:
tags:
- Phone Book Service
summary: Phone status
description: Returns the details of the provisioning request for the provided
requestId.
operationId: getProvisioningRequestUsingGET
parameters:
- name: requestId
in: path
description: A unique identifier based on the requestId field.
required: true
schema:
type: string
responses:
"200":
description: The provisioning request
content:
application/json:
schema:
$ref: "#/components/schemas/PhoneProvisioningEntity"
"*/*":
schema:
$ref: "#/components/schemas/PhoneProvisioningEntity"
"400":
description: Your request was not valid
"401":
description: Unauthorized
"403":
description: Forbidden
"404":
description: The provisioning request was not found
"500":
description: Something went wrong :-(
content:
application/json:
schema:
$ref: "#/components/schemas/ErrorResponse"
"*/*":
schema:
$ref: "#/components/schemas/ErrorResponse"
components:
requestBodies:
ContactEntity:
content:
application/json:
schema:
$ref: "#/components/schemas/ContactEntity"
description: |
A comma-separated list of contact details.
- companyAddress (optional)
- companyName
- contactEmail
- contactName
- contactPhone
- contactTitle (optional)
- friendlyName (optional)
required: true
securitySchemes:
APIKeyHeader:
type: apiKey
in: header
name: apiKey
schemas:
ContactArrayResponse:
type: object
description: Contract Array Response schema
properties:
contacts:
type: array
items:
$ref: "#/components/schemas/ContactEntity"
size:
type: integer
format: int32
ContactEntity:
type: object
description: Contract Entity schema
properties:
companyAddress:
description: Company's postal address
type: string
companyName:
description: Company's name
type: string
contactEmail:
description: e-mail address
type: string
contactName:
description: Name of the requestor
type: string
contactPhone:
description: Phone number of the requestor
type: string
contactTitle:
description: Title of the requestor
type: string
friendlyName:
description: A filter on the list based on the friendlyName field.
type: string
ErrorResponse:
type: object
description: Error Response schema
properties:
code:
description: error code
type: string
message:
description: A short, human-readable summary of the problem type.
type: string
timestamp:
description: Point in time when the event happend
type: integer
format: int64
PhoneNumberEntity:
type: object
description: Phone number schema
properties:
phoneNumber:
description: Phone number of the contact
type: string
country:
description: The country that the phone number is registered
type: string
operator:
description: Operator's network
type: string
ip:
description: IP address of the phone
type: array
items:
type: string
callbackUrl:
type: string
PhoneProvisioningArrayResponse:
type: object
description: Phone provisioning array response schema
properties:
provisioningRequests:
type: array
items:
$ref: "#/components/schemas/PhoneProvisioningEntity"
size:
type: integer
format: int32
PhoneProvisioningEntity:
type: object
description: Phone provisioning schema
properties:
accountId:
description: The account that created this entry
type: string
contactId:
description: Contact ID of this entry
type: string
friendlyName:
description: Friendly name of this entry
type: string
requestId:
description: Request ID of this entry
type: string
status:
description: Status of this entry
type: string
ResponseEntity:
type: object
description: Response schema
properties:
body:
description: A short, human-readable summary of the response.
type: object
statusCode:
description: ID of the response
type: string
enum:
- "100"
- "101"
- "102"
- "103"
- "200"
- "201"
- "202"
- "203"
- "204"
- "205"
- "206"
- "207"
- "208"
- "226"
- "300"
- "301"
- "302"
- "303"
- "304"
- "305"
- "307"
- "308"
- "400"
- "401"
- "402"
- "403"
- "404"
- "405"
- "406"
- "407"
- "408"
- "409"
- "410"
- "411"
- "412"
- "413"
- "414"
- "415"
- "416"
- "417"
- "418"
- "419"
- "420"
- "421"
- "422"
- "423"
- "424"
- "426"
- "428"
- "429"
- "431"
- "451"
- "500"
- "501"
- "502"
- "503"
- "504"
- "505"
- "506"
- "507"
- "508"
- "509"
- "510"
- "511"
statusCodeValue:
description: Response code value
type: integer
format: int32
You can’t perform that action at this time.