Skip to content

Commit d41c0df

Browse files
committed
Add API docs for user consent records
1 parent 37f9b88 commit d41c0df

File tree

9 files changed

+333
-1
lines changed

9 files changed

+333
-1
lines changed

reference/auth.v1.yaml

Lines changed: 155 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -405,7 +405,7 @@ paths:
405405
get:
406406
operationId: VerifyDeviceToken
407407
summary: Verify Device Token
408-
description: "Checks the validity of Apple's DeviceCheck token by calling Apple's server to verify it. For more details, see Apple's [developer documentation](https://developer.apple.com/documentation/devicecheck)."
408+
description: 'Checks the validity of Apple''s DeviceCheck token by calling Apple''s server to verify it. For more details, see Apple''s [developer documentation](https://developer.apple.com/documentation/devicecheck).'
409409
requestBody:
410410
$ref: '#/components/requestBodies/VerifyDeviceToken'
411411
responses:
@@ -680,6 +680,160 @@ paths:
680680
- sessionToken: []
681681
tags:
682682
- Internal
683+
/v1/consents:
684+
get:
685+
summary: List Consents
686+
tags: []
687+
responses:
688+
'200':
689+
description: OK
690+
content:
691+
application/json:
692+
schema:
693+
$ref: ./auth/models/consent/consents.v1.yaml
694+
operationId: ListConsents
695+
description: Retrieves the list of all different consent types and their content. By default returns only the latest version for each consent type. This can be override by setting the `version` query parameter to `all`
696+
requestBody:
697+
content: {}
698+
parameters:
699+
- schema:
700+
type: string
701+
enum:
702+
- latest
703+
- all
704+
default: latest
705+
in: query
706+
name: version
707+
description: Whether to return all versions or only the most recent one.
708+
parameters: []
709+
'/v1/consents/{type}':
710+
parameters:
711+
- schema:
712+
type: string
713+
name: type
714+
in: path
715+
required: true
716+
get:
717+
summary: Get Latest Consent By Type
718+
tags: []
719+
responses:
720+
'200':
721+
description: OK
722+
content:
723+
application/json:
724+
schema:
725+
$ref: ./auth/models/consent/consent.v1.yaml
726+
operationId: GetLatestConsentByType
727+
description: Returns the latest consent version for the given type
728+
'/v1/consent/{type}/versions':
729+
parameters:
730+
- schema:
731+
type: string
732+
name: type
733+
in: path
734+
required: true
735+
get:
736+
summary: Get Consent Versions
737+
tags: []
738+
responses:
739+
'200':
740+
description: OK
741+
content:
742+
application/json:
743+
schema:
744+
$ref: ./auth/models/consent/consent.v1.yaml
745+
operationId: GetConentVersions
746+
description: Returns a list of all consent versions for a given type
747+
'/v1/users/{userId}/consents':
748+
parameters:
749+
- schema:
750+
type: string
751+
name: userId
752+
in: path
753+
required: true
754+
get:
755+
summary: Get User Consent Records
756+
tags: []
757+
responses:
758+
'200':
759+
description: OK
760+
content:
761+
application/json:
762+
schema:
763+
type: object
764+
properties: {}
765+
operationId: GetUserConsentRecords
766+
description: Returns a list of all user consent records. By default only the most recent consent record for a given consent type will be returned. This can be overriden by setting the `version` query parameter to `all`.
767+
parameters:
768+
- schema:
769+
type: string
770+
enum:
771+
- latest
772+
- all
773+
default: latest
774+
in: query
775+
name: version
776+
description: Whether to return all versions or only the most recent one.
777+
- schema:
778+
type: string
779+
in: query
780+
name: type
781+
post:
782+
summary: Create User Consent Record
783+
operationId: CreateUserConsentRecord
784+
responses:
785+
'201':
786+
description: Created
787+
content:
788+
application/json:
789+
schema:
790+
$ref: ./auth/models/consent/record.v1.yaml
791+
description: Creates a user consent record
792+
requestBody:
793+
content:
794+
application/json:
795+
schema:
796+
$ref: ./auth/models/consent/recordcreate.v1.yaml
797+
'/v1/users/{userId}/consents/{recordId}':
798+
parameters:
799+
- schema:
800+
type: string
801+
name: userId
802+
in: path
803+
required: true
804+
- schema:
805+
type: string
806+
name: recordId
807+
in: path
808+
required: true
809+
get:
810+
summary: Get User Consent Record
811+
tags: []
812+
responses:
813+
'200':
814+
description: OK
815+
content:
816+
application/json:
817+
schema:
818+
$ref: ./auth/models/consent/record.v1.yaml
819+
operationId: GetUserConsentRecord
820+
description: Retrieves a consent record by ID for a given user.
821+
patch:
822+
summary: ''
823+
operationId: UpdateUserConsentRecord
824+
responses:
825+
'200':
826+
description: OK
827+
content:
828+
application/json:
829+
schema:
830+
$ref: ./auth/models/consent/record.v1.yaml
831+
description: ''
832+
requestBody:
833+
content:
834+
application/json:
835+
schema:
836+
$ref: ./auth/models/consent/recordupdate.v1.yaml
683837
components:
684838
securitySchemes:
685839
basicAuth:
Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
title: Consent
2+
description: Consent
3+
type: object
4+
properties:
5+
type:
6+
description: Test
7+
type: string
8+
version:
9+
type: integer
10+
example: 1
11+
x-stoplight:
12+
id: 13aoxi0q1a5dq
13+
minimum: 1
14+
readOnly: true
15+
content:
16+
type: string
17+
contentType:
18+
type: string
19+
enum:
20+
- markdown
21+
createdTime:
22+
type: string
23+
format: date-time
24+
readOnly: true
25+
required:
26+
- type
27+
- version
28+
- content
29+
- contentType
30+
- createdTime

reference/auth/models/consent/consentrecord.v1.yaml

Whitespace-only changes.
Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
title: consents.v1
2+
x-stoplight:
3+
id: o02joytb2fxay
4+
type: object
5+
properties:
6+
data:
7+
x-stoplight:
8+
id: iepviv3jm8m9m
9+
type: array
10+
items:
11+
$ref: ./consent.v1.yaml
12+
x-stoplight:
13+
id: 22oi76x2nbqnp
14+
count:
15+
type: integer
16+
x-stoplight:
17+
id: jsfxo40v5vj0g
18+
required:
19+
- data
20+
- count
Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
title: metadata.v1
2+
x-stoplight:
3+
id: 8ctwq6xjg496g
4+
type: object
5+
properties:
6+
supportedOrganizations:
7+
type: array
8+
uniqueItems: true
9+
description: The list of supported organizations when the consent grant is for the Tidepool Big Data Donation Project
10+
items:
11+
x-stoplight:
12+
id: iew30v83r2ce5
13+
type: string
14+
enum:
15+
- ADCES Foundation
16+
- Beyond Type 1
17+
- Children With Diabetes
18+
- The Diabetes Link
19+
- Diabetes Youth Families (DYF)
20+
- DiabetesSisters
21+
- The diaTribe Foundation
22+
- Breakthrough T1D
Lines changed: 64 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,64 @@
1+
title: record.v1
2+
x-stoplight:
3+
id: nvtrxa89tps30
4+
type: object
5+
properties:
6+
id:
7+
type: string
8+
minLength: 1
9+
readOnly: true
10+
status:
11+
type: string
12+
x-stoplight:
13+
id: m5tc1errbouci
14+
enum:
15+
- active
16+
- revoked
17+
readOnly: true
18+
type:
19+
type: string
20+
x-stoplight:
21+
id: jub0w6n4sx03g
22+
minLength: 1
23+
maxLength: 100
24+
version:
25+
type: integer
26+
x-stoplight:
27+
id: s4pt6ptt7ez4n
28+
minimum: 1
29+
grantTime:
30+
type: string
31+
x-stoplight:
32+
id: z984vbbyzt0n5
33+
format: date-time
34+
readOnly: true
35+
revocationTime:
36+
type: string
37+
x-stoplight:
38+
id: 9hx9eo1oucsak
39+
format: date-time
40+
readOnly: true
41+
createdTime:
42+
type: string
43+
x-stoplight:
44+
id: r7ypd0pfkbhkv
45+
format: date-time
46+
readOnly: true
47+
updatedTime:
48+
type: string
49+
x-stoplight:
50+
id: ohlc8mndn74ov
51+
format: date-time
52+
readOnly: true
53+
metadata:
54+
$ref: ./metadata.v1.yaml
55+
x-stoplight:
56+
id: u4fzjwa9iivzp
57+
required:
58+
- id
59+
- status
60+
- type
61+
- version
62+
- grantTime
63+
- createdTime
64+
- updatedTime
Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
$ref: ./record.v1.yaml
2+
x-stoplight:
3+
id: saa37zeaoirkr
4+
examples:
5+
- type: tbddp
6+
version: 1
7+
metadata:
8+
supportedOrganizations:
9+
- ADCES Foundation
Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
title: records.v1
2+
x-stoplight:
3+
id: 0tuzybru8eee5
4+
type: object
5+
properties:
6+
data:
7+
type: array
8+
x-stoplight:
9+
id: whbezmg3q7pxh
10+
items:
11+
$ref: ./record.v1.yaml
12+
x-stoplight:
13+
id: u1b4u8fpl1ed6
14+
count:
15+
type: integer
16+
x-stoplight:
17+
id: leqbw9m8u2lku
18+
required:
19+
- data
20+
- count
Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
title: recordupdate.v1
2+
x-stoplight:
3+
id: c8oq1dn4m4uak
4+
type: object
5+
properties:
6+
status:
7+
type: string
8+
x-stoplight:
9+
id: 2hnhmpwbyck12
10+
enum:
11+
- revoked
12+
required:
13+
- status

0 commit comments

Comments
 (0)