|
Line 0
Link Here
|
|
|
1 |
--- |
| 2 |
"/patrons/{patron_id}/account_links": |
| 3 |
get: |
| 4 |
x-mojo-to: Patrons::AccountLinks#list |
| 5 |
operationId: listPatronAccountLinks |
| 6 |
tags: |
| 7 |
- patrons |
| 8 |
summary: List linked accounts for a patron |
| 9 |
produces: |
| 10 |
- application/json |
| 11 |
parameters: |
| 12 |
- $ref: "../swagger.yaml#/parameters/patron_id_pp" |
| 13 |
- $ref: "../swagger.yaml#/parameters/match" |
| 14 |
- $ref: "../swagger.yaml#/parameters/order_by" |
| 15 |
- $ref: "../swagger.yaml#/parameters/page" |
| 16 |
- $ref: "../swagger.yaml#/parameters/per_page" |
| 17 |
- $ref: "../swagger.yaml#/parameters/q_param" |
| 18 |
- $ref: "../swagger.yaml#/parameters/q_body" |
| 19 |
- $ref: "../swagger.yaml#/parameters/request_id_header" |
| 20 |
responses: |
| 21 |
"200": |
| 22 |
description: A list of linked patron accounts |
| 23 |
schema: |
| 24 |
type: array |
| 25 |
items: |
| 26 |
$ref: "../swagger.yaml#/definitions/patron_account_link" |
| 27 |
"400": |
| 28 |
description: | |
| 29 |
Bad request. Possible `error_code` attribute values: |
| 30 |
|
| 31 |
* `invalid_query` |
| 32 |
schema: |
| 33 |
$ref: "../swagger.yaml#/definitions/error" |
| 34 |
"401": |
| 35 |
description: Authentication required |
| 36 |
schema: |
| 37 |
$ref: "../swagger.yaml#/definitions/error" |
| 38 |
"403": |
| 39 |
description: Access forbidden |
| 40 |
schema: |
| 41 |
$ref: "../swagger.yaml#/definitions/error" |
| 42 |
"404": |
| 43 |
description: Patron not found |
| 44 |
schema: |
| 45 |
$ref: "../swagger.yaml#/definitions/error" |
| 46 |
"500": |
| 47 |
description: | |
| 48 |
Internal server error. Possible `error_code` attribute values: |
| 49 |
|
| 50 |
* `internal_server_error` |
| 51 |
schema: |
| 52 |
$ref: "../swagger.yaml#/definitions/error" |
| 53 |
"503": |
| 54 |
description: Under maintenance |
| 55 |
schema: |
| 56 |
$ref: "../swagger.yaml#/definitions/error" |
| 57 |
x-koha-authorization: |
| 58 |
permissions: |
| 59 |
borrowers: edit_borrowers |
| 60 |
post: |
| 61 |
x-mojo-to: Patrons::AccountLinks#add |
| 62 |
operationId: addPatronAccountLink |
| 63 |
tags: |
| 64 |
- patrons |
| 65 |
summary: Link patron to another account |
| 66 |
parameters: |
| 67 |
- $ref: "../swagger.yaml#/parameters/patron_id_pp" |
| 68 |
- name: body |
| 69 |
in: body |
| 70 |
description: A JSON object containing the patron_id to link to |
| 71 |
required: true |
| 72 |
schema: |
| 73 |
type: object |
| 74 |
properties: |
| 75 |
linked_patron_id: |
| 76 |
type: integer |
| 77 |
description: The patron_id to link this patron to |
| 78 |
required: |
| 79 |
- linked_patron_id |
| 80 |
produces: |
| 81 |
- application/json |
| 82 |
responses: |
| 83 |
"201": |
| 84 |
description: Link created |
| 85 |
schema: |
| 86 |
$ref: "../swagger.yaml#/definitions/patron_account_link" |
| 87 |
"400": |
| 88 |
description: Bad request |
| 89 |
schema: |
| 90 |
$ref: "../swagger.yaml#/definitions/error" |
| 91 |
"401": |
| 92 |
description: Authentication required |
| 93 |
schema: |
| 94 |
$ref: "../swagger.yaml#/definitions/error" |
| 95 |
"403": |
| 96 |
description: Access forbidden |
| 97 |
schema: |
| 98 |
$ref: "../swagger.yaml#/definitions/error" |
| 99 |
"404": |
| 100 |
description: Patron not found |
| 101 |
schema: |
| 102 |
$ref: "../swagger.yaml#/definitions/error" |
| 103 |
"409": |
| 104 |
description: Conflict - patron already linked |
| 105 |
schema: |
| 106 |
$ref: "../swagger.yaml#/definitions/error" |
| 107 |
"500": |
| 108 |
description: | |
| 109 |
Internal server error. Possible `error_code` attribute values: |
| 110 |
|
| 111 |
* `internal_server_error` |
| 112 |
schema: |
| 113 |
$ref: "../swagger.yaml#/definitions/error" |
| 114 |
"503": |
| 115 |
description: Under maintenance |
| 116 |
schema: |
| 117 |
$ref: "../swagger.yaml#/definitions/error" |
| 118 |
x-koha-authorization: |
| 119 |
permissions: |
| 120 |
borrowers: edit_borrowers |
| 121 |
"/patrons/{patron_id}/account_links/{account_link_id}": |
| 122 |
delete: |
| 123 |
x-mojo-to: Patrons::AccountLinks#delete |
| 124 |
operationId: deletePatronAccountLink |
| 125 |
tags: |
| 126 |
- patrons |
| 127 |
summary: Remove a patron account link |
| 128 |
parameters: |
| 129 |
- $ref: "../swagger.yaml#/parameters/patron_id_pp" |
| 130 |
- name: account_link_id |
| 131 |
in: path |
| 132 |
description: Internal account link identifier |
| 133 |
required: true |
| 134 |
type: integer |
| 135 |
produces: |
| 136 |
- application/json |
| 137 |
responses: |
| 138 |
"204": |
| 139 |
description: Link deleted |
| 140 |
"401": |
| 141 |
description: Authentication required |
| 142 |
schema: |
| 143 |
$ref: "../swagger.yaml#/definitions/error" |
| 144 |
"403": |
| 145 |
description: Access forbidden |
| 146 |
schema: |
| 147 |
$ref: "../swagger.yaml#/definitions/error" |
| 148 |
"404": |
| 149 |
description: Link not found |
| 150 |
schema: |
| 151 |
$ref: "../swagger.yaml#/definitions/error" |
| 152 |
"500": |
| 153 |
description: Internal error |
| 154 |
schema: |
| 155 |
$ref: "../swagger.yaml#/definitions/error" |
| 156 |
"503": |
| 157 |
description: Under maintenance |
| 158 |
schema: |
| 159 |
$ref: "../swagger.yaml#/definitions/error" |
| 160 |
x-koha-authorization: |
| 161 |
permissions: |
| 162 |
borrowers: edit_borrowers |