-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathapiary.apib
2608 lines (2276 loc) · 92.2 KB
/
apiary.apib
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
FORMAT: 1A
HOST: https://api.civil.services/v1
# API

Civil Services is a collection of tools that make it possible for citizens to be a part of what is happening in their Local, State & Federal Governments.
* _Maintained By:_ __[Peter Schmalfeldt](mailto:[email protected])__
* _Last Modified:_ __February 24th, 2017__
* _Current API Version:_ __v1.0.0__
__IMPORTANT:__ Currently, our API is only open for select non-commercial use. If you are interested in obtaining an API Key ( required for access ), please contact [[email protected]](mailto:[email protected]) or [Join us on Slack](https://slack.civil.services/bkx7n2).
[](http://docs.civilservices.apiary.io)
## Join us on Slack
__[Join us on Slack](https://slack.civil.services/bkx7n2)__ if you need help using our API, or you are interested in contributing.
[](https://slack.civil.services/bkx7n2)
# Group API Basics
## API Overview
Our API has a default Rate Limit by IP Address to `2500` calls per day. We add the following headers so you can monitor your API Rate:
* __X-Rate-Limit-Limit__: The rate limit ceiling for that given request
* __X-Rate-Limit-Remaining__: The number of requests left for the 24 hour window
* __X-Rate-Limit-Reset__: The remaining window before the rate limit resets in UTC [epoch seconds](http://en.wikipedia.org/wiki/Unix_time)
If a specific IP Address exceeds this limit, the API will return a 429 HTTP JSON Response Error. A sample of this is provided in the Artwork API endpoint.
## API Authentication
Our API requires an API Key to use. We are not providing API Keys to the general public at this time. You likely received an API Key before accessing this documentation, if not, please contact the individual who sent you here.
## You can set the API Key one of two ways
#### Request Header:
* __API-Key__ `243CEA2E-7E63-D2C4-3D2D-1A114288274B` _( this is not an actual API Key )_
#### GET Parameter:
* __?apikey=__ `243CEA2E-7E63-D2C4-3D2D-1A114288274B`
### HTTP Request Method Limits
### Common API Responses
The following parameters are available on every API endpoint and used for pagination
for if there are a lot of results.
+ `error` (boolean) - Whether or not there were errors in the API call.
+ `errors` (array) - An array of general errors.
+ `field_errors` (object) - If the error was in regards to data entry, any errors specific to an input field will return here with the input name and error message.
+ `meta` (object) - The META data object that contains the basic information about the API response.
+ `meta.total` (number) - Total number of all results. Not just the number returned in the API call.
+ `meta.showing` (number) - Number of results returned in the current API call ( may be less than total results ).
+ `meta.pages` (number) - Number of pages of results. This is based on the `total` results divided by the `pageSize`.
+ `meta.page` (number) - Current Page
+ `data` (object or array) - This is the the actual data returned for the API call. For API calls that are expected to return a single result, the `data` will be an Object. For API calls that are expecting multiple items returned, `data` will be returned as an array ( even if there is only one item returned, such as search results, etc ).
__Response 200:__ (application/json)
{
"error": false,
"errors": [],
"field_errors": {},
"meta": {
"total": 97,
"showing": 30,
"pages": 4,
"page": 1
},
"data": [
...
]
}
__Response 403:__ (application/json)
{
"error": true,
"errors": ["Missing API Key"],
"field_errors": {},
"meta": {
"total": 0,
"showing": 0,
"pages": 1,
"page": 1
},
"data": []
}
### Optional API Params
The following parameters are available on every API endpoint and used for pagination
for if there are a lot of results.
+ `pageSize` (number, optional) - How many results to return in a single API call. Defaults to 30
+ `page` (number, optional) - If there is more than one page of results, you can set which page to load here
+ `pretty` (optional) - If you want to format the JSON response to be human readable, just add a `pretty` param in the API call ( it does not need a value )
### Request Authorization Header
* __Authorization:__ Bearer `token`
An example API Header would look like this:
```
curl --data '' https://api.civil.services/v1/user/refresh/ -H "Authorization: Bearer eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJ1c2VySWQiOiIyIiwiaWF0IjoxNDUxNzEyNzg0LCJleHAiOjE0NTIzMTc1ODQsImlzcyI6IkRvaW5nIEFQSSJ9.x3eJutiulLnJCJkl_jP9ETj43ihePVeMtaWgWF0I60w"
```
# Group API Access
If you are using the API to access User Endpoints ( https://api.civil.services/v1/user/* ) you will want to create a
`token` to manage the users sessions. This is not the same as an `apikey` which is required for all API endpoints. This
token is specifically for individual users and acts as a session id.
## Token [/token]
Once a user has logged in, you will need to send over their Authentication
Token in the HTTP Header. A `token` is returned with a successful login. A session
token is valid for 7 days. You can refresh your token to prevent having to log in
again by either adding the Request Authorization Header below, or using the
`/api/0.1/user/refresh/` endpoint.
### Get Token [GET]
+ Response 200 (application/json)
{
"error": false,
"errors": [],
"field_errors": {},
"meta": {
"total": 1,
"showing": 1,
"pages": 1,
"page": 1
},
"data": {
"token": "eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJpYXQiOjE0NTU1MTQ2NzIsImV4cCI6MTQ1NjExOTQ3MiwiaXNzIjoiQ29kZXJzIEJ1aWxkIEFQSSJ9.PZagWEzVC2sr_QjcwvqvUB9lUUlFSNIT9gzY80XWAn4"
}
}
## Refresh Session [/user/refresh]
A `token` is returned with a successful login. A session token is valid for 7 days.
You can refresh your token to prevent having to log in again by either adding the
Request Authorization Header below. `token` should be the string returned in the
`token` parameter from a successful login.
* __Authorization:__ Bearer `token`
### Refresh Session [POST]
+ Response 200 (application/json)
{
"error": false,
"errors": [],
"meta": {},
"data": {
"token": "eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJ1c2VySWQiOjIsImlhdCI6MTQ1MTc5ODYyMSwiZXhwIjoxNDUyNDAzNDIxLCJpc3MiOiJEb2luZyBBUEkifQ.za4PspEZfeVxydO3QHSFBLm_9PcrCBRwK9HLofBY74s"
}
}
+ Response 400 (application/json)
{
"error": true,
"errors": [
"Invalid or expired token"
],
"meta": {},
"data": []
}
# Group Account Management
The following endpoints are specifically setup to manage the logged in users account.
__IMPORTANT:__ Account Creation is not enabled by default for API Users. If you believe your application should be allowed to create user accounts, please contact us to let us know why.
## Register [/user/register/?username={username}&password={password}&retype_password={retype_password}&inviteCode={inviteCode}&first_name={first_name}&last_name={last_name}&email={email}&agree={agree}]
API Endpoint to register new users. This should set the user's `activated` field
to `true` unless they've included their email address. If so, `activated` is
`false` and the user will be sent an email with a `new_email_key` key to confirm
their email address to complete registration.
+ Parameters
+ username (string, required) - The username or email address of the account
+ Min Length: __3__
+ Max Length: __30__
+ Characters Allowed: __a-zA-Z0-9___
+ Case Insensitive
+ password (string, required) - The password to the account
+ Min Length: __6__
+ No Other Password Requirements :)
+ retype_password (string, required) - The password to the account
+ Min Length: __6__
+ No Other Password Requirements :)
+ inviteCode (string, required) - During Alpha / Beta testing, an Invitation Code is Required for registration
+ Length: __6__
+ Existing Users: __hash_id__
+ first_name (string, optional) - First Name - NOTE: Apple does not like requiring personal info for registration
+ Min Length: __1__
+ Max Length: __50__
+ last_name (string, optional) - Last Name - NOTE: Apple does not like requiring personal info for registration
+ Min Length: __1__
+ Max Length: __50__
+ email (string, optional) - Email Address - NOTE: Apple does not like requiring personal info for registration
+ Min Length: __1__
+ Max Length: __100__
+ agree (string, required) - Agree to TOS - User Agreed to Terms of Service
### User Register [POST]
+ Response 200 (application/json)
{
"error": false,
"errors": [],
"meta": {},
"data": {
"banned": false,
"id": "5",
"username": "test",
"first_name": "Test",
"last_name": "User",
"email": "[email protected]",
"activated": false,
"new_email_key": "TriqG3m344N8",
"modified": "2016-01-03T03:59:45.465Z",
"created": "2016-01-03T03:59:45.465Z",
"banned_reason": null,
"new_password_key": null,
"new_password_requested": null,
"new_email": null,
"profile_photo": null
}
}
+ Response 400 (application/json)
{
"error": true,
"errors": [],
"field_errors": {
"username": [
"Username is already in use"
],
"email": [
"Email is already in use"
]
},
"meta": {},
"data": []
}
## Confirm Account [/user/confirm/account/?key={key}]
During account registration, new users will be sent a link to confirm their
email address. The users account will be disabled until the user confirms the email
address.
+ Parameters
+ key (required, string) - The `new_email_key` stored for the user
### Confirm Account [GET]
+ Response 200 (application/json)
{
"error": false,
"errors": [],
"meta": {},
"data": {
"id": "5",
"username": "test",
"email": "[email protected]",
"first_name": "Test",
"last_name": "User",
"activated": true,
"banned": false,
"banned_reason": null,
"new_password_key": null,
"new_password_requested": null,
"new_email": null,
"new_email_key": null,
"profile_photo": null,
"created": "2016-01-02T06:00:54.303Z",
"modified": "2016-01-02T06:01:35.207Z",
"banned": false
}
}
+ Response 400 (application/json)
{
"error": true,
"errors": ["Error Saving User Account"],
"meta": {},
"data": []
}
## Confirm Email Change [/user/confirm/email/?key={key}]
When a user changes their email, they will be sent a confirmation email to both
their new and old email address assuring it was them that requested the email
change.
+ Parameters
+ key (required, string) - The `new_email_key` stored for the user
### Confirm Email Change [GET]
+ Response 200 (application/json)
{
"error": false,
"errors": [],
"meta": {},
"data": {
"id": "5",
"username": "test",
"email": "[email protected]",
"first_name": "Test",
"last_name": "User",
"activated": true,
"banned": false,
"banned_reason": null,
"new_password_key": null,
"new_password_requested": null,
"new_email": null,
"new_email_key": null,
"profile_photo": null,
"created": "2016-01-02T06:00:54.303Z",
"modified": "2016-01-02T06:01:35.207Z",
"banned": false
}
}
+ Response 400 (application/json)
{
"error": true,
"errors": ["Error Confirming Account"],
"meta": {},
"data": []
}
## Confirm Password Change [/user/confirm/password/?key={key}]
When a user changes their password, they will be sent a confirmation email assuring
it was them that requested the password change.
+ Parameters
+ key (required, string) - The `new_email_key` stored for the user
### Confirm Password Change [GET]
+ Response 200 (application/json)
{
"error": false,
"errors": [],
"meta": {},
"data": {
"id": "5",
"username": "test",
"email": "[email protected]",
"first_name": "Test",
"last_name": "User",
"activated": true,
"banned": false,
"banned_reason": null,
"new_password_key": null,
"new_password_requested": null,
"new_email": null,
"new_email_key": null,
"profile_photo": null,
"created": "2016-01-02T06:00:54.303Z",
"modified": "2016-01-02T06:01:35.207Z",
"banned": false
}
}
+ Response 400 (application/json)
{
"error": true,
"errors": ["Error Confirming Account"],
"meta": {},
"data": []
}
## Login [/user/login/?username={username}&password={password}]
Some of the API endpoints will require authentication. Those endpoints will
require the `token` returned from a succesful login.
To access authentication-protected endpoints, you will need to include an
`Authorization` HTTP header in the format: `Bearer (token)`.
+ Parameters
+ username (string, required) - The username of the account
+ password (string, required) - The password to the account
### User Login [POST]
+ Response 200 (application/json)
{
"error": false,
"errors": [],
"meta": {},
"data": {
"id": "5",
"username": "test",
"email": "[email protected]",
"first_name": "Test",
"last_name": "User",
"activated": true,
"banned": false,
"banned_reason": null,
"new_password_key": null,
"new_password_requested": null,
"new_email": null,
"new_email_key": "TriqG3m344N8",
"profile_photo": null,
"created": "2016-01-03T03:59:45.465Z",
"modified": "2016-01-03T03:59:45.465Z",
"token": "eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJ1c2VySWQiOiI1IiwiaWF0IjoxNDUxNzk0OTI2LCJleHAiOjE0NTIzOTk3MjYsImlzcyI6IkRvaW5nIEFQSSJ9.Y-ALQxsdTCf8zJvD-IUeobGTbgKbtNTvt3_JrUMOyXA"
}
}
+ Response 200 (application/json)
{
"error": true,
"errors": ["User not active"],
"meta": {},
"data": []
}
+ Response 200 (application/json)
{
"error": true,
"errors": ["No user found with that username"],
"meta": {},
"data": []
}
## Logout [/user/logout]
Tell API that the user has logged out
### User Logout [POST]
+ Response 200 (application/json)
{
"error": false,
"errors": [],
"meta": {},
"data": {
"success": true
}
}
+ Response 403 (application/json)
{
"error": true,
"errors": ["Invalid API Authorization Token"],
"meta": {},
"data": []
}
## Forgot Password [/user/forgot-password/?email={email}]
Forgot password will require an email address that is requesting for the password
reset link.
+ Parameters
+ email (required, string) - The email address of the account
### User Forgot Password [POST]
+ Response 200 (application/json)
{
"error": false,
"errors": [],
"meta": {
"total": 1,
"showing": 1,
"pages": 1,
"page": 1
},
"data": {
"message": "Check your email to obtain instructions on password reset."
}
}
+ Response 403 (application/json)
{
"error": true,
"errors": [
"We could not find that email address in our system."
],
"meta": {
"total": 1,
"showing": 1,
"pages": 1,
"page": 1
},
"data": {}
}
## Reset Password [/user/reset-password/?token={token}&password={password}&retype_password={retype_password}]
Reset password will check the token against the `new_password_key` column for that user. We will also likely want to make sure that `new_password_requested` is less than a certain age to prevent open password change requests.
+ Parameters
+ token (required, string) - This is the token that is sent from the link in the email address.
+ password (required, string) - This is the new password that the user wants to reset
+ retype_password (required, string) - This should be the same as 'password' and is the confirmation of the password
### User Reset Password [POST]
+ Response 200 (application/json)
{
"error": false,
"errors": [],
"meta": {
"total": 1,
"showing": 1,
"pages": 1,
"page": 1
},
"data": {
"message": "You may now login with your new password."
}
}
+ Response 403 (application/json)
{
"error": true,
"errors": [
"Invalid Reset Password token."
],
"meta": {
"total": 1,
"showing": 1,
"pages": 1,
"page": 1
},
"data": {}
}
## Resend Email Confirmation [/user/resend-confirmation/{hash_id}]
If the user needs to resend their email confirmation, this is the endpoint to use.
+ Parameters
+ hash_id (required, string) - This is the hash id of the user
### Resend Email Confirmation [GET]
+ Response 200 (application/json)
{
"error": false,
"errors": [],
"meta": {
"total": 1,
"showing": 1,
"pages": 1,
"page": 1
},
"data": {
"message": "You may now login with your new password."
}
}
+ Response 403 (application/json)
{
"error": true,
"errors": [
"Invalid Reset Password token."
],
"meta": {
"total": 1,
"showing": 1,
"pages": 1,
"page": 1
},
"data": {}
}
## Update Account [/user/update/?current_password={current_password}&username={username}&email={email}&password_new={password_new}&password_new_retype={password_new_retype}]
This endpoint will allow the logged in user to update their own account. This uses the current Authentication Bearer Token to lookup who's account to update.
The Bearer Token is created during login and contains the users ID from our database. You will not be able to use this endpoint to manage anyone else's account except your own.
IMPORTANT NOTES ABOUT THIS ENDPOINT:
1. Changing the username will immediately make the old username available to the world for use. We do check to make sure that the new username being requested is available.
2. We do not immediately change the email when requested. Instead we send a confirmation email to both the new and old email to confirm the requested change.
3. We do not immediately change the password when requested. We first send a confirmation email to the users current email to confirm that they made the requested change.
+ Parameters
+ current_password (required, string) - Current Account Password ( required to make any changes on this endpoint )
+ username (optional, string) - New Username user wishes to change their username to
+ email (optional, string) - New Email Address user wishes to associate with their account
+ password_new (optional, string) - New Password user wishes to use for their account
+ password_new_retype (optional, string) - Repeat the new password to make sure they match so they don't get locked out
### Update Account [POST]
+ Response 200 (application/json)
{
"error": false,
"errors": [],
"field_errors": {},
"meta": {
"total": 1,
"showing": 1,
"pages": 1,
"page": 1
},
"data": {
"bio": "Front End Designer",
"company_name": "Awesome Company",
"email": "[email protected]",
"first_name": "Jane",
"hash_id": "yRdRYJ",
"join_date": "2016-02-15T02:51:52.000Z",
"last_name": "Doe",
"location": "St. Petersburg, FL",
"profile_link_1": "http://mywebsite.com",
"profile_link_2": null,
"profile_link_3": null,
"profile_link_twitter": null,
"profile_link_website": null,
"profile_name": "Jane Doe",
"profile_photo": null,
"username": "janedoe"
}
}
+ Response 403 (application/json)
{
"error": true,
"errors": [
"Username is not available"
],
"meta": {
"total": 1,
"showing": 1,
"pages": 1,
"page": 1
},
"data": {}
}
## Delete Account [/user/delete/?username={username}&password={password}]
This endpoint only works for the currently logged in user using the Authorization
Bearer Header Token. Once that is verified there is a second check to require the
account holders username and password to double check that they just did not steal
the Authentication Header to try to steal / delete the users account.
IMPORTANT NOTES ABOUT THIS ENDPOINT:
1. This will permanently delete the users account
2. This will also permanently delete all data generated by the user
3. There is no way to undo this
+ Parameters
+ username (required, string) - Current Account User
+ password (required, string) - Current Account Password
### Delete Account [DELETE]
+ Response 200 (application/json)
{
"error": false,
"errors": [],
"field_errors": {},
"meta": {
"total": 1,
"showing": 1,
"pages": 1,
"page": 1
},
"data": {
"bio": "Front End Designer",
"company_name": "Awesome Company",
"email": "[email protected]",
"first_name": "Jane",
"hash_id": "yRdRYJ",
"join_date": "2016-02-15T02:51:52.000Z",
"last_name": "Doe",
"location": "St. Petersburg, FL",
"profile_link_1": "http://mywebsite.com",
"profile_link_2": null,
"profile_link_3": null,
"profile_link_twitter": null,
"profile_link_website": null,
"profile_name": "Jane Doe",
"profile_photo": null,
"username": "janedoe"
}
}
+ Response 403 (application/json)
{
"error": true,
"errors": [
"Incorrect Password"
],
"meta": {
"total": 1,
"showing": 1,
"pages": 1,
"page": 1
},
"data": {}
}
# Group User Interaction
The following endpoints are for accessing specific public data about a given
username. No private information is accessible from these endpoints.
## Get User Profile [/user/{username}/profile]
Get a public profile for given `username`.
+ Parameters
+ username (required, string) - Username for requested profile
### Get User Profile [GET]
+ Response 200 (application/json)
{
"error": false,
"errors": [],
"field_errors": {},
"meta": {
"total": 1,
"showing": 1,
"pages": 1,
"page": 1
},
"data": {
"bio": "Front End Designer",
"company_name": "Awesome Company",
"email": "[email protected]",
"first_name": "Jane",
"hash_id": "yRdRYJ",
"join_date": "2016-02-15T02:51:52.000Z",
"last_name": "Doe",
"location": "St. Petersburg, FL",
"profile_link_1": "http://mywebsite.com",
"profile_link_2": null,
"profile_link_3": null,
"profile_link_twitter": null,
"profile_link_website": null,
"profile_name": "Jane Doe",
"profile_photo": null,
"username": "janedoe"
}
}
+ Response 400 (application/json)
{
"error": true,
"errors": [
"No Matching User Found"
],
"field_errors": {},
"meta": {
"total": 0,
"showing": 0,
"pages": 1,
"page": 1
},
"data": []
}
## Follow User [/user/{username}/follow]
Add's `username` to the current logged in users follow list.
+ Parameters
+ username (required, string) - Username of user you wish to follow
### Follow User [POST]
+ Response 200 (application/json)
{
"error": false,
"errors": [],
"field_errors": {},
"meta": {
"total": 1,
"showing": 1,
"pages": 1,
"page": 1
},
"data": {
"bio": "Front End Designer",
"company_name": "Awesome Company",
"email": "[email protected]",
"first_name": "Jane",
"hash_id": "yRdRYJ",
"join_date": "2016-02-15T02:51:52.000Z",
"last_name": "Doe",
"location": "St. Petersburg, FL",
"profile_link_1": "http://mywebsite.com",
"profile_link_2": null,
"profile_link_3": null,
"profile_link_twitter": null,
"profile_link_website": null,
"profile_name": "Jane Doe",
"profile_photo": null,
"username": "janedoe"
}
}
+ Response 400 (application/json)
{
"error": true,
"errors": [
"No Matching User Found"
],
"field_errors": {},
"meta": {
"total": 0,
"showing": 0,
"pages": 1,
"page": 1
},
"data": []
}
## Unfollow User [/user/{username}/unfollow]
Removes `username` from the current logged in users follow list.
+ Parameters
+ username (required, string) - Username of user you wish to unfollow
### Unfollow User [POST]
+ Response 200 (application/json)
{
"error": false,
"errors": [],
"field_errors": {},
"meta": {
"total": 1,
"showing": 1,
"pages": 1,
"page": 1
},
"data": {
"bio": "Front End Designer",
"company_name": "Awesome Company",
"email": "[email protected]",
"first_name": "Jane",
"hash_id": "yRdRYJ",
"join_date": "2016-02-15T02:51:52.000Z",
"last_name": "Doe",
"location": "St. Petersburg, FL",
"profile_link_1": "http://mywebsite.com",
"profile_link_2": null,
"profile_link_3": null,
"profile_link_twitter": null,
"profile_link_website": null,
"profile_name": "Jane Doe",
"profile_photo": null,
"username": "janedoe"
}
}
+ Response 400 (application/json)
{
"error": true,
"errors": [
"No Matching User Found"
],
"field_errors": {},
"meta": {
"total": 0,
"showing": 0,
"pages": 1,
"page": 1
},
"data": []
}
## Get Followers [/user/{username}/followers]
Fetches list of users that is following `username`
+ Parameters
+ username (required, string) - Username to get followers list for
### Get Followers [GET]
+ Response 200 (application/json)
{
"error": false,
"errors": [],
"field_errors": { },
"meta": {
"total": 1,
"showing": 1,
"pages": 1,
"page": 1
},
"data": [
{
"id": 2,
"username": "manifestinteractive",
"profile_name": "Peter Schmalfeldt",
"profile_photo": "https://peterschmalfeldt.com/images/me.jpg",
"followed_on": "2016-03-05T08:30:04.000Z"
}
]
}
+ Response 400 (application/json)
{
"error": true,
"errors": [
"Missing Username"
],
"field_errors": {},
"meta": {
"total": 0,
"showing": 0,
"pages": 1,
"page": 1
},
"data": []
}
## Get Following [/user/{username}/following]
Fetches list of users `username` is following
+ Parameters
+ username (required, string) - Username to get following list for
### Get Following [GET]
+ Response 200 (application/json)
{
"error": false,
"errors": [],
"field_errors": { },
"meta": {