· 6 years ago · Apr 08, 2020, 06:30 PM
1###################################################################################################
2# Do not edit this file. It is generated by the OpenApi.py script found in the openapi folder #
3###################################################################################################
4info:
5 description: Specification for API related to Home Page of SIQ App
6 title: SIQ Labs Documentation
7 version: 1.0.0
8openapi: 3.0.0
9paths:
10 /rest/bed:
11 get:
12 description: Get a list of beds for an account.
13 responses:
14 '200':
15 content:
16 application/json:
17 example:
18 beds:
19 - accountId: '-9223372036356856712'
20 bedId: '-9223372036356755617'
21 components:
22 - base: ADJUSTABLE
23 componentId: '-9223372036356452142'
24 dualSleep: true
25 hasPendingReturn: false
26 installDate: null
27 installer: null
28 model: AZI10
29 orderNumberToExchange: null
30 parentId: 35632230815:1-AID:P
31 purchaseDate: '2017-04-20T06:02:10Z'
32 reference: 35632230815:1-AID
33 serial: ''
34 size: KING
35 sku: AZI10
36 status: NOT_INSTALLED
37 type: Bed (double)
38 version: ''
39 - base: ''
40 componentId: '-9223372036356452141'
41 dualSleep: false
42 hasPendingReturn: false
43 installDate: null
44 installer: null
45 model: AZI10
46 orderNumberToExchange: null
47 parentId: 35632230815:1-AID:P
48 purchaseDate: '2017-04-20T06:02:10Z'
49 reference: 35632230815:2-AID
50 serial: ''
51 size: ''
52 sku: AZI10
53 status: NOT_INSTALLED
54 type: Pump
55 version: ''
56 - base: ''
57 componentId: '-9223372036356452140'
58 dualSleep: false
59 hasPendingReturn: false
60 installDate: null
61 installer: null
62 model: AZI10
63 orderNumberToExchange: null
64 parentId: 35632230815:1-AID:P
65 purchaseDate: '2017-04-20T06:02:10Z'
66 reference: 35632230815:4-AID
67 serial: ''
68 size: ''
69 sku: AZI10
70 status: NOT_INSTALLED
71 type: Base
72 version: ''
73 - base: ''
74 componentId: '-9223372036356452139'
75 dualSleep: false
76 hasPendingReturn: false
77 installDate: null
78 installer: null
79 model: AZI10
80 orderNumberToExchange: null
81 parentId: 35632230815:1-AID:P
82 purchaseDate: '2017-04-20T06:02:10Z'
83 reference: 35632230815:5-AID
84 serial: ''
85 size: ''
86 sku: AZI10
87 status: NOT_INSTALLED
88 type: Warming
89 version: ''
90 - base: ''
91 componentId: '-9223372036356452138'
92 dualSleep: false
93 hasPendingReturn: false
94 installDate: null
95 installer: null
96 model: AZI10
97 orderNumberToExchange: null
98 parentId: 35632230815:1-AID:P
99 purchaseDate: '2017-04-20T06:02:10Z'
100 reference: 35632230815:6-AID
101 serial: ''
102 size: ''
103 sku: AZI10
104 status: NOT_INSTALLED
105 type: Remote
106 version: ''
107 dualSleep: true
108 fccId: null
109 generation: '360'
110 hasSnore: false
111 isKidsBed: false
112 macAddress: NR141974
113 name: AZI10
114 registrationDate: null
115 returnRequestStatus: 0
116 size: KING
117 sleeperLeftId: '0'
118 sleeperRightId: '0'
119 status: 2
120 timezone: null
121 zipcode: '94085'
122 - accountId: '-9223372036356856712'
123 bedId: '-9223372036356755616'
124 components:
125 - base: ADJUSTABLE
126 componentId: '-9223372036356452137'
127 dualSleep: true
128 hasPendingReturn: false
129 installDate: null
130 installer: null
131 model: AZI20
132 orderNumberToExchange: null
133 parentId: 35632230816:1-AID:P
134 purchaseDate: '2017-04-20T06:02:10Z'
135 reference: 35632230816:1-AID
136 serial: ''
137 size: KING
138 sku: AZI20
139 status: NOT_INSTALLED
140 type: Bed (double)
141 version: ''
142 - base: ''
143 componentId: '-9223372036356452136'
144 dualSleep: false
145 hasPendingReturn: false
146 installDate: null
147 installer: null
148 model: AZI20
149 orderNumberToExchange: null
150 parentId: 35632230816:1-AID:P
151 purchaseDate: '2017-04-20T06:02:10Z'
152 reference: 35632230816:2-AID
153 serial: ''
154 size: ''
155 sku: AZI20
156 status: NOT_INSTALLED
157 type: Pump
158 version: ''
159 dualSleep: true
160 fccId: null
161 generation: '360'
162 hasSnore: false
163 isKidsBed: false
164 macAddress: NR141975
165 name: AZI20
166 registrationDate: null
167 returnRequestStatus: 0
168 size: KING
169 sleeperLeftId: '0'
170 sleeperRightId: '0'
171 status: 2
172 timezone: null
173 zipcode: '94085'
174 schema:
175 properties:
176 beds:
177 items:
178 properties:
179 accountId:
180 description: Unique id of account
181 example: '-9223372036592074802'
182 maxLength: 20
183 pattern: ^-[1-9][0-9]*$
184 type: string
185 bedId:
186 description: Unique id of bed
187 example: '-9223372036639946127'
188 maxLength: 20
189 pattern: ^-([1-9][0-9]*)$|^0$
190 type: string
191 components:
192 items:
193 properties:
194 base:
195 description: Base model
196 maxLength: 25
197 nullable: true
198 type: string
199 componentId:
200 description: Component unique id
201 maxLength: 20
202 pattern: ^-[1-9][0-9]*$
203 type: string
204 dualSleep:
205 description: True if this component supports 2 sleepers.
206 Only valid for type = 1 or 3
207 type: boolean
208 hasPendingReturn:
209 description: True if the component is pending for
210 return
211 type: boolean
212 installDate:
213 description: When this component was installed.
214 nullable: true
215 pattern: '[0-9]{4}-[0-9]{2}-[0-9]{2}'
216 type: string
217 installer:
218 description: Login of installer that installed this
219 component. null if unknown or not installed.
220 nullable: true
221 type: string
222 model:
223 description: Component model name to be presented
224 to user.
225 maximum: 10
226 nullable: true
227 type: string
228 orderNumberToExchange:
229 description: This field will be filled when exchanging
230 a component for an existing one. This will contain
231 the order number of an existing component to replace
232 nullable: true
233 type: string
234 parentId:
235 description: The reference of the bed component to
236 which this component belongs to.
237 type: string
238 purchaseDate:
239 pattern: '[0-9]{4}-[0-9]{2}-[0-9]{2}T[0-9]{2}:[0-9]{2}:[0-9]{2}Z'
240 type: string
241 reference:
242 description: Bed reference number
243 maxLength: 30
244 type: string
245 serial:
246 description: Component serial number
247 maxLength: 20
248 type: string
249 size:
250 description: Bed size. possible values = TWIN, FULL,
251 QUEEN, KING, KING-SPLIT, KING-FLEX
252 enum:
253 - TWIN
254 - FULL
255 - QUEEN
256 - KING
257 - KING-SPLIT
258 - KING-FLEX
259 maxLength: 50
260 nullable: true
261 type: string
262 sku:
263 description: Component sku
264 maximum: 30
265 nullable: true
266 type: string
267 status:
268 description: The status of the component.
269 enum:
270 - NOT_INSTALLED
271 - INSTALLED
272 - REMOVED
273 - PENDING_EXCHANGE
274 - INSTALLED_BY_EXCHANGE
275 type: string
276 type:
277 description: Component type. e.g. bed, component...
278 maximum: 8
279 minimum: 1
280 type: string
281 version:
282 description: Component version
283 maxLength: 10
284 type: string
285 required:
286 - base
287 - size
288 - serial
289 - parentId
290 - type
291 - installDate
292 - dualSleep
293 - status
294 - version
295 - componentId
296 - installer
297 - model
298 - purchaseDate
299 - orderNumberToExchange
300 - sku
301 - reference
302 - hasPendingReturn
303 type: object
304 type: array
305 dualSleep:
306 description: True if this bed supports 2 sleepers.
307 type: boolean
308 fccId:
309 description: FCC Id of the device
310 nullable: true
311 type: string
312 generation:
313 description: Timezone of bed
314 maxLength: 25
315 type: string
316 hasSnore:
317 description: True if bed has bed snore option
318 type: boolean
319 isKidsBed:
320 description: True if this is a child bed
321 type: boolean
322 macAddress:
323 description: Bed MAC address
324 maxLength: 255
325 type: string
326 name:
327 description: User specified name of device
328 maxLength: 100
329 type: string
330 registrationDate:
331 description: Date the bed first registered with the server.
332 (the pump physically installed and connected to server
333 for the first time)
334 nullable: true
335 type: string
336 returnRequestStatus:
337 description: Status of return request. 0 = no return pending
338 on this device, 1 = return pending on this device
339 maximum: 1
340 minimum: 0
341 type: integer
342 size:
343 description: Bed size. possible values = TWIN, FULL, QUEEN,
344 KING, KING-SPLIT, KING-FLEX
345 maxLength: 50
346 nullable: true
347 type: string
348 sleeperLeftId:
349 description: Sleeper ID for left side. Null if no sleeper
350 associated
351 nullable: true
352 type: string
353 sleeperRightId:
354 description: Sleeper ID for right side. Null if no sleeper
355 associated
356 nullable: true
357 type: string
358 status:
359 description: Online Status of bed.
360 maximum: 4
361 minimum: 1
362 type: integer
363 timezone:
364 description: Timezone of bed
365 maxLength: 256
366 nullable: true
367 type: string
368 zipcode:
369 description: Zipcode of bed
370 maxLength: 60
371 type: string
372 required:
373 - registrationDate
374 - sleeperRightId
375 - components
376 - returnRequestStatus
377 - size
378 - name
379 - hasSnore
380 - fccId
381 - isKidsBed
382 - dualSleep
383 - bedId
384 - status
385 - sleeperLeftId
386 - accountId
387 - timezone
388 - generation
389 - macAddress
390 - zipcode
391 type: object
392 type: array
393 required:
394 - beds
395 type: object
396 description: Success
397 '401':
398 description: Unauthorized - The session has expired. Need to re-login.
399 '403':
400 description: Forbidden - The credentials do not allow access to this area.
401 summary: Get Beds
402 x-amazon-apigateway-integration:
403 httpMethod: GET
404 passthroughBehavior: when_no_match
405 responses:
406 default:
407 statusCode: '200'
408 type: http_proxy
409 uri: https://circle1-api.circle.siq.sleepnumber.com/rest/bed
410 /rest/login:
411 put:
412 description: 'Authenticate a customer. Authentication will be allowed if the
413 account is active, and if the password matches. This method is required before
414 other methods can be called and will create a session with the client.
415
416 Alternately, a Bearer OAuth token can be passed in which was obtained from
417 Customer Get Auth Token call. If this is present, it will ignore login/password
418 credentials passed in.
419
420 '
421 parameters:
422 - description: Client application version.
423 example: 2.3
424 in: header
425 name: X-App-Version
426 required: false
427 schema:
428 pattern: ^[0-9](\.[0-9]){1,2}$
429 type: string
430 - description: Client OS platform. If not passed in, no version checking will
431 occur
432 example: ios
433 in: header
434 name: X-App-Platform
435 required: false
436 schema:
437 enum:
438 - ios
439 - android
440 type: string
441 requestBody:
442 content:
443 application/json:
444 schema:
445 oneOf:
446 - properties:
447 login:
448 description: Customer username
449 maxLength: 256
450 type: string
451 password:
452 description: Must contain at least one of each lowercase, uppercase,
453 and numeric character
454 maxLength: 30
455 minLength: 8
456 type: string
457 required:
458 - login
459 - password
460 type: object
461 - properties:
462 auth_token:
463 description: Authorization token obtained from Customer Get Auth
464 Token
465 type: string
466 required:
467 - auth_token
468 type: object
469 required: true
470 responses:
471 '200':
472 content:
473 application/json:
474 schema:
475 properties:
476 edpLoginMessage:
477 description: Status message from EDP login
478 example: not used
479 type: string
480 edpLoginStatus:
481 description: Response code from EDP login
482 example: 200
483 type: integer
484 key:
485 description: An API key that must be passed on every API call
486 for this session as the _k parameter
487 example: CltEmDnDy1rhP
488 type: string
489 registrationState:
490 description: If user has not completed registration, state of
491 their incomplete registration progress, 0 otherwise
492 example: 13
493 type: integer
494 userId:
495 description: User identifier
496 example: '-9223372036593842297'
497 type: string
498 required:
499 - userId
500 - registrationState
501 - key
502 - edpLoginStatus
503 - edpLoginMessage
504 type: object
505 description: Success
506 '400':
507 description: Bad Request - A parameter is missing or invalid.
508 '401':
509 description: Unauthorized - The session has expired. Need to re-login.
510 '403':
511 description: Forbidden - The credentials do not allow access to this area.
512 '404':
513 description: Not Found - The requested resource is not found by the given
514 parameters.
515 '405':
516 description: Method Not Allowed - Invalid method parameters.
517 '409':
518 content:
519 application/json:
520 schema:
521 properties:
522 Code:
523 description: 409 EULA, 50011 Privacy Policy
524 example: 409
525 type: integer
526 LicenseVersion:
527 description: EULA license number that must be accepted
528 example: 8
529 type: integer
530 Message:
531 description: Missing license acceptance description
532 example: License acceptance required
533 type: string
534 required:
535 - Code
536 - Message
537 type: object
538 description: Conflict - EULA signature required.
539 '410':
540 description: Gone - Password has expired.
541 summary: Customer Login
542 x-amazon-apigateway-integration:
543 httpMethod: PUT
544 passthroughBehavior: when_no_match
545 requestParameters: {}
546 responses:
547 default:
548 statusCode: '200'
549 type: http_proxy
550 uri: https://circle1-api.circle.siq.sleepnumber.com/rest/login
551 /rest/sleepSessions:
552 get:
553 description: Returns sleep sessions for the given particular sleeper. If sleeperId
554 is not present, returns the for all the active sleepers in account.
555 parameters:
556 - description: ID of sleeper to get sessions. If not provided, will return sessions
557 for all active sleepers.
558 in: query
559 name: sleeperId
560 schema:
561 description: Unique id of sleeper
562 example: '-9223372036639592694'
563 maxLength: 20
564 pattern: ^-[1-9][0-9]*$
565 type: string
566 - description: Get sessions that have originalStartDate after this date.
567 example: '2018-09-30T12:44:19'
568 in: query
569 name: startDate
570 schema:
571 type: string
572 - description: Get sessions that have originalEndDate before this date.
573 example: '2018-09-30T20:44:19'
574 in: query
575 name: endDate
576 schema:
577 type: string
578 - description: Number of sessions to return.
579 example: 1
580 in: query
581 name: count
582 schema:
583 maximum: 10
584 minimum: 1
585 type: integer
586 - description: Set to true if slices should be in the response.
587 example: true
588 in: query
589 name: includeSlices
590 schema:
591 type: boolean
592 responses:
593 '200':
594 content:
595 application/json:
596 schema:
597 properties:
598 sleepers:
599 items:
600 properties:
601 sessions:
602 items:
603 properties:
604 avgHeartRate:
605 description: Average heart rate in bpm
606 example: 77
607 minimum: 0
608 type: integer
609 avgRespirationRate:
610 description: Average respiratory rate in brpm
611 example: 12
612 minimum: 0
613 type: integer
614 bedExits:
615 items:
616 description: An object that represents one bed exit
617 event within a sleep session. The final exit
618 is never included.
619 properties:
620 bedExitDuration:
621 description: Length in seconds this out of bed.
622 At the end of this, there was an in bed event.
623 minimum: 0
624 type: integer
625 bedExitTime:
626 pattern: '[0-9]{4}-[0-9]{2}-[0-9]{2}T[0-9]{2}:[0-9]{2}:[0-9]{2}'
627 type: string
628 required:
629 - bedExitDuration
630 - bedExitTime
631 type: object
632 type: array
633 date:
634 pattern: '[0-9]{4}-[0-9]{2}-[0-9]{2}'
635 type: string
636 endDate:
637 pattern: '[0-9]{4}-[0-9]{2}-[0-9]{2}T[0-9]{2}:[0-9]{2}:[0-9]{2}'
638 type: string
639 fallAsleepDate:
640 pattern: '[0-9]{4}-[0-9]{2}-[0-9]{2}T[0-9]{2}:[0-9]{2}:[0-9]{2}'
641 type: string
642 fallAsleepPeriod:
643 description: The duration between session start (tstart)
644 and when the sleeper fell asleep in seconds.
645 type: integer
646 inBed:
647 description: Length of the sleep session in minutes
648 example: 475
649 minimum: 0
650 type: integer
651 isFinalized:
652 description: True if this session is finalized, meaning,
653 it cannot be extended. This is 2 hours after the
654 last out of bed. Within that 2 hours, a sleeper
655 can get back in bed and extend the sleep session.
656 Once the session is finalized, it can be edited.
657 type: boolean
658 isHidden:
659 description: True if this session has been hidden.
660 It will not be used in aggregate calculations.
661 type: boolean
662 longest:
663 description: True if this session is the longest.
664 Generally speaking, the longest segment will correspond
665 to the one with the longest duration. This is the
666 session used when rolling up or averaging.
667 type: boolean
668 originalEndDate:
669 pattern: '[0-9]{4}-[0-9]{2}-[0-9]{2}T[0-9]{2}:[0-9]{2}:[0-9]{2}'
670 type: string
671 originalStartDate:
672 pattern: '[0-9]{4}-[0-9]{2}-[0-9]{2}T[0-9]{2}:[0-9]{2}:[0-9]{2}'
673 type: string
674 outOfBed:
675 description: Time of out of bed in minutes
676 example: 8
677 minimum: 0
678 type: integer
679 restful:
680 description: Time of restful sleep in minutes
681 example: 440
682 minimum: 0
683 type: integer
684 restless:
685 description: Time of restless sleep in minutes
686 example: 27
687 minimum: 0
688 type: integer
689 sleepIQCalculating:
690 description: True if a bed exit just occurred and
691 the sleep IQ score has not completed calculating.
692 type: boolean
693 sleepNumber:
694 maximum: 100
695 minimum: 0
696 type: integer
697 sleepQuotient:
698 maximum: 100
699 minimum: 0
700 type: integer
701 sleeperGoalDuration:
702 description: The sleepers sleep goal for this session.
703 This will be the current value set by the sleeper
704 at the end of this session.
705 minimum: 0
706 type: integer
707 sliceList:
708 items:
709 description: For displaying a graph of sleep across
710 the entire day.
711 properties:
712 outOfBedTime:
713 description: Time of out of bed in minutes.
714 Note that this doesnt include time before
715 the sleep entered a sleep session or after
716 the sleeper exited a sleep session.
717 example: 0
718 minimum: 0
719 type: integer
720 restfulTime:
721 description: Time of restful sleep in minutes
722 example: 7
723 minimum: 0
724 type: integer
725 restlessTime:
726 description: Time of restless sleep in minutes
727 example: 3
728 minimum: 0
729 type: integer
730 type:
731 description: Type of sleep for this slice period
732 maximum: 3
733 minimum: 0
734 type: integer
735 required:
736 - type
737 - restfulTime
738 - restlessTime
739 - outOfBedTime
740 type: object
741 type: array
742 snoreData:
743 description: A Snore Data Object represents one session
744 of snore data.
745 properties:
746 levelChanges:
747 items:
748 description: Snore level changes
749 properties:
750 intensity:
751 description: Intensity of this snore level
752 change <0-5>. 0 = no snore, 5 = highest
753 snore level
754 maximum: 5
755 minimum: 0
756 type: integer
757 startTime:
758 pattern: '[0-9]{4}-[0-9]{2}-[0-9]{2}T[0-9]{2}:[0-9]{2}:[0-9]{2}'
759 type: string
760 required:
761 - intensity
762 - startTime
763 type: object
764 type: array
765 snoreActions:
766 items:
767 description: Snore actions taken place during
768 this session
769 properties:
770 actionNotTakenReason:
771 description: If the action was not taken,
772 the reason why.
773 enum:
774 - DO_OFF
775 - AT_PRESET
776 - PAST_PRESET
777 - NO_PRESENCE
778 - FOUNDATION_COMM_ERROR
779 - BACK_OFF
780 - ''
781 type: string
782 actionTime:
783 pattern: '[0-9]{4}-[0-9]{2}-[0-9]{2}T[0-9]{2}:[0-9]{2}:[0-9]{2}'
784 type: string
785 actionType:
786 description: Type of action.
787 type: string
788 required:
789 - actionTime
790 - actionType
791 - actionNotTakenReason
792 type: object
793 type: array
794 snoreSense:
795 items:
796 description: Snore episodes for the sleeper.
797 These are based on the sleepers sensitivity
798 setting. A higher sensitivity setting will
799 produce more of these. At a lower sensitivity
800 setting, it will take a higher intensity of
801 snoring to trigger an episode.
802 properties:
803 endTime:
804 pattern: '[0-9]{4}-[0-9]{2}-[0-9]{2}T[0-9]{2}:[0-9]{2}:[0-9]{2}'
805 type: string
806 startTime:
807 pattern: '[0-9]{4}-[0-9]{2}-[0-9]{2}T[0-9]{2}:[0-9]{2}:[0-9]{2}'
808 type: string
809 required:
810 - startTime
811 - endTime
812 type: object
813 type: array
814 required:
815 - levelChanges
816 - snoreActions
817 - snoreSense
818 type: object
819 snoreSensitivity:
820 maximum: 3
821 minimum: 0
822 nullable: true
823 type: integer
824 startDate:
825 pattern: '[0-9]{4}-[0-9]{2}-[0-9]{2}T[0-9]{2}:[0-9]{2}:[0-9]{2}'
826 type: string
827 totalSleepSessionTime:
828 description: Cumulative sleep session time in seconds.
829 type: integer
830 totalSnoreTime:
831 description: Seconds of snoring in this sleep session
832 nullable: true
833 type: integer
834 required:
835 - date
836 - startDate
837 - endDate
838 - originalStartDate
839 - originalEndDate
840 - inBed
841 - isHidden
842 - sleepQuotient
843 - totalSleepSessionTime
844 - sleepNumber
845 - sleeperGoalDuration
846 - restful
847 - restless
848 - outOfBed
849 - avgHeartRate
850 - avgRespirationRate
851 - longest
852 - sleepIQCalculating
853 - fallAsleepPeriod
854 - fallAsleepDate
855 - sliceList
856 - bedExits
857 - snoreData
858 - totalSnoreTime
859 - isFinalized
860 - snoreSensitivity
861 type: object
862 type: array
863 sleeperId:
864 description: Unique id of sleeper
865 example: '-9223372036639592694'
866 maxLength: 20
867 pattern: ^-[1-9][0-9]*$
868 type: string
869 type: object
870 type: array
871 type: object
872 description: Success
873 '400':
874 description: Bad Request - A parameter is missing or invalid.
875 '401':
876 description: Unauthorized - The session has expired. Need to re-login.
877 '403':
878 description: Forbidden - The credentials do not allow access to this area.
879 '404':
880 description: Not Found - The requested resource is not found by the given
881 parameters.
882 '405':
883 description: Method Not Allowed - Invalid method parameters.
884 summary: Get Sleep Sessions
885 x-amazon-apigateway-integration:
886 httpMethod: GET
887 passthroughBehavior: when_no_match
888 requestParameters: {}
889 responses:
890 default:
891 statusCode: '200'
892 type: http_proxy
893 uri: https://circle1-api.circle.siq.sleepnumber.com/rest/sleepSessions
894 /rest/sleeper/{sleeperId}:
895 get:
896 description: Get a sleeper object.
897 parameters:
898 - description: Sleeper ID to get a sleeper object
899 in: path
900 name: sleeperId
901 required: true
902 schema:
903 description: Unique id of sleeper
904 example: '-9223372036639592694'
905 maxLength: 20
906 pattern: ^-[1-9][0-9]*$
907 type: string
908 responses:
909 '200':
910 content:
911 application/json:
912 schema:
913 oneOf:
914 - properties:
915 sleeper:
916 allOf:
917 - properties:
918 accountId:
919 description: Unique id of account
920 example: '-9223372036592074802'
921 maxLength: 20
922 pattern: ^-[1-9][0-9]*$
923 type: string
924 active:
925 description: True if sleeper is active
926 type: boolean
927 avatar:
928 description: Picture of sleeper in base64 data. For the
929 format of this field, See RFC2397 spec.
930 type: string
931 bedId:
932 description: Unique id of bed
933 example: '-9223372036639946127'
934 maxLength: 20
935 pattern: ^-([1-9][0-9]*)$|^0$
936 type: string
937 birthMonth:
938 description: Birth month for a child sleeper. 1 = Jan,
939 ..., 12 = Dec.
940 example: '5'
941 maximum: 12
942 minimum: 1
943 type: integer
944 birthYear:
945 description: 4 digit birth year
946 example: '2017'
947 pattern: ^[0-9]{4}$
948 type: string
949 duration:
950 description: For a child sleeper, bedtime duration. Not
951 applicable for adult sleeper.
952 minimum: 0
953 nullable: true
954 type: integer
955 email:
956 description: Sleeper email address
957 maxLength: 256
958 nullable: true
959 type: email
960 emailValidated:
961 description: True if the users email has been validated.
962 This is important when the email/login has been changed
963 and indicates whether the user has validated the new
964 email address.
965 type: boolean
966 firstName:
967 description: First name of sleeper
968 maxLength: 30
969 type: string
970 firstSessionRecorded:
971 description: Date of first recorded sleep session in ISO8601
972 format. Default = null when no session recorded yet.
973 example: '2017-07-21T17:32:28Z'
974 nullable: true
975 pattern: '[0-9]{4}-[0-9]{2}-[0-9]{2}T[0-9]{2}:[0-9]{2}:[0-9]{2}Z'
976 type: string
977 height:
978 description: Height in inches
979 minimum: 0
980 nullable: true
981 type: integer
982 isAccountOwner:
983 description: True if this is the account owner. This
984 field has no special significance to the server, however
985 there must always be one account owner and they must
986 have a login.
987 type: boolean
988 isChild:
989 description: True if this is a child sleeper. If true,
990 then fields 'birthMonth' and 'duration' are required
991 type: boolean
992 lastLogin:
993 description: Date of the last Sleeper login
994 nullable: true
995 pattern: '[0-9]{4}-[0-9]{2}-[0-9]{2} [0-9]{2}:[0-9]{2}:[0-9]{2}
996 [A-Z]{3}'
997 type: string
998 licenseVersion:
999 description: Version of EULA this user signed.
1000 nullable: true
1001 type: integer
1002 side:
1003 description: Side of the bed this sleeper is on.
1004 enum:
1005 - 0
1006 - 1
1007 type: integer
1008 sleepGoal:
1009 description: Nightly sleep target goal in minutes
1010 minimum: 0
1011 type: integer
1012 sleeperId:
1013 description: Unique id of sleeper
1014 example: '-9223372036639592694'
1015 maxLength: 20
1016 pattern: ^-[1-9][0-9]*$
1017 type: string
1018 timezone:
1019 description: String representing the timezone that the
1020 sleeper is located in.
1021 maxLength: 30
1022 pattern: ^(.*)/(.*)$
1023 type: string
1024 username:
1025 description: Sleeper username. Should be same as email
1026 maxLength: 256
1027 nullable: true
1028 type: email
1029 weight:
1030 description: Weight in pounds
1031 minimum: 0
1032 nullable: true
1033 type: integer
1034 zipCode:
1035 description: Sleeper zip code
1036 maxLength: 60
1037 nullable: true
1038 type: string
1039 required:
1040 - accountId
1041 - active
1042 - bedId
1043 - birthYear
1044 - emailValidated
1045 - isChild
1046 - isAccountOwner
1047 - firstName
1048 - height
1049 - lastLogin
1050 - licenseVersion
1051 - side
1052 - sleeperId
1053 - sleepGoal
1054 - timezone
1055 - username
1056 - weight
1057 - zipCode
1058 - email
1059 type: object
1060 - properties:
1061 isMale:
1062 description: 'Gender: True = male, False = female'
1063 type: boolean
1064 required:
1065 - isMale
1066 required:
1067 - sleeper
1068 type: object
1069 - properties:
1070 sleeper:
1071 allOf:
1072 - properties:
1073 accountId:
1074 description: Unique id of account
1075 example: '-9223372036592074802'
1076 maxLength: 20
1077 pattern: ^-[1-9][0-9]*$
1078 type: string
1079 active:
1080 description: True if sleeper is active
1081 type: boolean
1082 avatar:
1083 description: Picture of sleeper in base64 data. For the
1084 format of this field, See RFC2397 spec.
1085 type: string
1086 bedId:
1087 description: Unique id of bed
1088 example: '-9223372036639946127'
1089 maxLength: 20
1090 pattern: ^-([1-9][0-9]*)$|^0$
1091 type: string
1092 birthMonth:
1093 description: Birth month for a child sleeper. 1 = Jan,
1094 ..., 12 = Dec.
1095 example: '5'
1096 maximum: 12
1097 minimum: 1
1098 type: integer
1099 birthYear:
1100 description: 4 digit birth year
1101 example: '2017'
1102 pattern: ^[0-9]{4}$
1103 type: string
1104 duration:
1105 description: For a child sleeper, bedtime duration. Not
1106 applicable for adult sleeper.
1107 minimum: 0
1108 nullable: true
1109 type: integer
1110 email:
1111 description: Sleeper email address
1112 maxLength: 256
1113 nullable: true
1114 type: email
1115 emailValidated:
1116 description: True if the users email has been validated.
1117 This is important when the email/login has been changed
1118 and indicates whether the user has validated the new
1119 email address.
1120 type: boolean
1121 firstName:
1122 description: First name of sleeper
1123 maxLength: 30
1124 type: string
1125 firstSessionRecorded:
1126 description: Date of first recorded sleep session in ISO8601
1127 format. Default = null when no session recorded yet.
1128 example: '2017-07-21T17:32:28Z'
1129 nullable: true
1130 pattern: '[0-9]{4}-[0-9]{2}-[0-9]{2}T[0-9]{2}:[0-9]{2}:[0-9]{2}Z'
1131 type: string
1132 height:
1133 description: Height in inches
1134 minimum: 0
1135 nullable: true
1136 type: integer
1137 isAccountOwner:
1138 description: True if this is the account owner. This
1139 field has no special significance to the server, however
1140 there must always be one account owner and they must
1141 have a login.
1142 type: boolean
1143 isChild:
1144 description: True if this is a child sleeper. If true,
1145 then fields 'birthMonth' and 'duration' are required
1146 type: boolean
1147 lastLogin:
1148 description: Date of the last Sleeper login
1149 nullable: true
1150 pattern: '[0-9]{4}-[0-9]{2}-[0-9]{2} [0-9]{2}:[0-9]{2}:[0-9]{2}
1151 [A-Z]{3}'
1152 type: string
1153 licenseVersion:
1154 description: Version of EULA this user signed.
1155 nullable: true
1156 type: integer
1157 side:
1158 description: Side of the bed this sleeper is on.
1159 enum:
1160 - 0
1161 - 1
1162 type: integer
1163 sleepGoal:
1164 description: Nightly sleep target goal in minutes
1165 minimum: 0
1166 type: integer
1167 sleeperId:
1168 description: Unique id of sleeper
1169 example: '-9223372036639592694'
1170 maxLength: 20
1171 pattern: ^-[1-9][0-9]*$
1172 type: string
1173 timezone:
1174 description: String representing the timezone that the
1175 sleeper is located in.
1176 maxLength: 30
1177 pattern: ^(.*)/(.*)$
1178 type: string
1179 username:
1180 description: Sleeper username. Should be same as email
1181 maxLength: 256
1182 nullable: true
1183 type: email
1184 weight:
1185 description: Weight in pounds
1186 minimum: 0
1187 nullable: true
1188 type: integer
1189 zipCode:
1190 description: Sleeper zip code
1191 maxLength: 60
1192 nullable: true
1193 type: string
1194 required:
1195 - accountId
1196 - active
1197 - bedId
1198 - birthYear
1199 - emailValidated
1200 - isChild
1201 - isAccountOwner
1202 - firstName
1203 - height
1204 - lastLogin
1205 - licenseVersion
1206 - side
1207 - sleeperId
1208 - sleepGoal
1209 - timezone
1210 - username
1211 - weight
1212 - zipCode
1213 - email
1214 type: object
1215 - properties:
1216 gender:
1217 enum:
1218 - 0
1219 - 1
1220 - 2
1221 - 9
1222 type: integer
1223 required:
1224 - gender
1225 required:
1226 - sleeper
1227 type: object
1228 description: Success
1229 '401':
1230 description: Unauthorized - The session has expired. Need to re-login.
1231 '403':
1232 description: Forbidden - The credentials do not allow access to this area.
1233 '404':
1234 description: Not Found - The requested resource is not found by the given
1235 parameters.
1236 summary: Get Sleepers
1237 x-amazon-apigateway-integration:
1238 httpMethod: GET
1239 passthroughBehavior: when_no_match
1240 requestParameters:
1241 integration.request.path.sleeperId: method.request.path.sleeperId
1242 responses:
1243 default:
1244 statusCode: '200'
1245 type: http_proxy
1246 uri: https://circle1-api.circle.siq.sleepnumber.com/rest/sleeper/{sleeperId}
1247 put:
1248 description: Update the details of a sleeper. All fields are optional and only
1249 the passed in fields will be changed. There are some special behavior around
1250 email and password fields. Populating these fields allows the user to have
1251 their own login. These are not required. If no email and password are present
1252 and these fields are passed in, a new login will be created. The user will
1253 be sent and email for verification. Until the login is verified, the emailValidated
1254 field in the sleeper object will be false. See Get Sleeper. Once the email
1255 has been verified, the emailValidated will be set to true. If there is a
1256 login for a particular sleeper, and a new password is password is passed in,
1257 the password will be updated. If a new email is passed in, then an email
1258 will be sent to the user to validate the new email. To cancel the process
1259 of changing an email before it has been validated, use the Cancel Email Change
1260 API.
1261 parameters:
1262 - description: Sleeper ID to update sleeper details
1263 in: path
1264 name: sleeperId
1265 required: true
1266 schema:
1267 description: Unique id of sleeper
1268 example: '-9223372036639592694'
1269 maxLength: 20
1270 pattern: ^-[1-9][0-9]*$
1271 type: string
1272 requestBody:
1273 content:
1274 application/json:
1275 schema:
1276 properties:
1277 active:
1278 example: true is active
1279 type: boolean
1280 avatar:
1281 type: string
1282 bedId:
1283 description: Unique id of bed
1284 example: '-9223372036639946127'
1285 maxLength: 20
1286 pattern: ^-([1-9][0-9]*)$|^0$
1287 type: string
1288 birthYear:
1289 example: '2017'
1290 type: string
1291 email:
1292 type: string
1293 firstName:
1294 type: string
1295 height:
1296 type: integer
1297 isAccountOwner:
1298 type: boolean
1299 isMale:
1300 type: boolean
1301 password:
1302 type: string
1303 side:
1304 example: 0 - left, 1 - right
1305 maximum: 1
1306 minimum: 0
1307 type: integer
1308 sleepGoal:
1309 type: integer
1310 timeZone:
1311 type: string
1312 weight:
1313 type: integer
1314 zipCode:
1315 nullable: true
1316 type: string
1317 type: object
1318 required: true
1319 responses:
1320 '200':
1321 content:
1322 application/json:
1323 schema:
1324 example: '{ }'
1325 type: object
1326 description: Success
1327 '400':
1328 description: Bad Request - A parameter is missing or invalid.
1329 '401':
1330 description: Unauthorized - The session has expired. Need to re-login.
1331 '403':
1332 description: Forbidden - The credentials do not allow access to this area.
1333 '404':
1334 description: Not Found - The requested resource is not found by the given
1335 parameters.
1336 summary: Update Sleeper
1337 x-amazon-apigateway-integration:
1338 httpMethod: PUT
1339 passthroughBehavior: when_no_match
1340 requestParameters:
1341 integration.request.path.sleeperId: method.request.path.sleeperId
1342 responses:
1343 default:
1344 statusCode: '200'
1345 type: http_proxy
1346 uri: https://circle1-api.circle.siq.sleepnumber.com/rest/sleeper/{sleeperId}
1347 /rest/sleeper/{sleeperId}/profile:
1348 get:
1349 description: Get a sleeper profile. A sleeper profile contains all time sleep
1350 data statistics for a sleeper
1351 parameters:
1352 - description: Sleeper ID to get a sleeper's profile
1353 in: path
1354 name: sleeperId
1355 required: true
1356 schema:
1357 description: Unique id of sleeper
1358 example: '-9223372036639592694'
1359 maxLength: 20
1360 pattern: ^-[1-9][0-9]*$
1361 type: string
1362 responses:
1363 '200':
1364 content:
1365 application/json:
1366 schema:
1367 properties:
1368 sleeperProfile:
1369 description: All time sleep data statistics for a sleeper. These
1370 are calculated from the longest sleep sessions in a day.
1371 properties:
1372 bedExitAvg:
1373 description: All time average number of bed exits per sleep
1374 session
1375 type: integer
1376 bedExitMax:
1377 description: All time highest number of bed exits in a sleep
1378 session
1379 type: integer
1380 firstSessionRecorded:
1381 description: Date of first recorded sleep session in ISO8601
1382 format. Default = null when no session recorded yet.
1383 type: string
1384 heartRateAvg:
1385 description: All time average of daily average heart rates
1386 type: integer
1387 heartRateMax:
1388 description: All time highest average heart rate over a session
1389 type: integer
1390 inBedAvg:
1391 description: All time average amount of time in bed in a sleep
1392 session (in minutes)
1393 type: integer
1394 inBedMax:
1395 description: All time highest amount of time in bed in a sleep
1396 session (in minutes). Includes time before Time To Fall
1397 Alseep (TTFA).
1398 type: integer
1399 inBedTotal:
1400 description: All time amount of time in bed (in minutes). Includes
1401 time before Time To Fall Alseep (TTFA).
1402 type: integer
1403 respirationRateAvg:
1404 description: All time average of daily average respiratory
1405 rates
1406 type: integer
1407 respirationRateMax:
1408 description: All time highest average respiration rate over
1409 a session
1410 type: integer
1411 restfulAvg:
1412 description: All time average amount of restful time in a
1413 sleep session (in minutes)
1414 type: integer
1415 restfulMax:
1416 description: All time highest amount of restful time in a
1417 sleep session (in minutes)
1418 type: integer
1419 restlessAvg:
1420 description: All time average amount of restless time in a
1421 sleep session (in minutes)
1422 type: integer
1423 restlessMax:
1424 description: All time highest amount of restless time in a
1425 sleep session (in minutes)
1426 type: integer
1427 restlessMin:
1428 description: All time lowest amount of restless time in a
1429 sleep session (in minutes)
1430 type: integer
1431 sleepIQAvg:
1432 description: All time average sleepIQ score
1433 type: integer
1434 sleepIQAvgBySN:
1435 description: List of all time average sleepIQ scores for each
1436 sleep number
1437 items:
1438 properties:
1439 sleepIQAvg:
1440 maximum: 100
1441 minimum: 0
1442 type: integer
1443 sleepNumber:
1444 maximum: 100
1445 minimum: 0
1446 type: integer
1447 required:
1448 - sleepIQAvg
1449 - sleepNumber
1450 type: object
1451 type: array
1452 sleepIQMax:
1453 description: All time highest sleepIQ score
1454 type: integer
1455 sleepSessionCount:
1456 description: All time session count
1457 type: integer
1458 sleeperId:
1459 description: Unique id of sleeper
1460 example: '-9223372036639592694'
1461 maxLength: 20
1462 pattern: ^-[1-9][0-9]*$
1463 type: string
1464 required:
1465 - bedExitAvg
1466 - bedExitMax
1467 - heartRateAvg
1468 - heartRateMax
1469 - inBedAvg
1470 - inBedMax
1471 - inBedTotal
1472 - respirationRateAvg
1473 - respirationRateMax
1474 - restfulAvg
1475 - restfulMax
1476 - restlessAvg
1477 - restlessMax
1478 - restlessMin
1479 - sleepIQAvg
1480 - sleepIQAvgBySN
1481 - sleepIQMax
1482 - sleepSessionCount
1483 - sleeperId
1484 - firstSessionRecorded
1485 type: object
1486 type: object
1487 description: Success
1488 '401':
1489 description: Unauthorized - The session has expired. Need to re-login.
1490 '403':
1491 description: Forbidden - The credentials do not allow access to this area.
1492 '404':
1493 description: Not Found - The requested resource is not found by the given
1494 parameters.
1495 '405':
1496 description: Method Not Allowed - Invalid method parameters.
1497 summary: Get Sleeper Profile
1498 x-amazon-apigateway-integration:
1499 httpMethod: GET
1500 passthroughBehavior: when_no_match
1501 requestParameters:
1502 integration.request.path.sleeperId: method.request.path.sleeperId
1503 responses:
1504 default:
1505 statusCode: '200'
1506 type: http_proxy
1507 uri: https://circle1-api.circle.siq.sleepnumber.com/rest/sleeper/{sleeperId}/profile
1508servers:
1509- url: https://circle1-api.circle.siq.sleepnumber.com