@@ -217,9 +217,41 @@ curl https://api.simplyprint.io/{id}custom_fields/Delete?ids=123,124,125 \
217
217
| ` status ` | boolean | True if the request was successful. |
218
218
| ` message ` | string | Error message if ` status ` is false. |
219
219
220
+ ## Custom field submission
221
+
222
+ ` POST /{id}/custom_fields/SubmitValues `
223
+
224
+ > Example request
225
+
226
+ ``` shell
227
+ curl -X POST https://api.simplyprint.io/{id}/custom_fields/SubmitValues \
228
+ -H ' accept: application/json' \
229
+ -H ' Content-Type: application/json' \
230
+ -H ' X-API-KEY: {API_KEY}' \
231
+ -d ' {"category": "printer", "subCategory": "print_job", entityIds: [1234], "values": [{customFieldId: "student_id", value: {"string": "1234567890"}}]}'
232
+ ```
233
+
234
+ > Example response
235
+
236
+ ``` json
237
+ {
238
+ "status" : true ,
239
+ "message" : null
240
+ }
241
+ ```
242
+
243
+ ### Request
244
+
245
+ | Parameter | Type | Required | Description |
246
+ | ---------------| --------| ----------| ------------------------------------------------------------------------------------------------------------------|
247
+ | ` category ` | string | yes | One of ` print ` , ` user ` , ` printer ` , ` filament ` |
248
+ | ` subCategory ` | string | yes | One of ` print_queue ` , ` print_job ` , ` user_file ` |
249
+ | ` entityIds ` | array | yes | Array of entity IDs to submit values for |
250
+ | ` values ` | array | yes | Array of custom field values to submit. Each value looks like ` {customFieldId: string, value: CustomFieldValue} ` |
251
+
220
252
## Custom field submission value
221
253
222
- The value of a custom field when submitted via the API is an object with a key corresponding to the field type.
254
+ The value of a custom field when submitted via the API is an object with a key corresponding to the field type.
223
255
See the examples to the right for the different field types.
224
256
225
257
> A text field would have a value like this:
@@ -258,6 +290,9 @@ See the examples to the right for the different field types.
258
290
259
291
``` json
260
292
{
261
- "options" : [" Option 1" , " Option 2" ]
293
+ "options" : [
294
+ " Option 1" ,
295
+ " Option 2"
296
+ ]
262
297
}
263
298
```
0 commit comments