Repository navigation
Expand file tree
/
Copy pathopenapi.yaml
More file actions
1614 lines (1614 loc) · 46 KB
/
Copy pathopenapi.yaml
File metadata and controls
1614 lines (1614 loc) · 46 KB
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
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
openapi: 3.0.0
info:
title: Intra 42 API
description: |
This is the OpenAPI specification for the Intra 42 API v2.
version: 2.0.0
servers:
- url: https://api.intra.42.fr/v2
description: Production
paths:
/closes:
get:
operationId: getCloses
summary: Get a list of closes
security:
- OAuth2:
- public
parameters:
- name: sort
in: query
description: |
The sort field. Sorted by created_at desc, id desc by default.
Must be one of: id, user_id, closer_id, reason, state, created_at, updated_at, kind, end_at, jid.
required: false
schema:
type: string
enum:
- id
- user_id
- closer_id
- reason
- state
- created_at
- updated_at
- kind
- end_at
- jid
- name: filter
in: query
description: |
Filtering on one or more fields. Must be one of: id, user_id, closer_id, reason, state, created_at, updated_at, kind, end_at, jid, campus_id, end.
required: false
schema:
type: object
additionalProperties:
type: string
style: deepObject
explode: true
- name: range
in: query
description: |
Select on a particular range. Must be one of: id, user_id, closer_id, reason, state, created_at, updated_at, kind, end_at, jid.
required: false
schema:
type: object
additionalProperties:
type: string
style: deepObject
explode: true
- $ref: '#/components/parameters/page'
- $ref: '#/components/parameters/per_page'
- $ref: '#/components/parameters/page_number'
- $ref: '#/components/parameters/page_size'
responses:
'200':
description: A list of closes
content:
application/json:
schema:
type: array
items:
$ref: '#/components/schemas/CloseResponse'
default:
$ref: '#/components/responses/ErrorResponse'
/closes/{id}:
get:
operationId: getCloseById
summary: Get a close by ID
security:
- OAuth2:
- public
parameters:
- name: id
in: path
required: true
description: The ID of the close
schema:
type: integer
responses:
'200':
description: A close object
content:
application/json:
schema:
$ref: '#/components/schemas/CloseResponse'
default:
$ref: '#/components/responses/ErrorResponse'
/internships:
get:
operationId: getInternships
summary: Get a list of internships
security:
- OAuth2:
- public
parameters:
- name: sort
in: query
description: |
The sort field. Sorted by id desc by default.
Must be one of: id, user_id, administration_id, offer_id, language_id, state, days, user_address, user_postal, user_city, user_country, company_name, company_boss_user_first_name, company_boss_user_last_name, company_boss_user_email, company_boss_user_phone, company_user_first_name, company_user_last_name, company_user_post, company_user_email, company_user_phone, company_address, company_postal, company_city, company_country, company_siret, internship_address, internship_postal, internship_city, internship_country, contract_type, subject, start_at, end_at, duration, nb_days, nb_hours, movement, salary, currency, breach_at, convention, created_at, updated_at, anti_grav_units_user_id.
Example: -updated_at,anti_grav_units_user_id (to sort by updated_at descending and anti_grav_units_user_id ascending)
required: false
schema:
type: string
- name: filter
in: query
description: |
Filtering on one or more fields.
Must be one of: id, user_id, administration_id, offer_id, language_id, state, days, user_address, user_postal, user_city, user_country, company_name, company_boss_user_first_name, company_boss_user_last_name, company_boss_user_email, company_boss_user_phone, company_user_first_name, company_user_last_name, company_user_post, company_user_email, company_user_phone, company_address, company_postal, company_city, company_country, company_siret, internship_address, internship_postal, internship_city, internship_country, contract_type, subject, start_at, end_at, duration, nb_days, nb_hours, movement, salary, currency, breach_at, convention, created_at, updated_at, anti_grav_units_user_id.
Example: filter[id]=a_value,another_value (to filter on internships with id matching a_value or another_value)
required: false
schema:
type: object
additionalProperties:
type: string
style: deepObject
explode: true
- name: range
in: query
description: |
Select on a particular range.
Must be one of: id, user_id, administration_id, offer_id, language_id, state, days, user_address, user_postal, user_city, user_country, company_name, company_boss_user_first_name, company_boss_user_last_name, company_boss_user_email, company_boss_user_phone, company_user_first_name, company_user_last_name, company_user_post, company_user_email, company_user_phone, company_address, company_postal, company_city, company_country, company_siret, internship_address, internship_postal, internship_city, internship_country, contract_type, subject, start_at, end_at, duration, nb_days, nb_hours, movement, salary, currency, breach_at, convention, created_at, updated_at.
Example: range[status]=min_value,max_value (to range on internships with status field between min_value and max_value)
required: false
schema:
type: object
additionalProperties:
type: string
style: deepObject
explode: true
- $ref: '#/components/parameters/page'
- $ref: '#/components/parameters/per_page'
- $ref: '#/components/parameters/page_number'
- $ref: '#/components/parameters/page_size'
responses:
'200':
description: A list of internships
headers:
Link:
$ref: '#/components/headers/Link'
X-Page:
$ref: '#/components/headers/X-Page'
X-Per-Page:
$ref: '#/components/headers/X-Per-Page'
X-Total:
$ref: '#/components/headers/X-Total'
content:
application/json:
schema:
type: array
items:
$ref: '#/components/schemas/InternshipResponse'
default:
$ref: '#/components/responses/ErrorResponse'
/languages/{id}:
get:
operationId: getLanguageById
summary: Get a language by ID
security:
- OAuth2:
- public
parameters:
- name: id
in: path
required: true
description: The ID of the language
schema:
type: integer
responses:
'200':
description: A language object
content:
application/json:
schema:
$ref: '#/components/schemas/LanguageResponse'
default:
$ref: '#/components/responses/ErrorResponse'
/users:
get:
operationId: getUsers
summary: Get a list of users
security:
- OAuth2:
- public
parameters:
- name: sort
in: query
description: |
The sort field. Sorted by id desc by default.
Must be one of: id, login, email, encrypted_password, reset_password_token, reset_password_sent_at, created_at, updated_at, image, first_name, last_name, pool_year, pool_month, kind, status, otp_secret_key, otp_tmp, otp_activated, otp_backup_passwords, slack_team, slack_login, slack_mail, slack_code_validation, slack_validated_at, token_id, email_stop, linked_user_id, usual_first_name, last_seen_at, password_changed_at, encrypted_single_usage_password, first_warn_anon_sent_at, second_warn_anon_sent_at, alumnized_at, anonymized_at.
Example: -alumnized_at,anonymized_at (to sort on alumnized_at descending and anonymized_at ascending)
required: false
schema:
type: string
- name: filter
in: query
description: |
Filtering on one or more fields.
Must be one of: id, login, email, created_at, updated_at, pool_year, pool_month, kind, status, primary_campus_id, first_name, last_name, alumni?, staff?.
Example: filter[id]=a_value,another_value (to filter on users with id matching a_value or another_value)
required: false
schema:
type: object
additionalProperties:
type: string
style: deepObject
explode: true
- name: range
in: query
description: |
Select on a particular range.
Must be one of: id, login, email, created_at, updated_at, pool_year, pool_month, kind, status.
Example: range[status]=min_value,max_value (to range on users with status field between min_value and max_value)
required: false
schema:
type: object
additionalProperties:
type: string
style: deepObject
explode: true
- $ref: '#/components/parameters/page'
- $ref: '#/components/parameters/per_page'
- $ref: '#/components/parameters/page_number'
- $ref: '#/components/parameters/page_size'
responses:
'200':
description: A list of users
headers:
Link:
$ref: '#/components/headers/Link'
X-Page:
$ref: '#/components/headers/X-Page'
X-Per-Page:
$ref: '#/components/headers/X-Per-Page'
X-Total:
$ref: '#/components/headers/X-Total'
content:
application/json:
schema:
type: array
items:
$ref: '#/components/schemas/LightUserResponse'
default:
$ref: '#/components/responses/ErrorResponse'
/users/{id}:
get:
operationId: getUserById
summary: Get a user by ID
security:
- OAuth2:
- public
parameters:
- name: id
in: path
required: true
description: The ID of the user
schema:
type: string
responses:
'200':
description: A user object
content:
application/json:
schema:
$ref: '#/components/schemas/UserResponse'
default:
$ref: '#/components/responses/ErrorResponse'
/users/{id}/user_candidature:
get:
operationId: getUserCandidatureById
summary: Get user candidature information
security:
- OAuth2:
- public
parameters:
- name: id
in: path
required: true
description: The ID of the user
schema:
type: string
responses:
'200':
description: User candidature information
content:
application/json:
schema:
$ref: '#/components/schemas/UserCandidatureResponse'
default:
$ref: '#/components/responses/ErrorResponse'
/users/{user_id}/closes:
get:
operationId: getClosesByUserId
summary: Get a list of closes by user id
security:
- OAuth2:
- public
parameters:
- name: user_id
in: path
required: true
description: The user id
schema:
type: integer
- name: sort
in: query
description: |
The sort field. Sorted by created_at desc, id desc by default.
Must be one of: id, user_id, closer_id, reason, state, created_at, updated_at, kind, end_at, jid.
required: false
schema:
type: string
enum:
- id
- user_id
- closer_id
- reason
- state
- created_at
- updated_at
- kind
- end_at
- jid
- name: filter
in: query
description: |
Filtering on one or more fields. Must be one of: id, user_id, closer_id, reason, state, created_at, updated_at, kind, end_at, jid, campus_id, end.
required: false
schema:
type: object
additionalProperties:
type: string
style: deepObject
explode: true
- name: range
in: query
description: |
Select on a particular range. Must be one of: id, user_id, closer_id, reason, state, created_at, updated_at, kind, end_at, jid.
required: false
schema:
type: object
additionalProperties:
type: string
style: deepObject
explode: true
- $ref: '#/components/parameters/page'
- $ref: '#/components/parameters/per_page'
- $ref: '#/components/parameters/page_number'
- $ref: '#/components/parameters/page_size'
responses:
'200':
description: A list of closes
content:
application/json:
schema:
type: array
items:
$ref: '#/components/schemas/CloseResponse'
default:
$ref: '#/components/responses/ErrorResponse'
components:
schemas:
AchievementResponse:
type: object
properties:
id:
type: integer
name:
type: string
description:
type: string
tier:
type: string
kind:
type: string
visible:
type: boolean
image:
type: string
nbr_of_success:
type: integer
nullable: true
users_url:
type: string
format: uri
required:
- id
- name
- description
- tier
- kind
- visible
- image
- users_url
CampusResponse:
type: object
properties:
id:
type: integer
name:
type: string
time_zone:
type: string
language:
$ref: '#/components/schemas/LanguageResponse'
users_count:
type: integer
vogsphere_id:
type: integer
country:
type: string
address:
type: string
zip:
type: string
city:
type: string
website:
type: string
format: uri
facebook:
type: string
format: uri
twitter:
type: string
format: uri
active:
type: boolean
public:
type: boolean
email_extension:
type: string
default_hidden_phone:
type: boolean
required:
- id
- name
- time_zone
- users_count
- vogsphere_id
- country
- city
- active
- public
- email_extension
CampusUserResponse:
type: object
properties:
id:
type: integer
user_id:
type: integer
campus_id:
type: integer
is_primary:
type: boolean
created_at:
type: string
format: date-time
updated_at:
type: string
format: date-time
required:
- id
- user_id
- campus_id
- is_primary
- created_at
- updated_at
CloseResponse:
type: object
properties:
id:
type: integer
reason:
type: string
state:
type: string
created_at:
type: string
format: date-time
updated_at:
type: string
format: date-time
end_at:
type: string
format: date-time
nullable: true
community_services:
type: array
items:
$ref: '#/components/schemas/CommunityServiceResponse'
nullable: false
kind:
type: string
enum:
- agu
- other
- deserter
- pace_unknown
- black_hole
- serious_misconduct
- social_security
- non_admitted
user:
$ref: '#/components/schemas/LightUserResponse'
closer:
$ref: '#/components/schemas/LightUserResponse'
required:
- id
- reason
- state
- created_at
- updated_at
- community_services
- user
- closer
- kind
CommunityServiceResponse:
type: object
properties:
id:
type: integer
duration:
type: integer
schedule_at:
type: string
format: date-time
occupation:
type: string
state:
type: string
created_at:
type: string
format: date-time
updated_at:
type: string
required:
- id
- duration
- schedule_at
- occupation
- state
- created_at
- updated_a
CursusResponse:
type: object
properties:
id:
type: integer
created_at:
type: string
format: date-time
name:
type: string
slug:
type: string
kind:
type: string
required:
- id
- created_at
- name
- slug
- kind
CursusUserResponse:
type: object
properties:
id:
type: integer
begin_at:
type: string
format: date-time
end_at:
type: string
format: date-time
grade:
type: string
level:
type: number
format: double
skills:
type: array
items:
$ref: '#/components/schemas/SkillResponse'
cursus_id:
type: integer
cursus:
$ref: '#/components/schemas/CursusResponse'
has_coalition:
type: boolean
blackholed_at:
type: string
format: date-time
nullable: true
created_at:
type: string
format: date-time
updated_at:
type: string
format: date-time
required:
- id
- begin_at
- grade
- level
- cursus_id
- cursus
- has_coalition
- created_at
- updated_at
- skills
Error:
type: object
properties:
status:
type: integer
description: HTTP status code
error:
type: string
description: Error message
required:
- status
- error
example:
status: 401
error: The access token is invalid
GroupResponse:
type: object
properties:
id:
type: integer
name:
type: string
required:
- id
- name
InternshipResponse:
type: object
properties:
id:
type: integer
administration_id:
type: integer
offer_id:
type: integer
nullable: true
language_id:
type: integer
state:
type: string
days:
type: string
user_address:
type: string
user_postal:
type: string
user_city:
type: string
user_country:
type: string
company_name:
type: string
company_boss_user_first_name:
type: string
company_boss_user_last_name:
type: string
company_boss_user_email:
type: string
company_boss_user_phone:
type: string
company_user_first_name:
type: string
company_user_last_name:
type: string
company_user_post:
type: string
company_user_email:
type: string
company_user_phone:
type: string
company_address:
type: string
company_postal:
type: string
company_city:
type: string
company_country:
type: string
company_siret:
type: string
internship_address:
type: string
internship_postal:
type: string
internship_city:
type: string
internship_country:
type: string
contract_type:
type: string
subject:
type: string
start_at:
type: string
format: date-time
end_at:
type: string
format: date-time
duration:
type: integer
nb_days:
type: integer
nb_hours:
type: integer
salary:
anyOf:
- type: integer
- type: number
currency:
type: string
breach_at:
type: string
format: date-time
nullable: true
convention:
type: object
properties:
convention:
type: object
properties:
url:
type: string
nullable: true
required:
- url
required:
- convention
convention_uri:
type: string
format: url
nullable: true
projects_user:
type: integer
nullable: true
user:
$ref: '#/components/schemas/LightUserResponse'
required:
- id
- administration_id
- offer_id
- language_id
- state
- days
- user_address
- user_postal
- user_city
- user_country
- company_name
- company_boss_user_first_name
- company_boss_user_last_name
- company_boss_user_email
- company_boss_user_phone
- company_user_first_name
- company_user_last_name
- company_user_post
- company_user_email
- company_user_phone
- company_address
- company_postal
- company_city
- company_country
- company_siret
- internship_address
- internship_postal
- internship_city
- internship_country
- contract_type
- subject
- start_at
- end_at
- duration
- nb_days
- nb_hours
- salary
- currency
- breach_at
- convention
- convention_uri
- user
IntraDateTime:
type: string
format: date-time
example: '2017-03-25T13:30:00.000Z'
x-go-type: IntraTime
LanguageResponse:
type: object
properties:
id:
type: integer
name:
type: string
identifier:
type: string
created_at:
type: string
format: date-time
updated_at:
type: string
format: date-time
required:
- id
- name
- identifier
- created_at
- updated_at
LanguageUserResponse:
type: object
properties:
id:
type: integer
language_id:
type: integer
user_id:
type: integer
position:
type: integer
created_at:
type: string
format: date-time
required:
- id
- language_id
- user_id
- position
- created_at
LightUserResponse:
type: object
properties:
id:
type: integer
description: The unique identifier of the user.
login:
type: string
description: The login name of the user.
first_name:
type: string
description: The first name of the user.
usual_first_name:
type: string
description: The usual first name of the user, first_name if none.
nullable: true
usual_full_name:
type: string
description: The usual full name of the user, usually usual_first_name or first_name + last_name.
last_name:
type: string
description: The last name of the user.
email:
type: string
description: The email address of the user.
url:
type: string
format: uri
description: The URL to the user's resource.
phone:
type: string
description: The phone number of the user (always hidden).
displayname:
type: string
description: The display name of the user.
kind:
type: string
description: The kind of user (e.g., student, admin, external).
enum:
- student
- admin
- external
image:
$ref: '#/components/schemas/UserImageResponse'
staff?:
type: boolean
description: Indicates if the user is staff.
correction_point:
type: integer
description: The user's correction points.
pool_month:
type: string
description: The month of the user's pool.
pool_year:
type: string
description: The year of the user's pool.
location:
type: string
description: The location of the user.
nullable: true
wallet:
type: integer
description: The user's wallet balance.
anonymize_date:
type: string
format: date-time
description: The date when user data will be anonymized.
data_erasure_date:
type: string
format: date-time
description: The date when user data will be erased.
created_at:
type: string
format: date-time
description: The user creation timestamp.
updated_at:
type: string
format: date-time
description: The last user update timestamp.
alumnized_at:
type: string
format: date-time
description: The date when the user became an alumnus.
nullable: true
alumni?:
type: boolean
description: Indicates if the user is an alumnus.
active:
type: boolean
description: Indicates if the user is active.
required:
- id
- login
- first_name
- last_name
- usual_full_name
- email
- url
- displayname
- kind
- correction_point
- pool_month
- pool_year
- wallet
- anonymize_date
- data_erasure_date
- created_at
- updated_at
- alumni?
- active
example:
id: 39962
email: malallai@student.42.fr
login: malallai
first_name: Malo
last_name: Allain
usual_full_name: Malo Allain
usual_first_name: null
url: https://api.intra.42.fr/v2/users/malallai
phone: hidden
displayname: Malo Allain
kind: student
image:
link: https://cdn.intra.42.fr/users/39a641ed152b654cfbff5c5864eb05c1/malallai.jpg
versions:
large: https://cdn.intra.42.fr/users/a818d7a54298d333411557d0b55b61b3/large_malallai.jpg
medium: https://cdn.intra.42.fr/users/53691acd1e0ea75b782ddbe121c17423/medium_malallai.jpg
small: https://cdn.intra.42.fr/users/617de91b59fd7e59ecaf6470a4b37645/small_malallai.jpg
micro: https://cdn.intra.42.fr/users/6f74b46e2016b0e6c41fa05b5952e17c/micro_malallai.jpg
staff: false
correction_point: 4
pool_month: august
pool_year: '2018'
location: null
wallet: 290
anonymize_date: '2025-10-24T00:00:00.000+02:00'
data_erasure_date: '2025-10-24T00:00:00.000+02:00'
created_at: '2018-07-17T08:57:33.128Z'
updated_at: '2022-09-27T18:48:28.207Z'
alumnized_at: null
alumni?: false
active: true
PatronageResponse:
type: object
properties:
id:
type: integer
user_id:
type: integer
godson_id:
type: integer
godfather_id:
type: integer
ongoing: