-
Notifications
You must be signed in to change notification settings - Fork 1
/
swagger.yaml
170 lines (170 loc) · 5.38 KB
/
swagger.yaml
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
swagger: '2.0'
info:
version: demo
title: Anchor API
license:
name: MIT
host: data-anchor-api.swagger.io
basePath: /
schemes:
- http
consumes:
- application/json
produces:
- application/json
paths:
/data_anchors:
post:
tags:
- data-anchoring
summary: Create a new data anchor
operationId: createDataAnchor
parameters:
- name: payload
in: body
required: true
description: The attributes of the anchor
schema:
type: object
properties:
name:
type: string
description: "Name of the anchor (doesn't need to be unique)."
example: 'My Data Anchor'
hash:
type: string
description: |
SHA256 hash (ie. the fingerprint) of the original data to anchor.
The value must be provided as an hexadecimal lowercase string.
example: 'de828d5995db19fbc792dd1aa822f1b9817514d0347d5fbf33c685ea55d7706e'
metadata:
type: object
description: |
A set of variables (key/values pairs) to store with the anchor and giving additional information about the anchored data. Values must be of type null, boolean, string or number: nested JSON objects are not allowed.
required:
- name
- hash
responses:
'200':
description: The anchor was created successfully.
headers: {}
schema:
$ref: '#/definitions/DataAnchor'
default:
description: Unexpected error
schema:
$ref: '#/definitions/Error'
/data_anchors/{anchorId}:
get:
tags:
- data-anchoring
summary: Get an anchor by its identifier
operationId: getDataAnchor
parameters:
- name: anchorId
in: path
required: true
description: The id of the anchor to retrieve
type: string
responses:
'200':
description: A JSON object containing anchor information
headers: {}
schema:
$ref: '#/definitions/DataAnchor'
default:
description: Unexpected error
schema:
$ref: '#/definitions/Error'
put:
tags:
- data-anchoring
summary: Update an anchor by its identifier
description: |
Use this operation to update an anchor.
Only the properties name, metadata can be modified.
operationId: updateDataAnchor
parameters:
- name: anchorId
in: path
required: true
description: The id of the anchor to update
type: string
- name: payload
in: body
required: true
description: The attributes of the anchor
schema:
type: object
properties:
name:
type: string
description: "Name of the anchor (doesn't need to be unique)."
example: 'My Data Anchor'
metadata:
type: object
description: |
A set of variables (key/values pairs) to store with the anchor and giving additional information about the anchored data. Values must be of type null, boolean, string or number: nested JSON objects are not allowed.
responses:
'200':
description: The anchor was updated successfully.
headers: {}
schema:
$ref: '#/definitions/DataAnchor'
default:
description: Unexpected error
schema:
$ref: '#/definitions/Error'
definitions:
DataAnchor:
description: 'A data anchor (generating a proof of existence receipt) allows to prove the existence of some data at some point in time.'
type: object
required:
- name
- hash
properties:
name:
type: string
description: "Name of the anchor (doesn't need to be unique)."
example: 'My Data Anchor'
hash:
type: string
description: |
SHA256 hash (ie. the fingerprint) of the original data to anchor.
The value must be provided as an hexadecimal lowercase string.
example: 'de828d5995db19fbc792dd1aa822f1b9817514d0347d5fbf33c685ea55d7706e'
metadata:
type: object
description: |
A set of variables (key/values pairs) to store with the anchor and giving additional information about the anchored data. Values must be of type null, boolean, string or number: nested JSON objects are not allowed.
createdAt:
type: string
format: date-time
description: "Time of creation notation. Format should be RFC 3339"
updatedAt:
type: string
format: date-time
description: "Time of last modification. Format should be RFC 3339"
anchorId:
type: string
description: "Identifier of the anchor"
Error:
description: Error object
type: object
required:
- statusCode
- message
- error
properties:
statusCode:
type: integer
description: HTTP error code
errorCode:
type: string
description: Internal error code
message:
type: string
description: Internal error message
error:
type: string
description: HTTP error message