-
Notifications
You must be signed in to change notification settings - Fork 165
/
STTwitterAPI.h
2059 lines (1559 loc) · 103 KB
/
STTwitterAPI.h
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
/*
Copyright (c) 2012, Nicolas Seriot
All rights reserved.
Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:
* Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.
* Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.
* Neither the name of the Nicolas Seriot nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission.
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
//
// STTwitterAPI.h
// STTwitterRequests
//
// Created by Nicolas Seriot on 9/18/12.
// Copyright (c) 2012 Nicolas Seriot. All rights reserved.
//
#import <Foundation/Foundation.h>
NS_ENUM(NSUInteger, STTwitterAPIErrorCode) {
STTwitterAPICannotPostEmptyStatus,
STTwitterAPIMediaDataIsEmpty,
STTwitterAPIEmptyStream
};
extern NSString *kBaseURLStringAPI_1_1;
extern NSString *kBaseURLStringStream_1_1;
extern NSString *kBaseURLStringUserStream_1_1;
extern NSString *kBaseURLStringSiteStream_1_1;
/*
Tweet fields contents
https://dev.twitter.com/docs/platform-objects/tweets
https://dev.twitter.com/blog/new-withheld-content-fields-api-responses
*/
@class ACAccount;
@interface STTwitterAPI : NSObject
+ (instancetype)twitterAPIOSWithAccount:(ACAccount *) account;
+ (instancetype)twitterAPIOSWithFirstAccount;
+ (instancetype)twitterAPIWithOAuthConsumerName:(NSString *)consumerName // purely informational, can be anything
consumerKey:(NSString *)consumerKey
consumerSecret:(NSString *)consumerSecret;
// convenience
+ (instancetype)twitterAPIWithOAuthConsumerKey:(NSString *)consumerKey
consumerSecret:(NSString *)consumerSecret;
+ (instancetype)twitterAPIWithOAuthConsumerName:(NSString *)consumerName // purely informational, can be anything
consumerKey:(NSString *)consumerKey
consumerSecret:(NSString *)consumerSecret
username:(NSString *)username
password:(NSString *)password;
// convenience
+ (instancetype)twitterAPIWithOAuthConsumerKey:(NSString *)consumerKey
consumerSecret:(NSString *)consumerSecret
username:(NSString *)username
password:(NSString *)password;
+ (instancetype)twitterAPIWithOAuthConsumerName:(NSString *)consumerName // purely informational, can be anything
consumerKey:(NSString *)consumerKey
consumerSecret:(NSString *)consumerSecret
oauthToken:(NSString *)oauthToken
oauthTokenSecret:(NSString *)oauthTokenSecret;
// convenience
+ (instancetype)twitterAPIWithOAuthConsumerKey:(NSString *)consumerKey
consumerSecret:(NSString *)consumerSecret
oauthToken:(NSString *)oauthToken
oauthTokenSecret:(NSString *)oauthTokenSecret;
// https://dev.twitter.com/docs/auth/application-only-auth
+ (instancetype)twitterAPIAppOnlyWithConsumerName:(NSString *)consumerName
consumerKey:(NSString *)consumerKey
consumerSecret:(NSString *)consumerSecret;
// convenience
+ (instancetype)twitterAPIAppOnlyWithConsumerKey:(NSString *)consumerKey
consumerSecret:(NSString *)consumerSecret;
/*
authenticateInsteadOfAuthorize == NO will return an URL to oauth/authorize
authenticateInsteadOfAuthorize == YES will return an URL to oauth/authenticate
oauth/authorize differs from oauth/authorize in that if the user has already granted the application permission, the redirect will occur without the user having to re-approve the application. To realize this behavior, you must enable the Use Sign in with Twitter setting on your application record.
*/
- (void)postTokenRequest:(void(^)(NSURL *url, NSString *oauthToken))successBlock
authenticateInsteadOfAuthorize:(BOOL)authenticateInsteadOfAuthorize // use NO if you're not sure
forceLogin:(NSNumber *)forceLogin
screenName:(NSString *)screenName
oauthCallback:(NSString *)oauthCallback
errorBlock:(void(^)(NSError *error))errorBlock;
// convenience
- (void)postTokenRequest:(void(^)(NSURL *url, NSString *oauthToken))successBlock
oauthCallback:(NSString *)oauthCallback
errorBlock:(void(^)(NSError *error))errorBlock;
- (void)postAccessTokenRequestWithPIN:(NSString *)pin
successBlock:(void(^)(NSString *oauthToken, NSString *oauthTokenSecret, NSString *userID, NSString *screenName))successBlock
errorBlock:(void(^)(NSError *error))errorBlock;
// https://dev.twitter.com/docs/ios/using-reverse-auth
// reverse auth step 1
- (void)postReverseOAuthTokenRequest:(void(^)(NSString *authenticationHeader))successBlock
errorBlock:(void(^)(NSError *error))errorBlock;
// reverse auth step 2
// WARNING: if the Twitter account was set in iOS settings, the tokens may be nil after a system update.
// In this case, you can call -[ACAccountStore renewCredentialsForAccount:completion:] to let the user enter her Twitter password again.
- (void)postReverseAuthAccessTokenWithAuthenticationHeader:(NSString *)authenticationHeader
successBlock:(void(^)(NSString *oAuthToken, NSString *oAuthTokenSecret, NSString *userID, NSString *screenName))successBlock
errorBlock:(void(^)(NSError *error))errorBlock;
- (void)verifyCredentialsWithSuccessBlock:(void(^)(NSString *username))successBlock errorBlock:(void(^)(NSError *error))errorBlock;
- (void)invalidateBearerTokenWithSuccessBlock:(void(^)())successBlock
errorBlock:(void(^)(NSError *error))errorBlock;
- (NSString *)prettyDescription;
@property (nonatomic, retain) NSString *userName; // available for osx, set after successful connection for STTwitterOAuth
@property (nonatomic, readonly) NSString *oauthAccessToken;
@property (nonatomic, readonly) NSString *oauthAccessTokenSecret;
@property (nonatomic, readonly) NSString *bearerToken;
#pragma mark Generic methods to GET and POST
- (id)fetchResource:(NSString *)resource
HTTPMethod:(NSString *)HTTPMethod
baseURLString:(NSString *)baseURLString
parameters:(NSDictionary *)params
uploadProgressBlock:(void(^)(NSInteger bytesWritten, NSInteger totalBytesWritten, NSInteger totalBytesExpectedToWrite))uploadProgressBlock
downloadProgressBlock:(void (^)(id request, id response))downloadProgressBlock
successBlock:(void (^)(id request, NSDictionary *requestHeaders, NSDictionary *responseHeaders, id response))successBlock
errorBlock:(void (^)(id request, NSDictionary *requestHeaders, NSDictionary *responseHeaders, NSError *error))errorBlock;
- (id)getResource:(NSString *)resource
baseURLString:(NSString *)baseURLString
parameters:(NSDictionary *)parameters
downloadProgressBlock:(void(^)(id json))progredownloadProgressBlockssBlock
successBlock:(void(^)(NSDictionary *rateLimits, id json))successBlock
errorBlock:(void(^)(NSError *error))errorBlock;
- (id)postResource:(NSString *)resource
baseURLString:(NSString *)baseURLString
parameters:(NSDictionary *)parameters
uploadProgressBlock:(void(^)(NSInteger bytesWritten, NSInteger totalBytesWritten, NSInteger totalBytesExpectedToWrite))uploadProgressBlock
downloadProgressBlock:(void(^)(id json))downloadProgressBlock
successBlock:(void(^)(NSDictionary *rateLimits, id response))successBlock
errorBlock:(void(^)(NSError *error))errorBlock;
#pragma mark Timelines
/*
GET statuses/mentions_timeline
Returns Tweets (*: mentions for the user)
Returns the 20 most recent mentions (tweets containing a users's @screen_name) for the authenticating user.
The timeline returned is the equivalent of the one seen when you view your mentions on twitter.com.
This method can only return up to 800 tweets.
*/
- (void)getStatusesMentionTimelineWithCount:(NSString *)count
sinceID:(NSString *)sinceID
maxID:(NSString *)maxID
trimUser:(NSNumber *)trimUser
contributorDetails:(NSNumber *)contributorDetails
includeEntities:(NSNumber *)includeEntities
successBlock:(void(^)(NSArray *statuses))successBlock
errorBlock:(void(^)(NSError *error))errorBlock;
// convenience method
- (void)getMentionsTimelineSinceID:(NSString *)sinceID
count:(NSUInteger)count
successBlock:(void(^)(NSArray *statuses))successBlock
errorBlock:(void(^)(NSError *error))errorBlock;
/*
GET statuses/user_timeline
Returns Tweets (*: tweets for the user)
Returns a collection of the most recent Tweets posted by the user indicated by the screen_name or user_id parameters.
User timelines belonging to protected users may only be requested when the authenticated user either "owns" the timeline or is an approved follower of the owner.
The timeline returned is the equivalent of the one seen when you view a user's profile on twitter.com.
This method can only return up to 3,200 of a user's most recent Tweets. Native retweets of other statuses by the user is included in this total, regardless of whether include_rts is set to false when requesting this resource.
*/
- (void)getStatusesUserTimelineForUserID:(NSString *)userID
screenName:(NSString *)screenName
sinceID:(NSString *)sinceID
count:(NSString *)count
maxID:(NSString *)maxID
trimUser:(NSNumber *)trimUser
excludeReplies:(NSNumber *)excludeReplies
contributorDetails:(NSNumber *)contributorDetails
includeRetweets:(NSNumber *)includeRetweets
successBlock:(void(^)(NSArray *statuses))successBlock
errorBlock:(void(^)(NSError *error))errorBlock;
// convenience method
- (void)getUserTimelineWithScreenName:(NSString *)screenName
sinceID:(NSString *)sinceID
maxID:(NSString *)maxID
count:(NSUInteger)count
successBlock:(void(^)(NSArray *statuses))successBlock
errorBlock:(void(^)(NSError *error))errorBlock;
// convenience method
- (void)getUserTimelineWithScreenName:(NSString *)screenName
count:(NSUInteger)count
successBlock:(void(^)(NSArray *statuses))successBlock
errorBlock:(void(^)(NSError *error))errorBlock;
// convenience method
- (void)getUserTimelineWithScreenName:(NSString *)screenName
successBlock:(void(^)(NSArray *statuses))successBlock
errorBlock:(void(^)(NSError *error))errorBlock;
/*
GET statuses/home_timeline
Returns Tweets (*: tweets from people the user follows)
Returns a collection of the most recent Tweets and retweets posted by the authenticating user and the users they follow. The home timeline is central to how most users interact with the Twitter service.
Up to 800 Tweets are obtainable on the home timeline. It is more volatile for users that follow many users or follow users who tweet frequently.
*/
- (void)getStatusesHomeTimelineWithCount:(NSString *)count
sinceID:(NSString *)sinceID
maxID:(NSString *)maxID
trimUser:(NSNumber *)trimUser
excludeReplies:(NSNumber *)excludeReplies
contributorDetails:(NSNumber *)contributorDetails
includeEntities:(NSNumber *)includeEntities
successBlock:(void(^)(NSArray *statuses))successBlock
errorBlock:(void(^)(NSError *error))errorBlock;
// convenience method
- (void)getHomeTimelineSinceID:(NSString *)sinceID
count:(NSUInteger)count
successBlock:(void(^)(NSArray *statuses))successBlock
errorBlock:(void(^)(NSError *error))errorBlock;
/*
GET statuses/retweets_of_me
Returns the most recent tweets authored by the authenticating user that have been retweeted by others. This timeline is a subset of the user's GET statuses/user_timeline. See Working with Timelines for instructions on traversing timelines.
*/
- (void)getStatusesRetweetsOfMeWithCount:(NSString *)count
sinceID:(NSString *)sinceID
maxID:(NSString *)maxID
trimUser:(NSNumber *)trimUser
includeEntities:(NSNumber *)includeEntities
includeUserEntities:(NSNumber *)includeUserEntities
successBlock:(void(^)(NSArray *statuses))successBlock
errorBlock:(void(^)(NSError *error))errorBlock;
// convenience method
- (void)getStatusesRetweetsOfMeWithSuccessBlock:(void(^)(NSArray *statuses))successBlock
errorBlock:(void(^)(NSError *error))errorBlock;
#pragma mark Tweets
/*
GET statuses/retweets/:id
Returns up to 100 of the first retweets of a given tweet.
*/
- (void)getStatusesRetweetsForID:(NSString *)statusID
count:(NSString *)count
trimUser:(NSNumber *)trimUser
successBlock:(void(^)(NSArray *statuses))successBlock
errorBlock:(void(^)(NSError *error))errorBlock;
/*
GET statuses/show/:id
Returns a single Tweet, specified by the id parameter. The Tweet's author will also be embedded within the tweet.
See Embeddable Timelines, Embeddable Tweets, and GET statuses/oembed for tools to render Tweets according to Display Requirements.
# About Geo
If there is no geotag for a status, then there will be an empty <geo/> or "geo" : {}. This can only be populated if the user has used the Geotagging API to send a statuses/update.
The JSON response mostly uses conventions laid out in GeoJSON. Unfortunately, the coordinates that Twitter renders are reversed from the GeoJSON specification (GeoJSON specifies a longitude then a latitude, whereas we are currently representing it as a latitude then a longitude). Our JSON renders as: "geo": { "type":"Point", "coordinates":[37.78029, -122.39697] }
# Contributors
If there are no contributors for a Tweet, then there will be an empty or "contributors" : {}. This field will only be populated if the user has contributors enabled on his or her account -- this is a beta feature that is not yet generally available to all.
This object contains an array of user IDs for users who have contributed to this status (an example of a status that has been contributed to is this one). In practice, there is usually only one ID in this array. The JSON renders as such "contributors":[8285392].
*/
- (void)getStatusesShowID:(NSString *)statusID
trimUser:(NSNumber *)trimUser
includeMyRetweet:(NSNumber *)includeMyRetweet
includeEntities:(NSNumber *)includeEntities
successBlock:(void(^)(NSDictionary *status))successBlock
errorBlock:(void(^)(NSError *error))errorBlock;
/*
POST statuses/destroy/:id
Destroys the status specified by the required ID parameter. The authenticating user must be the author of the specified status. Returns the destroyed status if successful.
*/
- (void)postStatusesDestroy:(NSString *)statusID
trimUser:(NSNumber *)trimUser
successBlock:(void(^)(NSDictionary *status))successBlock
errorBlock:(void(^)(NSError *error))errorBlock;
/*
POST statuses/update
Updates the authenticating user's current status, also known as tweeting. To upload an image to accompany the tweet, use POST statuses/update_with_media.
For each update attempt, the update text is compared with the authenticating user's recent tweets. Any attempt that would result in duplication will be blocked, resulting in a 403 error. Therefore, a user cannot submit the same status twice in a row.
While not rate limited by the API a user is limited in the number of tweets they can create at a time. If the number of updates posted by the user reaches the current allowed limit this method will return an HTTP 403 error.
- Any geo-tagging parameters in the update will be ignored if geo_enabled for the user is false (this is the default setting for all users unless the user has enabled geolocation in their settings)
- The number of digits passed the decimal separator passed to lat, up to 8, will be tracked so that the lat is returned in a status object it will have the same number of digits after the decimal separator.
- Please make sure to use to use a decimal point as the separator (and not the decimal comma) for the latitude and the longitude - usage of the decimal comma will cause the geo-tagged portion of the status update to be dropped.
- For JSON, the response mostly uses conventions described in GeoJSON. Unfortunately, the geo object has coordinates that Twitter renderers are reversed from the GeoJSON specification (GeoJSON specifies a longitude then a latitude, whereas we are currently representing it as a latitude then a longitude. Our JSON renders as: "geo": { "type":"Point", "coordinates":[37.78217, -122.40062] }
- The coordinates object is replacing the geo object (no deprecation date has been set for the geo object yet) -- the difference is that the coordinates object, in JSON, is now rendered correctly in GeoJSON.
- If a place_id is passed into the status update, then that place will be attached to the status. If no place_id was explicitly provided, but latitude and longitude are, we attempt to implicitly provide a place by calling geo/reverse_geocode.
- Users will have the ability, from their settings page, to remove all the geotags from all their tweets en masse. Currently we are not doing any automatic scrubbing nor providing a method to remove geotags from individual tweets.
*/
- (void)postStatusUpdate:(NSString *)status
inReplyToStatusID:(NSString *)existingStatusID
latitude:(NSString *)latitude
longitude:(NSString *)longitude
placeID:(NSString *)placeID
displayCoordinates:(NSNumber *)displayCoordinates
trimUser:(NSNumber *)trimUser
successBlock:(void(^)(NSDictionary *status))successBlock
errorBlock:(void(^)(NSError *error))errorBlock;
// starting May 28th, 2014
// https://dev.twitter.com/notifications/multiple-media-entities-in-tweets
// https://dev.twitter.com/docs/api/multiple-media-extended-entities
- (void)postStatusUpdate:(NSString *)status
inReplyToStatusID:(NSString *)existingStatusID
mediaIDs:(NSArray *)mediaIDs
latitude:(NSString *)latitude
longitude:(NSString *)longitude
placeID:(NSString *)placeID
displayCoordinates:(NSNumber *)displayCoordinates
trimUser:(NSNumber *)trimUser
successBlock:(void(^)(NSDictionary *status))successBlock
errorBlock:(void(^)(NSError *error))errorBlock;
/*
POST statuses/retweet/:id
Retweets a tweet. Returns the original tweet with retweet details embedded.
- This method is subject to update limits. A HTTP 403 will be returned if this limit as been hit.
- Twitter will ignore attempts to perform duplicate retweets.
- The retweet_count will be current as of when the payload is generated and may not reflect the exact count. It is intended as an approximation.
Returns Tweets (1: the new tweet)
*/
- (void)postStatusRetweetWithID:(NSString *)statusID
trimUser:(NSNumber *)trimUser
successBlock:(void(^)(NSDictionary *status))successBlock
errorBlock:(void(^)(NSError *error))errorBlock;
// convenience
- (void)postStatusRetweetWithID:(NSString *)statusID
successBlock:(void(^)(NSDictionary *status))successBlock
errorBlock:(void(^)(NSError *error))errorBlock;
/*
POST statuses/update_with_media
Updates the authenticating user's current status and attaches media for upload. In other words, it creates a Tweet with a picture attached.
Unlike POST statuses/update, this method expects raw multipart data. Your POST request's Content-Type should be set to multipart/form-data with the media[] parameter
The Tweet text will be rewritten to include the media URL(s), which will reduce the number of characters allowed in the Tweet text. If the URL(s) cannot be appended without text truncation, the tweet will be rejected and this method will return an HTTP 403 error.
*/
- (void)postStatusUpdate:(NSString *)status
mediaDataArray:(NSArray *)mediaDataArray // only one media is currently supported, help/configuration.json returns "max_media_per_upload" = 1
possiblySensitive:(NSNumber *)possiblySensitive
inReplyToStatusID:(NSString *)inReplyToStatusID
latitude:(NSString *)latitude
longitude:(NSString *)longitude
placeID:(NSString *)placeID
displayCoordinates:(NSNumber *)displayCoordinates
uploadProgressBlock:(void(^)(NSInteger bytesWritten, NSInteger totalBytesWritten, NSInteger totalBytesExpectedToWrite))uploadProgressBlock
successBlock:(void(^)(NSDictionary *status))successBlock
errorBlock:(void(^)(NSError *error))errorBlock;
// convenience
- (void)postStatusUpdate:(NSString *)status
inReplyToStatusID:(NSString *)existingStatusID
mediaURL:(NSURL *)mediaURL
placeID:(NSString *)placeID
latitude:(NSString *)latitude
longitude:(NSString *)longitude
uploadProgressBlock:(void(^)(NSInteger bytesWritten, NSInteger totalBytesWritten, NSInteger totalBytesExpectedToWrite))uploadProgressBlock
successBlock:(void(^)(NSDictionary *status))successBlock
errorBlock:(void(^)(NSError *error))errorBlock;
/*
GET statuses/oembed
Returns information allowing the creation of an embedded representation of a Tweet on third party sites. See the oEmbed specification for information about the response format.
While this endpoint allows a bit of customization for the final appearance of the embedded Tweet, be aware that the appearance of the rendered Tweet may change over time to be consistent with Twitter's Display Requirements. Do not rely on any class or id parameters to stay constant in the returned markup.
*/
- (void)getStatusesOEmbedForStatusID:(NSString *)statusID
urlString:(NSString *)urlString
maxWidth:(NSString *)maxWidth
hideMedia:(NSNumber *)hideMedia
hideThread:(NSNumber *)hideThread
omitScript:(NSNumber *)omitScript
align:(NSString *)align // 'left', 'right', 'center' or 'none' (default)
related:(NSString *)related // eg. twitterapi,twittermedia,twitter
lang:(NSString *)lang
successBlock:(void(^)(NSDictionary *status))successBlock
errorBlock:(void(^)(NSError *error))errorBlock;
/*
GET statuses/retweeters/ids
Returns a collection of up to 100 user IDs belonging to users who have retweeted the tweet specified by the id parameter.
This method offers similar data to GET statuses/retweets/:id and replaces API v1's GET statuses/:id/retweeted_by/ids method.
*/
- (void)getStatusesRetweetersIDsForStatusID:(NSString *)statusID
cursor:(NSString *)cursor
successBlock:(void(^)(NSArray *ids, NSString *previousCursor, NSString *nextCursor))successBlock
errorBlock:(void(^)(NSError *error))errorBlock;
#pragma mark Search
// GET search/tweets
- (void)getSearchTweetsWithQuery:(NSString *)q
geocode:(NSString *)geoCode // eg. "37.781157,-122.398720,1mi"
lang:(NSString *)lang // eg. "eu"
locale:(NSString *)locale // eg. "ja"
resultType:(NSString *)resultType // eg. "mixed, recent, popular"
count:(NSString *)count // eg. "100"
until:(NSString *)until // eg. "2012-09-01"
sinceID:(NSString *)sinceID // eg. "12345"
maxID:(NSString *)maxID // eg. "54321"
includeEntities:(NSNumber *)includeEntities
callback:(NSString *)callback // eg. "processTweets"
successBlock:(void(^)(NSDictionary *searchMetadata, NSArray *statuses))successBlock
errorBlock:(void(^)(NSError *error))errorBlock;
// convenience method
- (void)getSearchTweetsWithQuery:(NSString *)q
successBlock:(void(^)(NSDictionary *searchMetadata, NSArray *statuses))successBlock
errorBlock:(void(^)(NSError *error))errorBlock;
#pragma mark Streaming
/*
POST statuses/filter
Returns public statuses that match one or more filter predicates. Multiple parameters may be specified which allows most clients to use a single connection to the Streaming API. Both GET and POST requests are supported, but GET requests with too many parameters may cause the request to be rejected for excessive URL length. Use a POST request to avoid long URLs.
The track, follow, and locations fields should be considered to be combined with an OR operator. track=foo&follow=1234 returns Tweets matching "foo" OR created by user 1234.
The default access level allows up to 400 track keywords, 5,000 follow userids and 25 0.1-360 degree location boxes. If you need elevated access to the Streaming API, you should explore our partner providers of Twitter data here: https://dev.twitter.com/programs/twitter-certified-products/products#Certified-Data-Products
At least one predicate parameter (follow, locations, or track) must be specified.
*/
- (id)postStatusesFilterUserIDs:(NSArray *)userIDs
keywordsToTrack:(NSArray *)keywordsToTrack
locationBoundingBoxes:(NSArray *)locationBoundingBoxes
delimited:(NSNumber *)delimited
stallWarnings:(NSNumber *)stallWarnings
progressBlock:(void(^)(NSDictionary *tweet))progressBlock
stallWarningBlock:(void(^)(NSString *code, NSString *message, NSUInteger percentFull))stallWarningBlock
errorBlock:(void(^)(NSError *error))errorBlock;
// convenience
- (id)postStatusesFilterKeyword:(NSString *)keyword
progressBlock:(void(^)(NSDictionary *tweet))progressBlock
errorBlock:(void(^)(NSError *error))errorBlock;
/*
GET statuses/sample
Returns a small random sample of all public statuses. The Tweets returned by the default access level are the same, so if two different clients connect to this endpoint, they will see the same Tweets.
*/
- (id)getStatusesSampleDelimited:(NSNumber *)delimited
stallWarnings:(NSNumber *)stallWarnings
progressBlock:(void(^)(id response))progressBlock
stallWarningBlock:(void(^)(NSString *code, NSString *message, NSUInteger percentFull))stallWarningBlock
errorBlock:(void(^)(NSError *error))errorBlock;
/*
GET statuses/firehose
This endpoint requires special permission to access.
Returns all public statuses. Few applications require this level of access. Creative use of a combination of other resources and various access levels can satisfy nearly every application use case.
*/
- (id)getStatusesFirehoseWithCount:(NSString *)count
delimited:(NSNumber *)delimited
stallWarnings:(NSNumber *)stallWarnings
progressBlock:(void(^)(id response))progressBlock
stallWarningBlock:(void(^)(NSString *code, NSString *message, NSUInteger percentFull))stallWarningBlock
errorBlock:(void(^)(NSError *error))errorBlock;
/*
GET user
Streams messages for a single user, as described in User streams https://dev.twitter.com/docs/streaming-apis/streams/user
*/
- (id)getUserStreamDelimited:(NSNumber *)delimited
stallWarnings:(NSNumber *)stallWarnings
includeMessagesFromFollowedAccounts:(NSNumber *)includeMessagesFromFollowedAccounts
includeReplies:(NSNumber *)includeReplies
keywordsToTrack:(NSArray *)keywordsToTrack
locationBoundingBoxes:(NSArray *)locationBoundingBoxes
progressBlock:(void(^)(id response))progressBlock
stallWarningBlock:(void(^)(NSString *code, NSString *message, NSUInteger percentFull))stallWarningBlock
errorBlock:(void(^)(NSError *error))errorBlock;
/*
GET site
Streams messages for a set of users, as described in Site streams https://dev.twitter.com/docs/streaming-apis/streams/site
*/
- (id)getSiteStreamForUserIDs:(NSArray *)userIDs
delimited:(NSNumber *)delimited
stallWarnings:(NSNumber *)stallWarnings
restrictToUserMessages:(NSNumber *)restrictToUserMessages
includeReplies:(NSNumber *)includeReplies
progressBlock:(void(^)(id response))progressBlock
stallWarningBlock:(void(^)(NSString *code, NSString *message, NSUInteger percentFull))stallWarningBlock
errorBlock:(void(^)(NSError *error))errorBlock;
#pragma mark Direct Messages
/*
GET direct_messages
Returns the 20 most recent direct messages sent to the authenticating user. Includes detailed information about the sender and recipient user. You can request up to 200 direct messages per call, up to a maximum of 800 incoming DMs.
*/
- (void)getDirectMessagesSinceID:(NSString *)sinceID
maxID:(NSString *)maxID
count:(NSString *)count
includeEntities:(NSNumber *)includeEntities
skipStatus:(NSNumber *)skipStatus
successBlock:(void(^)(NSArray *messages))successBlock
errorBlock:(void(^)(NSError *error))errorBlock;
// convenience
- (void)getDirectMessagesSinceID:(NSString *)sinceID
count:(NSUInteger)count
successBlock:(void(^)(NSArray *messages))successBlock
errorBlock:(void(^)(NSError *error))errorBlock;
/*
GET direct_messages/sent
Returns the 20 most recent direct messages sent by the authenticating user. Includes detailed information about the sender and recipient user. You can request up to 200 direct messages per call, up to a maximum of 800 outgoing DMs.
*/
- (void)getDirectMessagesSinceID:(NSString *)sinceID
maxID:(NSString *)maxID
count:(NSString *)count
page:(NSString *)page
includeEntities:(NSNumber *)includeEntities
successBlock:(void(^)(NSArray *messages))successBlock
errorBlock:(void(^)(NSError *error))errorBlock;
/*
GET direct_messages/show
Returns a single direct message, specified by an id parameter. Like the /1.1/direct_messages.format request, this method will include the user objects of the sender and recipient.
*/
- (void)getDirectMessagesShowWithID:(NSString *)messageID
successBlock:(void(^)(NSArray *statuses))successBlock
errorBlock:(void(^)(NSError *error))errorBlock;
/*
POST direct_messages/destroy
Destroys the direct message specified in the required ID parameter. The authenticating user must be the recipient of the specified direct message.
*/
- (void)postDestroyDirectMessageWithID:(NSString *)messageID
includeEntities:(NSNumber *)includeEntities
successBlock:(void(^)(NSDictionary *message))successBlock
errorBlock:(void(^)(NSError *error))errorBlock;
/*
POST direct_messages/new
Sends a new direct message to the specified user from the authenticating user. Requires both the user and text parameters and must be a POST. Returns the sent message in the requested format if successful.
*/
- (void)postDirectMessage:(NSString *)status
forScreenName:(NSString *)screenName
orUserID:(NSString *)userID
successBlock:(void(^)(NSDictionary *message))successBlock
errorBlock:(void(^)(NSError *error))errorBlock;
#pragma mark Friends & Followers
/*
GET friendships/no_retweets/ids
Returns a collection of user_ids that the currently authenticated user does not want to receive retweets from. Use POST friendships/update to set the "no retweets" status for a given user account on behalf of the current user.
*/
- (void)getFriendshipNoRetweetsIDsWithSuccessBlock:(void(^)(NSArray *ids))successBlock
errorBlock:(void(^)(NSError *error))errorBlock;
/*
GET friends/ids
Returns Users (*: user IDs for followees)
Returns a cursored collection of user IDs for every user the specified user is following (otherwise known as their "friends").
At this time, results are ordered with the most recent following first — however, this ordering is subject to unannounced change and eventual consistency issues. Results are given in groups of 5,000 user IDs and multiple "pages" of results can be navigated through using the next_cursor value in subsequent requests. See Using cursors to navigate collections for more information.
This method is especially powerful when used in conjunction with GET users/lookup, a method that allows you to convert user IDs into full user objects in bulk.
*/
- (void)getFriendsIDsForUserID:(NSString *)userID
orScreenName:(NSString *)screenName
cursor:(NSString *)cursor
count:(NSString *)count
successBlock:(void(^)(NSArray *ids, NSString *previousCursor, NSString *nextCursor))successBlock
errorBlock:(void(^)(NSError *error))errorBlock;
// convenience
- (void)getFriendsIDsForScreenName:(NSString *)screenName
successBlock:(void(^)(NSArray *friends))successBlock
errorBlock:(void(^)(NSError *error))errorBlock;
/*
GET followers/ids
Returns a cursored collection of user IDs for every user following the specified user.
At this time, results are ordered with the most recent following first — however, this ordering is subject to unannounced change and eventual consistency issues. Results are given in groups of 5,000 user IDs and multiple "pages" of results can be navigated through using the next_cursor value in subsequent requests. See Using cursors to navigate collections for more information.
This method is especially powerful when used in conjunction with GET users/lookup, a method that allows you to convert user IDs into full user objects in bulk.
*/
- (void)getFollowersIDsForUserID:(NSString *)userID
orScreenName:(NSString *)screenName
cursor:(NSString *)cursor
count:(NSString *)count
successBlock:(void(^)(NSArray *followersIDs, NSString *previousCursor, NSString *nextCursor))successBlock
errorBlock:(void(^)(NSError *error))errorBlock;
// convenience
- (void)getFollowersIDsForScreenName:(NSString *)screenName
successBlock:(void(^)(NSArray *followers))successBlock
errorBlock:(void(^)(NSError *error))errorBlock;
/*
GET friendships/lookup
Returns the relationships of the authenticating user to the comma-separated list of up to 100 screen_names or user_ids provided. Values for connections can be: following, following_requested, followed_by, none.
*/
- (void)getFriendshipsLookupForScreenNames:(NSArray *)screenNames
orUserIDs:(NSArray *)userIDs
successBlock:(void(^)(NSArray *users))successBlock
errorBlock:(void(^)(NSError *error))errorBlock;
/*
GET friendships/incoming
Returns a collection of numeric IDs for every user who has a pending request to follow the authenticating user.
*/
- (void)getFriendshipIncomingWithCursor:(NSString *)cursor
successBlock:(void(^)(NSArray *IDs, NSString *previousCursor, NSString *nextCursor))successBlock
errorBlock:(void(^)(NSError *error))errorBlock;
/*
GET friendships/outgoing
Returns a collection of numeric IDs for every protected user for whom the authenticating user has a pending follow request.
*/
- (void)getFriendshipOutgoingWithCursor:(NSString *)cursor
successBlock:(void(^)(NSArray *IDs, NSString *previousCursor, NSString *nextCursor))successBlock
errorBlock:(void(^)(NSError *error))errorBlock;
/*
POST friendships/create
Allows the authenticating users to follow the user specified in the ID parameter.
Returns the befriended user in the requested format when successful. Returns a string describing the failure condition when unsuccessful. If you are already friends with the user a HTTP 403 may be returned, though for performance reasons you may get a 200 OK message even if the friendship already exists.
Actions taken in this method are asynchronous and changes will be eventually consistent.
*/
- (void)postFriendshipsCreateForScreenName:(NSString *)screenName
orUserID:(NSString *)userID
successBlock:(void(^)(NSDictionary *befriendedUser))successBlock
errorBlock:(void(^)(NSError *error))errorBlock;
// convenience
- (void)postFollow:(NSString *)screenName
successBlock:(void(^)(NSDictionary *user))successBlock
errorBlock:(void(^)(NSError *error))errorBlock;
/*
POST friendships/destroy
Allows the authenticating user to unfollow the user specified in the ID parameter.
Returns the unfollowed user in the requested format when successful. Returns a string describing the failure condition when unsuccessful.
Actions taken in this method are asynchronous and changes will be eventually consistent.
*/
- (void)postFriendshipsDestroyScreenName:(NSString *)screenName
orUserID:(NSString *)userID
successBlock:(void(^)(NSDictionary *unfollowedUser))successBlock
errorBlock:(void(^)(NSError *error))errorBlock;
// convenience
- (void)postUnfollow:(NSString *)screenName
successBlock:(void(^)(NSDictionary *user))successBlock
errorBlock:(void(^)(NSError *error))errorBlock;
/*
POST friendships/update
Allows one to enable or disable retweets and device notifications from the specified user.
*/
- (void)postFriendshipsUpdateForScreenName:(NSString *)screenName
orUserID:(NSString *)userID
enableDeviceNotifications:(NSNumber *)enableDeviceNotifications
enableRetweets:(NSNumber *)enableRetweets
successBlock:(void(^)(NSDictionary *user))successBlock
errorBlock:(void(^)(NSError *error))errorBlock;
// convenience
- (void)postFriendshipsUpdateForScreenName:(NSString *)screenName
orUserID:(NSString *)userID
enableDeviceNotifications:(BOOL)enableDeviceNotifications
successBlock:(void(^)(NSDictionary *user))successBlock
errorBlock:(void(^)(NSError *error))errorBlock;
// convenience
- (void)postFriendshipsUpdateForScreenName:(NSString *)screenName
orUserID:(NSString *)userID
enableRetweets:(BOOL)enableRetweets
successBlock:(void(^)(NSDictionary *user))successBlock
errorBlock:(void(^)(NSError *error))errorBlock;
/*
GET friendships/show
Returns detailed information about the relationship between two arbitrary users.
*/
- (void)getFriendshipShowForSourceID:(NSString *)sourceID
orSourceScreenName:(NSString *)sourceScreenName
targetID:(NSString *)targetID
orTargetScreenName:(NSString *)targetScreenName
successBlock:(void(^)(id relationship))successBlock
errorBlock:(void(^)(NSError *error))errorBlock;
/*
GET friends/list
Returns a cursored collection of user objects for every user the specified user is following (otherwise known as their "friends").
At this time, results are ordered with the most recent following first — however, this ordering is subject to unannounced change and eventual consistency issues. Results are given in groups of 20 users and multiple "pages" of results can be navigated through using the next_cursor value in subsequent requests. See Using cursors to navigate collections for more information.
*/
- (void)getFriendsListForUserID:(NSString *)userID
orScreenName:(NSString *)screenName
cursor:(NSString *)cursor
count:(NSString *)count
skipStatus:(NSNumber *)skipStatus
includeUserEntities:(NSNumber *)includeUserEntities
successBlock:(void(^)(NSArray *users, NSString *previousCursor, NSString *nextCursor))successBlock
errorBlock:(void(^)(NSError *error))errorBlock;
// convenience
- (void)getFriendsForScreenName:(NSString *)screenName
successBlock:(void(^)(NSArray *friends))successBlock
errorBlock:(void(^)(NSError *error))errorBlock;
/*
GET followers/list
Returns a cursored collection of user objects for users following the specified user.
At this time, results are ordered with the most recent following first — however, this ordering is subject to unannounced change and eventual consistency issues. Results are given in groups of 20 users and multiple "pages" of results can be navigated through using the next_cursor value in subsequent requests. See Using cursors to navigate collections for more information.
*/
- (void)getFollowersListForUserID:(NSString *)userID
orScreenName:(NSString *)screenName
cursor:(NSString *)cursor
skipStatus:(NSNumber *)skipStatus
includeUserEntities:(NSNumber *)includeUserEntities
successBlock:(void(^)(NSArray *users, NSString *previousCursor, NSString *nextCursor))successBlock
errorBlock:(void(^)(NSError *error))errorBlock;
// convenience
- (void)getFollowersForScreenName:(NSString *)screenName
successBlock:(void(^)(NSArray *followers))successBlock
errorBlock:(void(^)(NSError *error))errorBlock;
#pragma mark Users
/*
GET account/settings
Returns settings (including current trend, geo and sleep time information) for the authenticating user.
*/
- (void)getAccountSettingsWithSuccessBlock:(void(^)(NSDictionary *settings))successBlock
errorBlock:(void(^)(NSError *error))errorBlock;
/*
GET account/verify_credentials
Returns an HTTP 200 OK response code and a representation of the requesting user if authentication was successful; returns a 401 status code and an error message if not. Use this method to test if supplied user credentials are valid.
*/
- (void)getAccountVerifyCredentialsWithIncludeEntites:(NSNumber *)includeEntities
skipStatus:(NSNumber *)skipStatus
successBlock:(void(^)(NSDictionary *account))successBlock
errorBlock:(void(^)(NSError *error))errorBlock;
// convenience
- (void)getAccountVerifyCredentialsWithSuccessBlock:(void(^)(NSDictionary *account))successBlock
errorBlock:(void(^)(NSError *error))errorBlock;
/*
POST account/settings
Updates the authenticating user's settings.
*/
- (void)postAccountSettingsWithTrendLocationWOEID:(NSString *)trendLocationWOEID // eg. "1"
sleepTimeEnabled:(NSNumber *)sleepTimeEnabled // eg. @(YES)
startSleepTime:(NSString *)startSleepTime // eg. "13"
endSleepTime:(NSString *)endSleepTime // eg. "13"
timezone:(NSString *)timezone // eg. "Europe/Copenhagen", "Pacific/Tongatapu"
language:(NSString *)language // eg. "it", "en", "es"
successBlock:(void(^)(NSDictionary *settings))successBlock
errorBlock:(void(^)(NSError *error))errorBlock;
/*
POST account/update_delivery_device
Sets which device Twitter delivers updates to for the authenticating user. Sending none as the device parameter will disable SMS updates.
*/
- (void)postAccountUpdateDeliveryDeviceSMS:(BOOL)deliveryDeviceSMS
includeEntities:(NSNumber *)includeEntities
successBlock:(void(^)(NSDictionary *response))successBlock
errorBlock:(void(^)(NSError *error))errorBlock;
/*
POST account/update_profile
Sets values that users are able to set under the "Account" tab of their settings page. Only the parameters specified will be updated.
*/
- (void)postAccountUpdateProfileWithName:(NSString *)name
URLString:(NSString *)URLString
location:(NSString *)location
description:(NSString *)description
includeEntities:(NSNumber *)includeEntities
skipStatus:(NSNumber *)skipStatus
successBlock:(void(^)(NSDictionary *profile))successBlock
errorBlock:(void(^)(NSError *error))errorBlock;
// convenience
- (void)postUpdateProfile:(NSDictionary *)profileData
successBlock:(void(^)(NSDictionary *myInfo))successBlock
errorBlock:(void(^)(NSError *error))errorBlock;
/*
POST account/update_profile_background_image
Updates the authenticating user's profile background image. This method can also be used to enable or disable the profile background image. Although each parameter is marked as optional, at least one of image, tile or use must be provided when making this request.
*/
- (void)postAccountUpdateProfileBackgroundImageWithImage:(NSString *)base64EncodedImage
title:(NSString *)title
includeEntities:(NSNumber *)includeEntities
skipStatus:(NSNumber *)skipStatus
use:(NSNumber *)use
successBlock:(void(^)(NSDictionary *profile))successBlock
errorBlock:(void(^)(NSError *error))errorBlock;
/*
POST account/update_profile_colors
Sets one or more hex values that control the color scheme of the authenticating user's profile page on twitter.com. Each parameter's value must be a valid hexidecimal value, and may be either three or six characters (ex: #fff or #ffffff).
*/
- (void)postAccountUpdateProfileColorsWithBackgroundColor:(NSString *)backgroundColor
linkColor:(NSString *)linkColor
sidebarBorderColor:(NSString *)sidebarBorderColor
sidebarFillColor:(NSString *)sidebarFillColor
profileTextColor:(NSString *)profileTextColor
includeEntities:(NSNumber *)includeEntities
skipStatus:(NSNumber *)skipStatus
successBlock:(void(^)(NSDictionary *profile))successBlock
errorBlock:(void(^)(NSError *error))errorBlock;
/*
POST account/update_profile_image
Updates the authenticating user's profile image. Note that this method expects raw multipart data, not a URL to an image.
This method asynchronously processes the uploaded file before updating the user's profile image URL. You can either update your local cache the next time you request the user's information, or, at least 5 seconds after uploading the image, ask for the updated URL using GET users/show.
*/
- (void)postAccountUpdateProfileImage:(NSString *)base64EncodedImage
includeEntities:(NSNumber *)includeEntities
skipStatus:(NSNumber *)skipStatus
successBlock:(void(^)(NSDictionary *profile))successBlock
errorBlock:(void(^)(NSError *error))errorBlock;
/*
GET blocks/list
Returns a collection of user objects that the authenticating user is blocking.
*/
- (void)getBlocksListWithincludeEntities:(NSNumber *)includeEntities
skipStatus:(NSNumber *)skipStatus
cursor:(NSString *)cursor
successBlock:(void(^)(NSArray *users, NSString *previousCursor, NSString *nextCursor))successBlock
errorBlock:(void(^)(NSError *error))errorBlock;
/*
GET blocks/ids
Returns an array of numeric user ids the authenticating user is blocking.
*/
- (void)getBlocksIDsWithCursor:(NSString *)cursor
successBlock:(void(^)(NSArray *ids, NSString *previousCursor, NSString *nextCursor))successBlock
errorBlock:(void(^)(NSError *error))errorBlock;
/*
POST blocks/create
Blocks the specified user from following the authenticating user. In addition the blocked user will not show in the authenticating users mentions or timeline (unless retweeted by another user). If a follow or friend relationship exists it is destroyed.
*/
- (void)postBlocksCreateWithScreenName:(NSString *)screenName
orUserID:(NSString *)userID
includeEntities:(NSNumber *)includeEntities
skipStatus:(NSNumber *)skipStatus
successBlock:(void(^)(NSDictionary *user))successBlock
errorBlock:(void(^)(NSError *error))errorBlock;
/*
POST blocks/destroy