Request failed: forbidden (403)

ios
objective-c
twitterkit

#1

Hi,
When I tried to call this API https://api.twitter.com/1.1/followers/list.json?count=10&cursor=-1&screen_name=@""&user_id=@""} , this error appear . What I can do with this ?
Error Domain=TwitterAPIErrorDomain Code=200 “Request failed: forbidden (403)” UserInfo={NSLocalizedFailureReason=Twitter API error : Forbidden. (code 200), TWTRNetworkingStatusCode=403, NSErrorFailingURLKey=https://api.twitter.com/1.1/guest/activate.json, NSLocalizedDescription=Request failed: forbidden (403)}
Thanks :slight_smile:
Nada Gamal


#2

Hi Nada, how are you signing this request? Are you using a guest token? If you can share some code for how you’re making the request, that would help!


#3

Hi beardigsit,
Kindly find the code , I have an access token but I don’t know how I pass the access_Token and access token secret to the API , and I set all keys at app delegate and plist files like following
[[Twitter sharedInstance]startWithConsumerKey:@"" consumerSecret:@""];

Please advice me :slight_smile:
TWTRAPIClient *client = [[TWTRAPIClient alloc] init];

NSDictionary * parameters=[[NSDictionary alloc]initWithObjects:@[username, cursor,@"10",[[NSUserDefaults standardUserDefaults]objectForKey:USER_ID]] forKeys:@[@"screen_name",@"cursor",@"count",@"user_id"]];
NSError *clientError;
NSURLRequest *request = [client URLRequestWithMethod:@"GET" URL@"https://api.twitter.com/1.1/followers/list.json"parameters:parameters error:&clientError];
    if (request) {
    [client sendTwitterRequest:request completion:^(NSURLResponse *response, NSData *data, NSError *connectionError) {
        if (data) {
         
        }
        else {
            NSLog(@"Error: %@", connectionError);
     


        }
    }];