Invalid signed request: Missing required parameter

I got the following responsewhen getting my photo from Instagram. Please help us with any help.

{ 
code = 403;
    "error_message" = "Invalid signed-request: Missing required parameter 'sig'";
    "error_type" = OAuthForbiddenException;
}

Here is my code

  NSURL *url = [NSURL URLWithString:@"https://api.instagram.com/v1/tags/nofilter/media/recent?access_token=...........aef2"];
    NSURLRequest *urlRequest = [NSURLRequest requestWithURL:url];
    NSOperationQueue *queue = [[NSOperationQueue alloc] init];
    [NSURLConnection sendAsynchronousRequest:urlRequest queue:queue completionHandler:^(NSURLResponse *response, NSData *data, NSError *error) {            
   if (error){
        }
        else {   
            NSString * a = [[NSString alloc] initWithData:data encoding:NSASCIIStringEncoding];
            NSDictionary *tokenData = [jResponse objectWithString:a];
            NSLog(@"%@",tokenData);

        }
    }];
+4
source share
2 answers

It looks like you turned it on Enforce Signed Requests, so it requires a parameter sig, which is the signature for the API request, described here: https://www.instagram.com/developer/secure-api-requests/

Either generate a signature or disable Enforce Signed Requests

, API ( ), , client_secret . , . Enforce Signed Requests API .

+4
0

Source: https://habr.com/ru/post/1628948/


All Articles