what does the colon mean in the Twitter API Resource URL format? -
the twitter api retweeting shows resource url following:
http://api.twitter.com/1/statuses/retweet/:id.format
and says "id" required parameter.
so based on thought following aifnetworking call work. set: postpath:@"1.1/statuses/retweet.json"
and parameters: nsmutabledictionary *params = [nsmutabledictionary dictionarywithdictionary:@{@"id": tweetid}];
and entire call looks like:
- (void)postaretweet:(nsstring*)tweetid success:(void (^)(afhttprequestoperation *operation, id response))success failure:(void (^)(afhttprequestoperation *operation, nserror *error))failure { nsmutabledictionary *params = [nsmutabledictionary dictionarywithdictionary:@{@"id": tweetid}]; self postpath:@"1.1/statuses/retweet.json" parameters:params success:success failure:failure];}
but got 404 error telling me page didn't exist. after trial , error, forced postpath
postpath:@"1.1/statuses/retweet/@"some_tweet_number".json"
and worked.
so not understand why "params" entry "id" key did not appended original postpath supposed . thought perhaps postpath has include "id" , in addition same "id" parameter.
so :id mean in resource url?? why api required "id" of tweet part of url path , in addition passed parameter? seems redundant.
thanks
-malena
let's want retweet tweet id of 123456
. number :id
.
now, let's want response in xml. that's format
.
so can have
https://api.twitter.com/1.1/statuses/retweet/123456.xml
or
https://api.twitter.com/1.1/statuses/retweet/123456.json
do note api has changed version 1.1. should read documentation @ https://api.twitter.com/1.1/
for retweet documentation, see https://dev.twitter.com/docs/api/1.1/post/statuses/retweet/%3aid
Comments
Post a Comment