Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
87 changes: 60 additions & 27 deletions code/API_definitions/brand-registration.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,8 @@
* **phoneNumber** and **phoneNumberAlternate**: A pair of E.164 numbers representing the caller. Depending on the caller's networks access setup , only phoneNumber or both phoneNumber & phoneNumberAlternate may be used to uniquely identify the caller. The values typically correspond to parameters used in telecom signalling protocols, e.g. PAI and FROM headers in SIP.
* **status**: Status of the registration.
* **expiresAt**: The date in RFC 3339 / ISO 8601 compliant format when the brand registration is scheduled to expire. Registration status is moved to ``expired``.
* **createdAt**: Timestamp at which the Brand Registration has been created. It must follow [RFC 3339](https://datatracker.ietf.org/doc/html/rfc3339#section-5.6) and must have time zone.
* **updatedAt**: Timestamp at which the Brand Registration has been last updated. It must follow [RFC 3339](https://datatracker.ietf.org/doc/html/rfc3339#section-5.6) and must have time zone.
* **displayName**: A human-readable string that is to be displayed to the callee on their device screen instead of the calling number.
* **displayAsset**: A visual asset (e.g. a logo, image or video) that is to be displayed to the callee on their device screen instead of the calling number. Support of the visual asset depends on the service provider and callee's device. If the service provider does not support the parameter, it SHALL clearly document the limitation and SHOULD silently ignore the parameter if received.
* **customerId** : A string to represent the owner of the displayName, e.g. a commercial brand or an institution.
Expand Down Expand Up @@ -82,15 +84,15 @@
default: http://localhost:9091
description: API root, defined by the service provider, e.g. `api.example.com` or `api.example.com/somepath`
tags:
- name: Create Brand registration

Check notice on line 87 in code/API_definitions/brand-registration.yaml

View check run for this annotation

camara-validation / CAMARA Validation

Tag name must be Title Case

[S-021] Tag name 'Create Brand registration' is not Title Case. Use e.g. 'Quality On Demand' instead of 'quality-on-demand'.
description: Create Brand Registration Information for a Calling Party
- name: Update Brand registration

Check notice on line 89 in code/API_definitions/brand-registration.yaml

View check run for this annotation

camara-validation / CAMARA Validation

Tag name must be Title Case

[S-021] Tag name 'Update Brand registration' is not Title Case. Use e.g. 'Quality On Demand' instead of 'quality-on-demand'.
description: Update Existing Brand Registration Information for a Calling Party
- name: Read Brand registration

Check notice on line 91 in code/API_definitions/brand-registration.yaml

View check run for this annotation

camara-validation / CAMARA Validation

Tag name must be Title Case

[S-021] Tag name 'Read Brand registration' is not Title Case. Use e.g. 'Quality On Demand' instead of 'quality-on-demand'.
description: Read Existing Brand Registration Information for a Calling Party
- name: Delete Brand registration

Check notice on line 93 in code/API_definitions/brand-registration.yaml

View check run for this annotation

camara-validation / CAMARA Validation

Tag name must be Title Case

[S-021] Tag name 'Delete Brand registration' is not Title Case. Use e.g. 'Quality On Demand' instead of 'quality-on-demand'.
description: Delete Existing Brand Registration Information for a Calling Party
- name: Call branded notifications callback

Check notice on line 95 in code/API_definitions/brand-registration.yaml

View check run for this annotation

camara-validation / CAMARA Validation

Tag name must be Title Case

[S-021] Tag name 'Call branded notifications callback' is not Title Case. Use e.g. 'Quality On Demand' instead of 'quality-on-demand'.
description: Notifications callback invoked by the API provider when a call is successfully branded for a registration that opted in with `sink`.
paths:
/registrations:
Expand Down Expand Up @@ -259,6 +261,10 @@
- `customerId` - filter by enterprise/brand owner identifier.
- `displayName` - filter by the display name registered for the brand.
- `status` - filter by registration status.
- `createdAt.lte` - filter by lower createdAt date-time.
- `createdAt.gte` - filter by greater createdAt date-time.
- `updatedAt.lte` - filter by lower updatedAt date-time.
- `updatedAt.gte` - filter by greater updatedAt date-time.
- `expiresAt` - filter by expiresAt date.
- `terminatingCountryCode` - filter by terminating country code.
- `callPurpose` - filter by call purpose.
Expand All @@ -278,6 +284,10 @@
- $ref: '#/components/parameters/CustomerIdFilter'
- $ref: '#/components/parameters/DisplayNameFilter'
- $ref: '#/components/parameters/StatusFilter'
- $ref: '#/components/parameters/CreatedAtBeforeFilter'
- $ref: '#/components/parameters/CreatedAtAfterFilter'
- $ref: '#/components/parameters/UpdatedAtBeforeFilter'
- $ref: '#/components/parameters/UpdatedAtAfterFilter'
- $ref: '#/components/parameters/ExpiresAtFilter'
- $ref: '#/components/parameters/TerminatingCountryCodeFilter'
- $ref: '#/components/parameters/CallPurposeFilter'
Expand Down Expand Up @@ -320,7 +330,7 @@
in: path
name: registrationId
required: true
schema:

Check notice on line 333 in code/API_definitions/brand-registration.yaml

View check run for this annotation

camara-validation / CAMARA Validation

String has no format/pattern/enum

[S-313] Schema of type string should specify a format, pattern, enum, or const. Suggestion: Acceptable if free-form field or implementation-dependent — no fix needed.
type: string
maxLength: 256
responses:
Expand Down Expand Up @@ -356,7 +366,7 @@
in: path
name: registrationId
required: true
schema:

Check notice on line 369 in code/API_definitions/brand-registration.yaml

View check run for this annotation

camara-validation / CAMARA Validation

String has no format/pattern/enum

[S-313] Schema of type string should specify a format, pattern, enum, or const. Suggestion: Acceptable if free-form field or implementation-dependent — no fix needed.
type: string
maxLength: 256
responses:
Expand Down Expand Up @@ -392,7 +402,7 @@
in: path
name: registrationId
required: true
schema:

Check notice on line 405 in code/API_definitions/brand-registration.yaml

View check run for this annotation

camara-validation / CAMARA Validation

String has no format/pattern/enum

[S-313] Schema of type string should specify a format, pattern, enum, or const. Suggestion: Acceptable if free-form field or implementation-dependent — no fix needed.
type: string
maxLength: 256
requestBody:
Expand Down Expand Up @@ -490,6 +500,34 @@
description: Optional filter. Restrict results to registrations in the given `status`.
schema:
$ref: '#/components/schemas/Status'
CreatedAtBeforeFilter:
name: createdAt.lte

Check warning on line 504 in code/API_definitions/brand-registration.yaml

View check run for this annotation

camara-validation / CAMARA Validation

Parameter names (path/query) must be lowerCamelCase

[S-036] name is not lowerCamelCase: "createdAt.lte" must match the pattern "^[a-z][a-zA-Z0-9]*$"
in: query
required: false
description: Optional filter. Restrict results to registrations for which creation date-time is lower or equal than the given createdAt date-time.
schema:
$ref: '#/components/schemas/CreatedAt'
CreatedAtAfterFilter:
name: createdAt.gte

Check warning on line 511 in code/API_definitions/brand-registration.yaml

View check run for this annotation

camara-validation / CAMARA Validation

Parameter names (path/query) must be lowerCamelCase

[S-036] name is not lowerCamelCase: "createdAt.gte" must match the pattern "^[a-z][a-zA-Z0-9]*$"
in: query
required: false
description: Optional filter. Restrict results to registrations for which creation date-time is greater or equal than the given createdAt date-time.
schema:
$ref: '#/components/schemas/CreatedAt'
UpdatedAtBeforeFilter:
name: updatedAt.lte

Check warning on line 518 in code/API_definitions/brand-registration.yaml

View check run for this annotation

camara-validation / CAMARA Validation

Parameter names (path/query) must be lowerCamelCase

[S-036] name is not lowerCamelCase: "updatedAt.lte" must match the pattern "^[a-z][a-zA-Z0-9]*$"
in: query
required: false
description: Optional filter. Restrict results to registrations for which last update date-time is lower or equal than the given updatedAt date-time.
schema:
$ref: '#/components/schemas/UpdatedAt'
UpdatedAtAfterFilter:
name: updatedAt.gte

Check warning on line 525 in code/API_definitions/brand-registration.yaml

View check run for this annotation

camara-validation / CAMARA Validation

Parameter names (path/query) must be lowerCamelCase

[S-036] name is not lowerCamelCase: "updatedAt.gte" must match the pattern "^[a-z][a-zA-Z0-9]*$"
in: query
required: false
description: Optional filter. Restrict results to registrations for which last update date-time is greater or equal than the given updatedAt date-time.
schema:
$ref: '#/components/schemas/UpdatedAt'
ExpiresAtFilter:
name: expiresAt
in: query
Expand Down Expand Up @@ -555,13 +593,27 @@
example: "2023-07-03"
maxLength: 10

CreatedAt:
type: string
format: date-time
maxLength: 64
description: Timestamp at which the Brand Registration has been created. It must follow [RFC 3339](https://datatracker.ietf.org/doc/html/rfc3339#section-5.6) and must have time zone.
example: "2018-04-05T17:31:00Z"

UpdatedAt:
type: string
format: date-time
maxLength: 64
description: Timestamp at which the Brand Registration has been last updated. It must follow [RFC 3339](https://datatracker.ietf.org/doc/html/rfc3339#section-5.6) and must have time zone.
example: "2018-04-05T17:31:00Z"

CustomerId:

Check notice on line 610 in code/API_definitions/brand-registration.yaml

View check run for this annotation

camara-validation / CAMARA Validation

String has no format/pattern/enum

[S-313] Schema of type string should specify a format, pattern, enum, or const. Suggestion: Acceptable if free-form field or implementation-dependent — no fix needed.
type: string
maxLength: 64
description: Unique customer identifier for a brand
example: "Customer1"

DisplayName:

Check notice on line 616 in code/API_definitions/brand-registration.yaml

View check run for this annotation

camara-validation / CAMARA Validation

String has no format/pattern/enum

[S-313] Schema of type string should specify a format, pattern, enum, or const. Suggestion: Acceptable if free-form field or implementation-dependent — no fix needed.
type: string
maxLength: 32
description: Brand information that will be displayed for the calling party
Expand Down Expand Up @@ -597,7 +649,7 @@
description: Country Code of the called number in E.164 format
example: 44

CampaignName:

Check notice on line 652 in code/API_definitions/brand-registration.yaml

View check run for this annotation

camara-validation / CAMARA Validation

String has no format/pattern/enum

[S-313] Schema of type string should specify a format, pattern, enum, or const. Suggestion: Acceptable if free-form field or implementation-dependent — no fix needed.
type: string
description: Logical name to group a set of calling party numbers under a brand for a specific purpose, e.g. special charging
example: "Company X New Year Sales"
Expand Down Expand Up @@ -690,6 +742,10 @@
$ref: '#/components/schemas/PhoneNumber'
status:
$ref: '#/components/schemas/Status'
createdAt:
$ref: '#/components/schemas/CreatedAt'
updatedAt:
$ref: '#/components/schemas/UpdatedAt'
expiresAt:
$ref: '#/components/schemas/ExpiresAt'
displayName:
Expand Down Expand Up @@ -735,29 +791,6 @@
pagination:
$ref: "../common/CAMARA_common.yaml#/components/schemas/Pagination"

ErrorInfo:
description: Common schema for errors
type: object
required:
- status
- code
- message
properties:
status:
type: integer
format: int32
minimum: 100
maximum: 599
description: HTTP status code returned along with this error response
code:
type: string
description: Code given to this error
maxLength: 96
message:
type: string
description: Detailed error description
maxLength: 512

BrandRegistrationEventType:
type: string
description: |
Expand Down Expand Up @@ -790,7 +823,7 @@
org.camaraproject.brand-registration.v0.quota-threshold-reached: '#/components/schemas/EventQuotathresholdReached'
org.camaraproject.brand-registration.v0.quota-exhausted: '#/components/schemas/EventQuotaExhausted'

EventCallBranded:

Check notice on line 826 in code/API_definitions/brand-registration.yaml

View check run for this annotation

camara-validation / CAMARA Validation

Component may be unused

[S-211] Potentially unused component has been detected. Suggestion: Spectral does not follow discriminator mappings — verify the schema is truly unused.
description: Event emitted when a call associated with a brand registration has been successfully branded.
allOf:
- $ref: '#/components/schemas/BrandRegistrationNotificationEvent'
Expand All @@ -799,7 +832,7 @@
data:
$ref: '#/components/schemas/CallBrandedEventData'

EventStatusChanged:

Check notice on line 835 in code/API_definitions/brand-registration.yaml

View check run for this annotation

camara-validation / CAMARA Validation

Component may be unused

[S-211] Potentially unused component has been detected. Suggestion: Spectral does not follow discriminator mappings — verify the schema is truly unused.
description: Event emitted when the status of a brand registration changes.
allOf:
- $ref: '#/components/schemas/BrandRegistrationNotificationEvent'
Expand All @@ -808,7 +841,7 @@
data:
$ref: '#/components/schemas/StatusChangedEventData'

EventQuotathresholdReached:

Check notice on line 844 in code/API_definitions/brand-registration.yaml

View check run for this annotation

camara-validation / CAMARA Validation

Component may be unused

[S-211] Potentially unused component has been detected. Suggestion: Spectral does not follow discriminator mappings — verify the schema is truly unused.
description: Event emitted when the quota threshold of branded calls has been reached.
allOf:
- $ref: '#/components/schemas/BrandRegistrationNotificationEvent'
Expand All @@ -817,7 +850,7 @@
data:
$ref: '#/components/schemas/QuotaThresholdReachedEventData'

EventQuotaExhausted:

Check notice on line 853 in code/API_definitions/brand-registration.yaml

View check run for this annotation

camara-validation / CAMARA Validation

Component may be unused

[S-211] Potentially unused component has been detected. Suggestion: Spectral does not follow discriminator mappings — verify the schema is truly unused.
description: Event emitted when the quota of branded calls has been exhausted.
allOf:
- $ref: '#/components/schemas/BrandRegistrationNotificationEvent'
Expand Down Expand Up @@ -899,7 +932,7 @@
quota:
$ref: '#/components/schemas/Quota'

Source:

Check notice on line 935 in code/API_definitions/brand-registration.yaml

View check run for this annotation

camara-validation / CAMARA Validation

Component may be unused

[S-211] Potentially unused component has been detected. Suggestion: Spectral does not follow discriminator mappings — verify the schema is truly unused.
type: string
format: uri-reference
minLength: 1
Expand Down Expand Up @@ -930,14 +963,14 @@
required:
- credentialType

AccessTokenCredential:

Check notice on line 966 in code/API_definitions/brand-registration.yaml

View check run for this annotation

camara-validation / CAMARA Validation

Component may be unused

[S-211] Potentially unused component has been detected. Suggestion: Spectral does not follow discriminator mappings — verify the schema is truly unused.
type: object
description: An access token credential. This type of credential is meant to be used by API Consumers that have limited capabilities to handle authorization requests.
allOf:
- $ref: '#/components/schemas/SinkCredential'
- type: object
properties:
accessToken:

Check notice on line 973 in code/API_definitions/brand-registration.yaml

View check run for this annotation

camara-validation / CAMARA Validation

String has no format/pattern/enum

[S-313] Schema of type string should specify a format, pattern, enum, or const. Suggestion: Acceptable if free-form field or implementation-dependent — no fix needed.
type: string
maxLength: 4096
description: REQUIRED. An access token granting access to the target resource.
Expand All @@ -959,7 +992,7 @@
- accessTokenExpiresUtc
- accessTokenType

PrivateKeyJWTCredential:

Check notice on line 995 in code/API_definitions/brand-registration.yaml

View check run for this annotation

camara-validation / CAMARA Validation

Component may be unused

[S-211] Potentially unused component has been detected. Suggestion: Spectral does not follow discriminator mappings — verify the schema is truly unused.
type: object
description: |
Use PRIVATE_KEY_JWT to obtain an access token. The authorization server information needed
Expand Down Expand Up @@ -1107,7 +1140,7 @@
perPage: 20
totalCount: 2
totalPages: 1
Generic400:

Check notice on line 1143 in code/API_definitions/brand-registration.yaml

View check run for this annotation

camara-validation / CAMARA Validation

Component may be unused

[S-211] Potentially unused component has been detected. Suggestion: Spectral does not follow discriminator mappings — verify the schema is truly unused.
description: Bad Request
headers:
x-correlator:
Expand All @@ -1116,7 +1149,7 @@
application/json:
schema:
allOf:
- $ref: "#/components/schemas/ErrorInfo"
- $ref: "../common/CAMARA_common.yaml#/components/schemas/ErrorInfo"
- type: object
properties:
status:
Expand Down Expand Up @@ -1175,7 +1208,7 @@
application/json:
schema:
allOf:
- $ref: "#/components/schemas/ErrorInfo"
- $ref: "../common/CAMARA_common.yaml#/components/schemas/ErrorInfo"
- type: object
properties:
status:
Expand Down Expand Up @@ -1209,7 +1242,7 @@
application/json:
schema:
allOf:
- $ref: "#/components/schemas/ErrorInfo"
- $ref: "../common/CAMARA_common.yaml#/components/schemas/ErrorInfo"
- type: object
properties:
status:
Expand Down Expand Up @@ -1251,7 +1284,7 @@
application/json:
schema:
allOf:
- $ref: "#/components/schemas/ErrorInfo"
- $ref: "../common/CAMARA_common.yaml#/components/schemas/ErrorInfo"
- type: object
properties:
status:
Expand Down Expand Up @@ -1300,7 +1333,7 @@
registrationId: "ea77c42f-fa5e-4612-cb43-d502ae794832"
status: "pending"

QUOTA_EXHAUSTED_EVENT:

Check notice on line 1336 in code/API_definitions/brand-registration.yaml

View check run for this annotation

camara-validation / CAMARA Validation

Component may be unused

[S-211] Potentially unused component has been detected. Suggestion: Spectral does not follow discriminator mappings — verify the schema is truly unused.
summary: Branded calls quota exhausted event
description: Notification emitted when branded calls quota has been exhausted.
value:
Expand All @@ -1314,7 +1347,7 @@
registrationId: "ea77c42f-fa5e-4612-cb43-d502ae794832"
quota: 100000

QUOTA_THRESHOLD_REACHED_EVENT:

Check notice on line 1350 in code/API_definitions/brand-registration.yaml

View check run for this annotation

camara-validation / CAMARA Validation

Component may be unused

[S-211] Potentially unused component has been detected. Suggestion: Spectral does not follow discriminator mappings — verify the schema is truly unused.
summary: Quota threshold of branded calls reached event
description: Notification emitted when quota threshold of branded calls has been reached.
value:
Expand Down
Loading