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
156 changes: 17 additions & 139 deletions code/API_definitions/brand-registration.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -84,21 +84,21 @@
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
- name: Create Brand Registration
description: Create Brand Registration Information for a Calling Party
- name: Update Brand registration
- name: Update Brand Registration
description: Update Existing Brand Registration Information for a Calling Party
- name: Read Brand registration
- name: Read Brand Registration
description: Read Existing Brand Registration Information for a Calling Party
- name: Delete Brand registration
- name: Delete Brand Registration
description: Delete Existing Brand Registration Information for a Calling Party
- name: Call branded notifications callback
- name: Call Branded Notifications Callback
description: Notifications callback invoked by the API provider when a call is successfully branded for a registration that opted in with `sink`.
paths:
/registrations:
post:
tags:
- Create Brand registration
- Create Brand Registration
summary: Register new brand information in the service platform
description: Register new brand information with optional call verification request.
operationId: createRegistration
Expand Down Expand Up @@ -177,7 +177,7 @@
"{$request.body#/sink}":
post:
tags:
- Call branded notifications callback
- Call Branded Notifications Callback
summary: Call branded notifications callback
description: |
Important: this endpoint is to be implemented by the API consumer.
Expand All @@ -197,6 +197,11 @@
$ref: '#/components/examples/CALL_BRANDED_EVENT'
BRAND_REGISTRATION_STATUS_EVENT:
$ref: '#/components/examples/BRAND_REGISTRATION_STATUS_EVENT'
QUOTA_EXHAUSTED_EVENT:
$ref: '#/components/examples/QUOTA_EXHAUSTED_EVENT'
QUOTA_THRESHOLD_REACHED_EVENT:
$ref: '#/components/examples/QUOTA_THRESHOLD_REACHED_EVENT'

responses:
'204':
description: Successful notification
Expand Down Expand Up @@ -244,7 +249,7 @@
- brand-registration:create
get:
tags:
- Read Brand registration
- Read Brand Registration
summary: Read existing brand registrations from the service platform
description: |
Read existing brand registrations from the service platform.
Expand Down Expand Up @@ -320,7 +325,7 @@
/registrations/{registrationId}:
get:
tags:
- Read Brand registration
- Read Brand Registration
summary: Read an existing brand registration from the service platform
description: Read an existing brand registration from the service platform
operationId: readRegistration
Expand All @@ -330,7 +335,7 @@
in: path
name: registrationId
required: true
schema:

Check notice on line 338 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 All @@ -356,7 +361,7 @@
- brand-registration:read
delete:
tags:
- Delete Brand registration
- Delete Brand Registration
summary: Delete an existing brand registration from the service platform
description: Delete an existing brand registration from the service platform
operationId: deleteRegistration
Expand All @@ -366,7 +371,7 @@
in: path
name: registrationId
required: true
schema:

Check notice on line 374 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 All @@ -392,7 +397,7 @@
- brand-registration:delete
put:
tags:
- Update Brand registration
- Update Brand Registration
summary: Update an existing brand registration in the service platform
description: Update an existing brand registration
operationId: updateRegistration
Expand All @@ -402,7 +407,7 @@
in: path
name: registrationId
required: true
schema:

Check notice on line 410 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 @@ -501,28 +506,28 @@
schema:
$ref: '#/components/schemas/Status'
CreatedAtBeforeFilter:
name: createdAt.lte

Check warning on line 509 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 516 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 523 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 530 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.
Expand Down Expand Up @@ -607,13 +612,13 @@
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 615 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 621 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 @@ -649,7 +654,7 @@
description: Country Code of the called number in E.164 format
example: 44

CampaignName:

Check notice on line 657 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 @@ -723,7 +728,7 @@
Omit this field (and `sinkCredential`) to create the registration without event notifications.
example: "https://endpoint.example.com/sink"
sinkCredential:
$ref: '#/components/schemas/SinkCredential'
$ref: '../common/CAMARA_event_common.yaml#/components/schemas/SinkCredential'

RegistrationRecord:
type: object
Expand Down Expand Up @@ -823,7 +828,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 831 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 @@ -832,7 +837,7 @@
data:
$ref: '#/components/schemas/CallBrandedEventData'

EventStatusChanged:

Check notice on line 840 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 @@ -841,7 +846,7 @@
data:
$ref: '#/components/schemas/StatusChangedEventData'

EventQuotathresholdReached:

Check notice on line 849 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 @@ -850,7 +855,7 @@
data:
$ref: '#/components/schemas/QuotaThresholdReachedEventData'

EventQuotaExhausted:

Check notice on line 858 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 @@ -932,75 +937,6 @@
quota:
$ref: '#/components/schemas/Quota'

Source:
type: string
format: uri-reference
minLength: 1
maxLength: 2048
description: |
Identifies the context in which the event happened. For Brand Registration
events, this MUST be the URL of the brand-registrations collection of the
API provider, in the format
`{apiRoot}/brand-registration/{version}/registrations`.
The specific `registrationId` the event pertains to is carried in `data.registrationId`.
example: "https://service-provider.com/brand-registration/v0/registrations"

SinkCredential:
type: object
description: A sink credential provides authentication or authorization information necessary to enable delivery of events to a target.
properties:
credentialType:
type: string
enum:
- ACCESSTOKEN
- PRIVATE_KEY_JWT
description: The type of the credential - MUST be set to ACCESSTOKEN or PRIVATE_KEY_JWT.
discriminator:
propertyName: credentialType
mapping:
ACCESSTOKEN: '#/components/schemas/AccessTokenCredential'
PRIVATE_KEY_JWT: '#/components/schemas/PrivateKeyJWTCredential'
required:
- credentialType

AccessTokenCredential:
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:
type: string
maxLength: 4096
description: REQUIRED. An access token granting access to the target resource.
accessTokenExpiresUtc:
type: string
format: date-time
maxLength: 64
description: |
REQUIRED. An absolute (UTC) timestamp at which the token shall be considered expired.
It must follow [RFC 3339](https://datatracker.ietf.org/doc/html/rfc3339#section-5.6) and must have a time zone.
example: "2026-07-03T12:27:08.312Z"
accessTokenType:
type: string
enum:
- bearer
description: REQUIRED. Type of the access token (See [OAuth 2.0](https://tools.ietf.org/html/rfc6749#section-7.1)).
required:
- accessToken
- accessTokenExpiresUtc
- accessTokenType

PrivateKeyJWTCredential:
type: object
description: |
Use PRIVATE_KEY_JWT to obtain an access token. The authorization server information needed
for this type of sink credential (token endpoint, client ID, JWKS URL) is shared upfront
between the client and the CAMARA entity.
allOf:
- $ref: '#/components/schemas/SinkCredential'

responses:
SuccessfulRecord:
description: Success response with a brand registration record
Expand Down Expand Up @@ -1140,64 +1076,6 @@
perPage: 20
totalCount: 2
totalPages: 1
Generic400:
description: Bad Request
headers:
x-correlator:
$ref: "../common/CAMARA_common.yaml#/components/headers/x-correlator"
content:
application/json:
schema:
allOf:
- $ref: "../common/CAMARA_common.yaml#/components/schemas/ErrorInfo"
- type: object
properties:
status:
enum:
- 400
code:
enum:
- INVALID_ARGUMENT
- INVALID_PROTOCOL
- INVALID_CREDENTIAL
- INVALID_TOKEN
- INVALID_SINK
examples:
GENERIC_400_INVALID_ARGUMENT:
summary: Invalid argument
description: Invalid Argument. Generic Syntax Exception
value:
status: 400
code: INVALID_ARGUMENT
message: Client specified an invalid argument, request body or query param.
GENERIC_400_INVALID_PROTOCOL:
summary: Invalid protocol
description: Invalid protocol for event notifications
value:
status: 400
code: INVALID_PROTOCOL
message: Only HTTPS is supported for notification delivery.
GENERIC_400_INVALID_CREDENTIAL:
summary: Invalid credential
description: Invalid sink credential type
value:
status: 400
code: INVALID_CREDENTIAL
message: Only ACCESSTOKEN or PRIVATE_KEY_JWT credential types are supported.
GENERIC_400_INVALID_TOKEN:
summary: Invalid token
description: The access token provided in sinkCredential is invalid
value:
status: 400
code: INVALID_TOKEN
message: The access token provided in sinkCredential is not valid.
GENERIC_400_INVALID_SINK:
summary: Invalid sink
description: The sink URL is invalid for the specified protocol
value:
status: 400
code: INVALID_SINK
message: The sink URL is not valid for the specified protocol.

Create404:
description: Not found
Expand Down
Loading