-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathNOTES
92 lines (64 loc) · 5.33 KB
/
NOTES
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
YOUFIE.IO PUBLIC API SPEC V0.1
https://youfie.io/api/v1/users/<user_id>/# {POST}
- curl -XPOST -d '{"email": "trevor@youfie.io", "password": "youfie"}'
-> logs a user in, returns a JWT
https://youfie.io/api/v1/users/<user_id>/logout {POST}
- curl -XPOST -H "Authorization: Bearer <JWT>"
-> logs out of the current account, blacklisting the user's current JWT
https://youfie.io/api/v1/users/<user_id> {GET,POST}
- curl -XGET -H "Authorization: Bearer <JWT>"
-> retrieve the user's info
- curl -XPOST -d '{"email": "trevor@youfie.io", "password": "youfie", "display_name": "trevor"}'
-> if `user_id` is present, attempts to create a new account with the supplied `user_id` (UUIDv4)
-> if `user_id` is not present, attempts to create a new account with a `user_id` generated by the API.
https://youfie.io/api/v1/users/<user_id>/block {POST, DELETE}
- curl -XPOST -H "Authorization: Bearer <JWT>"
-> block the unblocked user
- curl -XDELETE -H "Authorization: Bearer <JWT>"
-> unblock the blocked user
https://youfie.io/api/v1/users/<user_id>/location {POST}
- curl -XPOST -h "Authorization: Bearer <JWT>" -d '{"latitude": "42.2838348", "longitude": "-72.38348"}'
-> updates the current user's location
https://youfie.io/api/v1/users/<user_id>/photos/<photo_id> {GET, POST, DELETE}
- curl -XGET -H "Authorization: Bearer <JWT>"
-> retrieves the metadata associated with a particular photo
-> if `photo_id` is not supplied, returns a paginated list of a user's photos
- curl -XPOST -H "Authorization: Bearer <JWT>" -d '{"latitude": "83.8181", "longitude": "-72.28348", "photo_url": "https://00e9e64bac5d133e969971b6df7c7666eb30f91750bac21c23-apidata.googleusercontent.com/download/storage/v1/b/youfie-983ce.appspot.com/o/images%2F79f75ea5-f4f8-44ac-b7a1-6a45e6405824.png?qk=AD5uMEvy-161KwbX3pqQjGYpVbhb3AhjrUbCr9ENojAeqQlw-zSwdLD_nlBrNrk7sYMYuJ6vButnMvkfXiNyXSg4dR2SoY-e3tOjMQiPad3vyAB4OGEkudChYbGfC65U1fN31pLPEgKfjrGRkFKbOt9cLhMwSzD8nGjzRmv323S4Qk9FH_3t2BgCyer_JSavvKgAABC3T8mjXfNTVBHEfu5uiKBitji2FE6KdHZH3NGSNt834-Q7GMHZm9DbF8F4owZlq0NxOr1KW2LfLoWdqp4MX8W72wvEBApSQITvl5OVrQoOaZS1hnmbLWCdtehU9M6ejfxA4WOgGwROFrIqOlhBKMqYDPreIFP3y983lNzI9DMM1EHVOEkpNN1p5ZyRjxuEGAMsY6KkRIYiJvDO4lj2ZO1-zWgW3IDpbQOwX93P6BhpDAmJCArdjm87FBZsqeR9dp21ruwerr9Hz5LWcjRM0EZ4eVEtcwscLu2SyPjAMqvv7Ofb7CrESF6Z8sFVwQrt1F2Hr04wMSthdqZWn87iAaVJ8Riya0BqDeaY6TSvp75rlBSBT5MY_OPkQBe3NmZqeNlPzdoxYlATnG-2npZUBxhrh7dXu16mTCXRG6mpJ4RzcatEhNEuQYktcL3BKYwdKB0pZUtIZAjsQjgAdOEz0KNFzlWcT9Pfm3IFwh_9yGrYEYYKn5KDcyVOJRSON6W0FgR74w3XdZTJpkhniIaJdVOZT8UCyB0qjuqdUxEOI4eNZVr-jjQZ1lLOQtTMxgXdhwGV6Hc0CEvpNzy-8o1SrOCzc7ZRspvZg2givwDTHUTVThAm-UQ46h68DsymObHVUlEEWZb2e3wN16WHmhdZY1e-o8KsRg"}'
-> posts a photo via URL
-> if `photo_id` is supplied, the API will ignore it
- curl -XDELETE -H "Authorization: Bearer <JWT>"
-> deletes a photo owned by the user
-> `photo_id` required
https://youfie.io/api/v1/users/<user_id>/photos/<photo_id>/faces/<face_id> {GET, POST, DELETE}
-curl -XGET -H "Authorization: Bearer <JWT>"
-> retrieves a list of all faces found within a photo: `[known_user_id, [possible matched user_ids], top_left_corner_x, top_left_corner_y, bottom_right_corner_x, bottom_right_corner_y]`
-curl -XPOST -H "Authorization: Bearer <JWT>" -d '{"face_id": "3de2128d-1ed7-424a-b323-73a251f20943", "user_id": "71d94454-4a3a-4b9f-ae2e-1079c62187f1"}'
-> matches a face to a known user (this is useful if the user takes a photo of someone and wants to identify the target from a list of possible targets)
-> the photographer can only tag faces that are supplied in the list of possible matches
-> if a user contained within the list of possible matches is in the photo, he/she can self-identify their face
-curl -XDELETE -H "Authorization: Bearer <JWT>"
-> only the photographer and the currently identified user are allowed to delete a matched face
https://youfie.io/api/v1/<user_id>/matches/<match_id>?confirmed=true|false {GET, PUT, DELETE}
- curl -XGET -H "Authorization: Bearer <JWT>"
- if `match_id` is not supplied, returns a paginated list of all possible matches for the current user
- if `match_id` is present, returns a single match's metadata
- curl -XPUT -H "Authorization: Bearer <JWT>" -d '{"confirmed": "true"}'
- `match_id` is required
- marks a possible match as a confirmed match
- curl -XDELETE -H "Authorization: Bearer <JWT>"
- `match_id` is required
- deletes a match (confirmed match or possible match)
https://youfie.io/api/v1/conversations/<user_id> {GET, POST, DELETE}
- curl -XGET -H "Authorization: Bearer <JWT>"
- if `user_id` is present, returns a paginated list of messages between the current user and `user_id`.
- if `user_id` is not supplied, returns a paginated list of metadata for each conversation the current user owns.
- curl -XPOST -H "Authorization: Bearer <JWT>" -d '{"message_text": "hey, I love youfie!"}'
- `user_id` is required
- sends a message to `user_id`
- curl -XDELETE -H "Authorization: Bearer <JWT>"
- `user_id` is required
- deletes all messages between the current user and `user_id`.
TODO:
- VOUCH PROTOCOL
- REFRESH TOKEN
- UPDATE USER DETAILS {password, email address, etc}