-
Notifications
You must be signed in to change notification settings - Fork 16
Expand file tree
/
Copy pathOVS_HUB_NTF_v1.0.0.yaml
More file actions
1426 lines (1294 loc) · 67.4 KB
/
OVS_HUB_NTF_v1.0.0.yaml
File metadata and controls
1426 lines (1294 loc) · 67.4 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
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
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
openapi: 3.0.3
info:
version: 1.0.0
title: OVS Hub Notification and Subscriptions
description: |
<h1>DCSA OVS Hub OpenAPI Specification for notifications and subscriptions</h1>
Notifications for DCSA OVS Hub OpenAPI subscriptions are lightweight notifications based on [CloudEvents](https://cloudevents.io/). The `POST` endpoint of the consumer is called whenever a `Service`, `Vessel` or `Location` that is being subscribed to changes state or is updated.
It is also possible to set up subscriptions. A subscription can be set up to push events to a callbackUrl defined as part of the subscription or by an email. It is not possible to define the email as part of the subscription - the email used is the email address associated with the authenticated user.
Subscriptions support sending notifications for all changes the customer is authorized to see. It is possible to only send notifications for specific events - in order to do so - filters must be used when setting up a subscription. See the [subscription](https://app.swaggerhub.com/apis/dcsaorg/DCSA_OVS_NTF/1.0.0#/Subscription) section for more info.
contact:
name: Digital Container Shipping Association (DCSA)
url: 'https://dcsa.org'
email: info@dcsa.org
tags:
- name: Notification
description: |
Endpoint implemented by the receiver of the Notifications (Terminals, Carriers, etc)
- name: Subscription
description: |
Endpoints implemented by the OVS Hub for the customer to set up subscriptions
- name: Secret
description: |
Endpoint implemented by the OVS Hub for the customer to update the secret
paths:
'/{callbackUrl}':
post:
tags:
- Notification
summary: Send notification
operationId: post-notification
description: |
Creates a new `Notification`. This endpoint is called whenever a `Service`, `Vessel` or `Location` that a consumer has subscribed to is updated. The `callbackUrl` is defined as part of the subscription.
**👉 Important:** This endpoint is to be implemented by a **consumer** of the **OVS Hub API** in order to **receive Notifications**.
parameters:
- name: callbackUrl
in: path
required: true
description: |
The endpoint specifying where OVS Hub sends the notification to the customer. The callback can contain customer defined query parameters.
The `callbackUrl` **MUST** be an open endpoint for OVS Hub to call when sending a notification. OVS Hub does not send any authentication information apart from what is in the `callbackUrl`. The receiver **MUST** validate the authenticity of the notification by looking at the `Notification-Signature` header.
schema:
type: string
format: uri
example: https://myserver.com/send/callback/here?myInternalId=123
- name: Request-Id
in: header
required: true
description: |
The `Request-Id` which is included in the encoded `Notification-Signature`.
When receiving a notification the receiver **MUST** validate the "uniqueness" of the `Request-Id`. If a notification has already been sent with the `Request-Id` then the request **MUST** be rejected.
**Note:** It is not necessary to store the `Request-Id` for more than 5 minutes as all other cases are covered by the `Signature-Timestamp` header
schema:
type: string
format: ulid
example: 01KKH4JGKBPT6J9VJX1WXKWPGK
- name: Signature-Timestamp
in: header
required: true
description: |
The `Signature-Timestamp` which is included in the encoded `Notification-Signature`.
When receiving a notification the receiver **MUST** validate the "freshness" of the timestamp. If it is older than 5 minutes, or too far in the future, it **MUST** be rejected.
abs(now_utc - timestamp_utc) <= 300 seconds
**Note:** This value is to be used when calculating the `Notification-Signature` on the receiver side.
schema:
type: string
format: date-time
example: 2025-01-23T01:23:45Z
- name: Notification-Signature
in: header
required: true
description: |
The `Notification-Signature` is used to more confidently verify whether requests from OVS Hub are authentic. The header has the following format:
Notification-Signature: sha256=<signature>
When OVS Hub sends a notification, the notification **MUST** be checked to make sure it's authentic. This is done by computing a signature.
The `signature` is calculated by calculating a **HMAC_SHA256** using the `secret` (defined when setting up a subscription) on the `Signature-Timestamp` header (*unredacted*) concatenated with a dot (`.`) concatenated with the `Request-Id` header concatenated with a dot (`.`) concatenated with the `request body`
signature = HMAC_SHA256(secret, Signature-Timestamp + "." + Request-Id + "." + request-body)
The signature **MUST** cover the entire request body of the request. Before the signature is created the request body **MUST** be in the [RFC 8785](https://datatracker.ietf.org/doc/html/rfc8785) canonical form. The content **MUST** be decoded into bytes using the UTF-8 encoding before computing the signature.
**Note:** None of the HTTP headers nor the request URL is covered by the signature.
## Example
A concrete example of how the `Notification-Signature` header could look like for:
* `secret`: OWY4YzdhNGQ=
* `Signature-Timestamp`: March 12, 2026 at 14:47:00Z
* `Request-Id`: 01KKH4JGKBPT6J9VJX1WXKWPGK
* `request-body`: {"lastName":"Doe" , "firstName":"John", "age":40}
would be:
signature = HMAC_SHA256(Base64Decode(OWY4YzdhNGQ=), '2026-03-12T14:47:00Z.01KKH4JGKBPT6J9VJX1WXKWPGK.{"age":40,"firstName":"John","lastName":"Doe"}')
The `Notification-Signature` header would then look like this:
Notification-Signature: sha256=8d3a7837713e319d1466139903ffd5b1b8d96f6a769f6d53c03a29dc5c3f3630
schema:
type: string
pattern: ^sha256=[A-Fa-f0-9]{64}$
maxLength: 71
minLength: 71
example: sha256=8d3a7837713e319d1466139903ffd5b1b8d96f6a769f6d53c03a29dc5c3f3630
- $ref: '#/components/parameters/Api-Version-Major'
requestBody:
description: |
Enough information for a recipient to evaluate if more information should be fetched.
content:
application/json:
schema:
$ref: '#/components/schemas/Notification'
responses:
'204':
description: No Content
headers:
API-Version:
$ref: '#/components/headers/API-Version'
/subscriptions:
get:
tags:
- Subscription
summary: Receive a list of your active subscriptions
operationId: get-all-subscriptions
description: |
Get a list of all subscriptions.
parameters:
- name: limit
in: query
description: |
Maximum number of `Subscriptions` to include in each page of the response.
example: 5
schema:
type: integer
format: int32
default: 10
example: 10
minimum: 1
- name: offset
in: query
example: 0
description: |
The (zero-based) offset of the first item returned in the collection. In zero-based indexing, 0 is a valid value.
schema:
type: integer
format: int32
default: 0
example: 10
minimum: 0
- $ref: '#/components/parameters/Api-Version-Major'
responses:
'200':
description: |
Returns a list of subscriptions you are authorized to see.
headers:
API-Version:
$ref: '#/components/headers/API-Version'
content:
application/json:
schema:
type: array
items:
$ref: '#/components/schemas/Subscription'
default:
description: |
For other errors the error object should be populated with relevant information
headers:
API-Version:
$ref: '#/components/headers/API-Version'
content:
application/json:
schema:
$ref: '#/components/schemas/ErrorResponse'
examples:
tooManyRequestsExample:
summary: |
Making too many Subscription Requests
description: |
Calling the endpoint
GET /subscriptions
too many times within a time period.
value:
httpMethod: GET
requestUri: /subscriptions
statusCode: 429
statusCodeText: Too Many Requests
statusCodeMessage: |
Too many requests to fetch subscriptions have been made. Please try again in 1 hour
providerCorrelationReference: 4426d965-0dd8-4005-8c63-dc68b01c4962
errorDateTime: '2026-03-01T09:41:00Z'
errors:
- errorCodeText: Max number of subscription requests reached
errorCodeMessage: A maximum of 10 subscription requests can be fetched per hour
post:
tags:
- Subscription
summary: Create a subscription
operationId: post-subscription
description: |
Creates a new subscription. This endpoint specifies when a Notification is sent. It is possible to specify on multiple levels:
- **Service**: it is possible to only be notified when something in a specific Service changes
- **Vessel IMO**: it is possible to only be notified when something related to a specific Vessel changes
- **Location**: it is possible to only be notified when something related to a specific Location changes
It is possible to specify the above groups as **filters**. If nothing is specified for: `Service`, `Vessel` or `Location` then anything you are authorized to see will be sent to you.
If `callbackUrl` is specified, when setting up a subscription, the notification will be pushed to the
POST {{callbackUrl}}
endpoint of the consumer. If `callbackUrl` is omitted as part of the subscription, a notification will be sent via email to the authenticated user. Email is defined as part of the user-profile.
When a notification is sent, it is the responsibility of the consumer to go to OVS Hub, either via the API or the UI, to get more information.
parameters:
- $ref: '#/components/parameters/Api-Version-Major'
requestBody:
description: |
The parameters used to configure the subscription and send notifications.
All values in the subscription (except: `callbackUrl` and `secret`) will be used as filters when sending notifications. All specified filters must be met in order for a notification to be sent. A logical **AND** is used between filters. So specifying
carrierServiceCodes = 'FE1'
AND
vesselIMONumbers = '12345678'
means that the notifications sent for this subscription **MUST** be for service `FE1` (*carrierServiceCode='FE1'*) **and** vessel IMO `12345678` (*vesselIMONumber='12345678'*). If all filters are not fulfilled - then the notification will not be sent.
Filters that are specified as lists use logical **OR** between list values. So
carrierServiceCodes = ['FE1','DR02']
means that notifications sent will match **either** `FE1` **OR** `DR02` carrierServiceCodes.
required: true
content:
application/json:
schema:
$ref: '#/components/schemas/SubscriptionBodyWithSecret'
examples:
callbackExample:
summary: |
Subscription using callback for Vessel changes
description: |
A subscription setup using the `callbackUrl` in order for notifications to be sent to:
POST https://api.myserver.com/notifications?myId=123
The notification is only triggered when changes occur to `vesselIMONumber`: 9321483 or 9929429 that occur maximum 1 week in the future (`weekRange` = 1)
value:
notificationChannel:
callbackUrl: https://api.myserver.com/notifications?myId=123
secret: MTIzNDU2Nzg5MDEyMzQ1Njc4OTAxMjM0NTY3ODkwMTIzNDM2NTc4NjIzODk3NDY5MDgyNzM0OTg3MTIzNzg2NA==
weekRange: 1
vesselIMONumbers:
- '9321483'
- '9929429'
emailAllExample:
summary: |
Subscription using emails to be notified about everything
description: |
A subscription setup using the email channel to be notified about all authorized changes occurring within 6 weeks in the future.
value:
notificationChannel:
useEmail: true
weekRange: 6
emailServiceExample:
summary: |
Subscription using emails to be notified about Service changes
description: |
A subscription setup using the email channel to be notified about changes to `carrierServiceCodes`: FE1 and DR001.
value:
notificationChannel:
useEmail: true
carrierServiceCodes:
- FE1
- DR001
weekRange: 3
responses:
'201':
description: Subscription created
headers:
API-Version:
schema:
type: string
example: 1.0.0
description: |
SemVer used to indicate the version of the contract (API version) returned.
content:
application/json:
schema:
$ref: '#/components/schemas/Subscription'
default:
description: |
For other errors the error object should be populated with relevant information
headers:
API-Version:
$ref: '#/components/headers/API-Version'
content:
application/json:
schema:
$ref: '#/components/schemas/ErrorResponse'
examples:
tooManyRequestsExample:
summary: |
Making too many Subscription Requests
description: |
Calling the endpoint
POST /subscriptions
too many times within a time period.
**NB**: `errorCode` not yet standardized by DCSA. Value `7003` is just a "random example"
value:
httpMethod: POST
requestUri: /subscriptions
statusCode: 429
statusCodeText: Too Many Requests
statusCodeMessage: |
Too many requests to create a subscription have been made. Please try again in 1 hour
providerCorrelationReference: 4426d965-0dd8-4005-8c63-dc68b01c4962
errorDateTime: '2026-03-01T09:41:00Z'
errors:
- errorCode: 7003
errorCodeText: Max number of subscriptions created
errorCodeMessage: A maximum of 10 subscriptions can be created per hour
/subscriptions/{subscriptionReference}:
get:
tags:
- Subscription
summary: Find a subscription by subscription reference
operationId: get-subscription
description: |
Get the subscription matching `subscriptionReference`.
parameters:
- name: subscriptionReference
in: path
required: true
description: |
Fetches the subscription matching the `subscriptionReference` provided.
example: 01KJZDQ1CC6HQYP8V2NE2MPRNC
schema:
type: string
format: ulid
maxLength: 26
- $ref: '#/components/parameters/Api-Version-Major'
responses:
'200':
description: Subscription returned
headers:
API-Version:
$ref: '#/components/headers/API-Version'
content:
application/json:
schema:
$ref: '#/components/schemas/Subscription'
default:
description: |
For other errors the error object should be populated with relevant information
headers:
API-Version:
$ref: '#/components/headers/API-Version'
content:
application/json:
schema:
$ref: '#/components/schemas/ErrorResponse'
examples:
tooManyRequestsExample:
summary: |
Making too many Subscription Requests
description: |
Calling the endpoint
GET /subscriptions/{subscriptionReference}
too many times within a time period.
**NB**: `errorCode` not yet standardized by DCSA. Value `7003` is just a "random example"
value:
httpMethod: GET
requestUri: /subscriptions/{subscriptionReference}
statusCode: 429
statusCodeText: Too Many Requests
statusCodeMessage: |
Too many requests to fetch subscription with subscriptionReference: {subscriptionReference} have been made. Please try again in 1 hour
providerCorrelationReference: 4426d965-0dd8-4005-8c63-dc68b01c4962
errorDateTime: '2026-03-01T09:41:00Z'
errors:
- errorCode: 7003
errorCodeText: Maximum number of subscription requests
errorCodeMessage: A maximum of 10 subscription requests can be made per hour
delete:
tags:
- Subscription
summary: Stop a subscription by subscription reference
operationId: delete-subscription
description: |
Deletes the subscription with `subscriptionReference`.
parameters:
- name: subscriptionReference
in: path
required: true
description: |
Fetches the subscription matching the `subscriptionReference` provided.
example: 01KJZDQ1CC6HQYP8V2NE2MPRNC
schema:
type: string
format: ulid
maxLength: 26
- $ref: '#/components/parameters/Api-Version-Major'
responses:
'204':
description: Subscription stopped
headers:
API-Version:
$ref: '#/components/headers/API-Version'
default:
description: |
For other errors the error object should be populated with relevant information
headers:
API-Version:
$ref: '#/components/headers/API-Version'
content:
application/json:
schema:
$ref: '#/components/schemas/ErrorResponse'
examples:
tooManyRequestsExample:
summary: |
Making too many Subscription Requests
description: |
Calling the endpoint
DELETE /subscriptions/{subscriptionReference}
too many times within a time period.
**NB**: `errorCode` not yet standardized by DCSA. Value `7003` is just a "random example"
value:
httpMethod: DELETE
requestUri: /subscriptions/{subscriptionReference}
statusCode: 429
statusCodeText: Too Many Requests
statusCodeMessage: |
Too many requests to delete subscription with subscriptionReference: {subscriptionReference} have been made. Please try again in 1 hour
providerCorrelationReference: 4426d965-0dd8-4005-8c63-dc68b01c4962
errorDateTime: '2026-03-01T09:41:00Z'
errors:
- errorCode: 7003
errorCodeText: Maximum number of subscription requests
errorCodeMessage: A maximum of 10 subscription delete requests can be made per hour
put:
tags:
- Subscription
summary: Update a subscription by subscription reference
operationId: put-subscription
description: |
Updates the subscription with `subscriptionReference`.
parameters:
- name: subscriptionReference
in: path
required: true
description: |
Fetches the subscription matching the `subscriptionReference` provided.
example: 01KJZDQ1CC6HQYP8V2NE2MPRNC
schema:
type: string
format: ulid
maxLength: 26
- $ref: '#/components/parameters/Api-Version-Major'
requestBody:
description: Parameters used to configure the subscription
required: true
content:
application/json:
schema:
$ref: '#/components/schemas/Subscription'
responses:
'200':
description: Subscription updated
headers:
API-Version:
$ref: '#/components/headers/API-Version'
content:
application/json:
schema:
$ref: '#/components/schemas/Subscription'
default:
description: |
For other errors the error object should be populated with relevant information
headers:
API-Version:
$ref: '#/components/headers/API-Version'
content:
application/json:
schema:
$ref: '#/components/schemas/ErrorResponse'
examples:
tooManyRequestsExample:
summary: |
Making too many Subscription Requests
description: |
Calling the endpoint
PUT /subscriptions/{subscriptionReference}
too many times within a time period.
**NB**: `errorCode` not yet standardized by DCSA. Value `7003` is just a "random example"
value:
httpMethod: PUT
requestUri: /subscriptions/{subscriptionReference}
statusCode: 429
statusCodeText: Too Many Requests
statusCodeMessage: |
Too many requests to update subscription with subscriptionReference: {subscriptionReference} have been made. Please try again in 1 hour
providerCorrelationReference: 4426d965-0dd8-4005-8c63-dc68b01c4962
errorDateTime: '2026-03-01T09:41:00Z'
errors:
- errorCode: 7003
errorCodeText: Maximum number of subscription requests
errorCodeMessage: A maximum of 10 subscription update requests can be made per hour
/subscriptions/{subscriptionReference}/secret:
put:
tags:
- Secret
summary: Resets the Secret on an existing subscription
operationId: put-secret
description: |
Updates the secret of subscription with `subscriptionReference`.
parameters:
- name: subscriptionReference
in: path
required: true
description: |
Updates the subscription matching the `subscriptionReference` provided.
example: 01KJZDQ1CC6HQYP8V2NE2MPRNC
schema:
type: string
format: ulid
maxLength: 26
- $ref: '#/components/parameters/Api-Version-Major'
requestBody:
description: Parameters used to configure the subscription
required: true
content:
application/json:
schema:
type: object
properties:
secret:
type: string
format: byte
description: |
A Base64 encoded secret sent to the OVS Hub from the customer.
It is used to compute the contents of the `Notification-Signature` header every time a notification is sent.
example: 'MTIzNDU2Nzg5MDEyMzQ1Njc4OTAxMjM0NTY3ODkwMTIzNDM2NTc4NjIzODk3NDY5MDgyNzM0OTg3MTIzNzg2NA=='
responses:
'204':
description: Secret updated
headers:
API-Version:
$ref: '#/components/headers/API-Version'
default:
description: |
For other errors the error object should be populated with relevant information
headers:
API-Version:
$ref: '#/components/headers/API-Version'
content:
application/json:
schema:
$ref: '#/components/schemas/ErrorResponse'
examples:
tooManyRequestsExample:
summary: |
Making too many Subscription Secret Requests
description: |
Calling the endpoint
PUT /subscriptions/{subscriptionReference}/secret
too many times within a time period.
**NB**: `errorCode` not yet standardized by DCSA. Value `7003` is just a "random example"
value:
httpMethod: PUT
requestUri: /subscriptions/{subscriptionReference}/secret
statusCode: 429
statusCodeText: Too Many Requests
statusCodeMessage: |
Too many requests to update subscription secret with subscriptionReference: {subscriptionReference} have been made. Please try again in 1 hour
providerCorrelationReference: 4426d965-0dd8-4005-8c63-dc68b01c4962
errorDateTime: '2026-03-01T09:41:00Z'
errors:
- errorCode: 7003
errorCodeText: Max number of subscriptions secret requests
errorCodeMessage: A maximum of 10 subscription secret update requests can be made per hour
components:
headers:
API-Version:
schema:
type: string
example: 1.0.0
description: |
SemVer used to indicate the version of the contract (API version) returned.
parameters:
Api-Version-Major:
name: API-Version
in: header
required: true
description: |
An API-Version header **MUST** be provided to the request (mandatory). The header **MUST** be a [SemVer](https://semver.org/) specifying the provider (the calling party) API version.
The purpose of this is for OVS Hub to know which version of the API the caller is on.
schema:
type: string
example: 1.0.0
schemas:
Subscription:
type: object
title: Subscription
description: |
...
properties:
subscriptionReference:
type: string
format: ulid
maxLength: 26
description: |
The OVS Hub assigned unique reference to the subscription.
example: 01KJZDQ1CC6HQYP8V2NE2MPRNC
notificationChannel:
type: object
description: |
Defines the channel where a matched notification is sent. At least one of the possible properties **MUST** be provided:
- `callbackUrl`
- `useEmail`
properties:
callbackUrl:
type: string
format: uri
description: |
The endpoint where OVS Hub should send the notification to the customer. The callback can contain query parameters uniquely identifying the originator of the events.
The `callbackUrl` **MUST** be an open endpoint for OVS Hub to call when sending a notification. The receiver **MUST** validate the authenticity of the notification by looking at the `Notification-Signature` header.
**Condition:** If `callbackUrl` is provided, the `secret` property must also be provided. It can be updated via the [update-secret](https://app.swaggerhub.com/apis/dcsaorg/DCSA_OVS_NTF/1.0.0#/Secret/put-secret) endpoint.
example: https://myserver.com/send/callback/here?shipperRef=myID123
useEmail:
type: boolean
description: |
If `true` a possible notification match will be sent to the email address of the user who has created the subscription.
example: true
weekRange:
type: integer
format: int32
description: |
Number of weeks into the future for which this subscription will send notifications. If the number is `4` it means that any changes further in the future than 4 weeks from now will **not** be sent.
example: 4
carrierServiceCodes:
type: array
description: |
An array of **carrier-specific codes** to match with this subscription filter. If the array consists of more than one item - a logical **OR** is used between the values when matching.
If this property is empty, you will be notified for all `carrierServiceCodes` that have changes you are authorized to see.
items:
type: string
pattern: ^\S(?:.*\S)?$
maxLength: 11
description: |
The carrier-specific code of the service for which the schedule details are published.
example: FE1
example:
- FE1
- DR01
universalServiceReferences:
type: array
description: |
An array of **universal service references** to match with this subscription filter. If the array consists of more than one item - a logical **OR** is used between the values when matching.
If this property is empty, you will be notified for all `universalServiceReferences` that have changes you are authorized to see.
items:
type: string
pattern: ^SR\d{5}[A-Z]$
maxLength: 8
minLength: 8
example: SR12345A
example:
- SR12345A
- SR33322T
- SR03732R
carrierSMDGCodes:
type: array
description: |
An array of **carrier SMDG codes** to match with this subscription filter. If the array consists of more than one item - a logical **OR** is used between the values when matching.
If this property is empty, you will be notified for all `carrierSMDGCodes` that have changes you are authorized to see.
items:
type: string
maxLength: 10
description: |
The carrier code based on SMDG Liner Code List.
example: MSK
example:
- MSK
- EMC
vesselNames:
type: array
description: |
An array of **vessel names** to match with this subscription filter. If the array consists of more than one item - a logical **OR** is used between the values when matching.
If this property is empty, you will be notified for all `vesselNames` that have changes you are authorized to see.
items:
type: string
maxLength: 35
description: |
The name of the Vessel given by the Vessel Operator and registered with IMO.
**Note:** In case the vessel is a "dummy vessel" (`isDummyVessel='true'`) then the following recommendations should be followed:
Dummy vessel names should begin with the **SMDG Operating Carrier Code** to ensure uniqueness across carriers.
The suffix can be **alphanumeric** and up to **10 characters long**, allowing each carrier to use internal naming conventions (e.g., `MSKTBN1`, `CMATEMP01`, `MSCX01A`).
This approach:
- Ensures consistency and uniqueness across carriers
- Allows flexibility in local implementations
- Avoids the need to assign dummy IMO numbers
- Maintains the role of the dummy vessel name as a **stable and persistent identifier** throughout the planning process
example: King of the Seas
example:
- King of the Seas
- Express 001
vesselIMONumbers:
type: array
description: |
An array of **vessel IMO numbers** to match with this subscription filter. If the array consists of more than one item - a logical **OR** is used between the values when matching.
If this property is empty, you will be notified for all `vesselIMONumbers` that have changes you are authorized to see.
items:
type: string
pattern: ^\d{7,8}$
minLength: 7
maxLength: 8
description: |
The unique reference for a registered Vessel. The reference is the International Maritime Organisation (IMO) number, also sometimes known as the Lloyd's register code, which does not change during the lifetime of the vessel
**Condition:** If `isDummyVessel` is `false` - at least one of `vesselIMONumber` or `MMSINumber` **MUST** be specified in order to identify the `Vessel`. It is also acceptable to provide both properties. If `isDummyVessel` is `true` it is optional to provide this property.
example: '9321483'
example:
- '9321483'
- '12345678'
MMSINumbers:
type: array
description: |
An array of **MMSI numbers** to match with this subscription filter. If the array consists of more than one item - a logical **OR** is used between the values when matching.
If this property is empty, you will be notified for all `MMSINumbers` that have changes you are authorized to see.
items:
type: string
pattern: ^\d{9}$
minLength: 9
maxLength: 9
description: |
Maritime Mobile Service Identities (MMSIs) are nine-digit numbers used by maritime digital selective calling (DSC), automatic identification systems (AIS) and certain other equipment to uniquely identify a ship or a coast radio station.
**Condition:** If `isDummyVessel` is `false` - at least one of `vesselIMONumber` or `MMSINumber` **MUST** be specified in order to identify the `Vessel`. It is also acceptable to provide both properties. If `isDummyVessel` is `true` it is optional to provide this property.
example: '278111222'
example:
- '278111222'
- '278173294'
- '234422543'
locations:
type: array
minItems: 1
description: |
An array of **UNLocationCode and/or facilitySMDGCode combinations** to match with this subscription filter. If the array consists of more than one item - a logical **OR** is used between the objects when matching.
If this property is empty, you will be notified for all `locations` that have changes you are authorized to see.
items:
type: object
description: |
It is possible to provide the `UNLocationCode`, the `facilitySMDGCode` or both when specifying the location.
If multiple `UNLocationCode` or `facilitySMDGCode` values need to be provided, then they must be specified as separate objects in the `locations` array.
**Condition:** At least one of `UNLocationCode` and/or `facilitySMDGCode` **MUST** be specified, both are also allowed.
properties:
UNLocationCode:
type: string
pattern: ^[A-Z]{2}[A-Z2-9]{3}$
minLength: 5
maxLength: 5
description: |
The UN Location code specifying where the place is located. The pattern used must be
- 2 characters for the country code using [ISO 3166-1 alpha-2](https://www.iso.org/obp/ui/#iso:pub:PUB500001:en)
- 3 characters to code a location within that country. Letters A-Z and numbers from 2-9 can be used
More info can be found here: [UN/LOCODE](https://unece.org/trade/cefact/UNLOCODE-Download)
example: NLAMS
facilitySMDGCode:
type: string
maxLength: 6
description: |
The code used for identifying the specific facility. This code does not include the UN Location Code.
The codeList used by SMDG is the [SMDG Terminal Code List](https://smdg.org/wp-content/uploads/Codelists/Terminals/SMDG-Terminal-Code-List-v20210401.xlsx)
example: ACT
example:
- UNLocationCode: NLAMS
facilitySMDGCode: APMT
- UNLocationCode: DEHAM
- facilitySMDGCode: APMT
required:
- subscriptionReference
- notificationChannel
- weekRange
SubscriptionBodyWithSecret:
type: object
title: Subscription with Secret
description: |
...
properties:
notificationChannel:
type: object
title: Notification Channel
description: |
Defines the channel where a matched notification is sent. At least one of the possible properties **MUST** be provided:
- `callbackUrl` and `secret`
- `useEmail`
properties:
callbackUrl:
type: string
format: uri
description: |
The endpoint where OVS Hub should send the notification to the customer. The callback can contain query parameters uniquely identifying the originator of the events.
The `callbackUrl` **MUST** be an open endpoint for OVS Hub to call when sending a notification. The receiver **MUST** validate the authenticity of the notification by looking at the `Notification-Signature` header.
**Condition:** If `callbackUrl` is provided then `secret` property is mandatory to provide also.
example: https://myserver.com/send/callback/here?shipperRef=myID123
secret:
type: string
format: byte
maxLength: 1024
description: |
A Base64 encoded secret sent to the OVS Hub from the customer.
It is used to compute the contents of the `Notification-Signature` header every time a notification is sent.
**Condition:** If `callbackUrl` is provided then this property is mandatory to provide.
example: 'MTIzNDU2Nzg5MDEyMzQ1Njc4OTAxMjM0NTY3ODkwMTIzNDM2NTc4NjIzODk3NDY5MDgyNzM0OTg3MTIzNzg2NA=='
useEmail:
type: boolean
description: |
If `true` a possible notification match will be sent to the email address of the user who has created the subscription.
example: true
weekRange:
type: integer
format: int32
description: |
Number of weeks into the future for which this subscription will send notifications. If the number is `4` it means that any changes further in the future than 4 weeks from now will **not** be sent.
example: 4
carrierServiceCodes:
type: array
description: |
An array of **carrier-specific codes** to match with this subscription filter. If the array consists of more than one item - a logical **OR** is used between the values when matching.
If this property is empty, you will be notified for all `carrierServiceCodes` that have changes you are authorized to see.
items:
type: string
pattern: ^\S(?:.*\S)?$
maxLength: 11
description: |
The carrier-specific code of the service for which the schedule details are published.
example: FE1
example:
- FE1
- DR01
universalServiceReferences:
type: array
description: |
An array of **universal service references** to match with this subscription filter. If the array consists of more than one item - a logical **OR** is used between the values when matching.
If this property is empty, you will be notified for all `universalServiceReferences` that have changes you are authorized to see.
items:
type: string
pattern: ^SR\d{5}[A-Z]$
maxLength: 8
minLength: 8
example: SR12345A
example:
- SR12345A
- SR33322T
- SR03732R
carrierSMDGCodes:
type: array
description: |
An array of **carrier SMDG codes** to match with this subscription filter. If the array consists of more than one item - a logical **OR** is used between the values when matching.
If this property is empty, you will be notified for all `carrierSMDGCodes` that have changes you are authorized to see.
items:
type: string
maxLength: 10
description: |
The carrier code based on SMDG Liner Code List.
example: MSK
example:
- MSK
- EMC
vesselNames:
type: array
description: |
An array of **vessel names** to match with this subscription filter. If the array consists of more than one item - a logical **OR** is used between the values when matching.
If this property is empty, you will be notified for all `vesselNames` that have changes you are authorized to see.
items:
type: string
maxLength: 35
description: |
The name of the Vessel given by the Vessel Operator and registered with IMO.
**Note:** In case the vessel is a "dummy vessel" (`isDummyVessel='true'`) then the following recommendations should be followed:
Dummy vessel names should begin with the **SMDG Operating Carrier Code** to ensure uniqueness across carriers.
The suffix can be **alphanumeric** and up to **10 characters long**, allowing each carrier to use internal naming conventions (e.g., `MSKTBN1`, `CMATEMP01`, `MSCX01A`).
This approach:
- Ensures consistency and uniqueness across carriers
- Allows flexibility in local implementations
- Avoids the need to assign dummy IMO numbers
- Maintains the role of the dummy vessel name as a **stable and persistent identifier** throughout the planning process
example: King of the Seas
example:
- King of the Seas
- Express 001
vesselIMONumbers:
type: array
description: |
An array of **vessel IMO numbers** to match with this subscription filter. If the array consists of more than one item - a logical **OR** is used between the values when matching.
If this property is empty, you will be notified for all `vesselIMONumbers` that have changes you are authorized to see.
items:
type: string
pattern: ^\d{7,8}$
minLength: 7
maxLength: 8
description: |
The unique reference for a registered Vessel. The reference is the International Maritime Organisation (IMO) number, also sometimes known as the Lloyd's register code, which does not change during the lifetime of the vessel
**Condition:** If `isDummyVessel` is `false` - at least one of `vesselIMONumber` or `MMSINumber` **MUST** be specified in order to identify the `Vessel`. It is also acceptable to provide both properties. If `isDummyVessel` is `true` it is optional to provide this property.
example: '9321483'
example:
- '9321483'
- '12345678'
MMSINumbers:
type: array
description: |
An array of **MMSI numbers** to match with this subscription filter. If the array consists of more than one item - a logical **OR** is used between the values when matching.
If this property is empty, you will be notified for all `MMSINumbers` that have changes you are authorized to see.
items:
type: string
pattern: ^\d{9}$
minLength: 9
maxLength: 9
description: |
Maritime Mobile Service Identities (MMSIs) are nine-digit numbers used by maritime digital selective calling (DSC), automatic identification systems (AIS) and certain other equipment to uniquely identify a ship or a coast radio station.
**Condition:** If `isDummyVessel` is `false` - at least one of `vesselIMONumber` or `MMSINumber` **MUST** be specified in order to identify the `Vessel`. It is also acceptable to provide both properties. If `isDummyVessel` is `true` it is optional to provide this property.
example: '278111222'
example:
- '278111222'
- '278173294'
- '234422543'
locations:
type: array
description: |
An array of **UNLocationCode and/or facilitySMDGCode combinations** to match with this subscription filter. If the array consists of more than one item - a logical **OR** is used between the objects when matching.
If this property is empty, you will be notified for all `locations` that have changes you are authorized to see.
items:
type: object
description: |
It is possible to provide the `UNLocationCode`, the `facilitySMDGCode` or both when specifying the location.