YouTube api v3 Invalid Credentials access token
<p>I am getting 401 Invalid Credentials error trying to use the Youtube API in the OAuth 2.0.</p>

<p>I used google sign in sdk and get access_token with params:</p>

<pre><code>    GIDSignIn *sharedSignIn = [GIDSignIn sharedInstance];

sharedSignIn.shouldFetchBasicProfile = NO;

sharedSignIn.scopes = [NSArray arrayWithObjects:
                       @"https://www.googleapis.com/auth/youtube.force-ssl",
                       @"https://www.googleapis.com/auth/youtube",
                       @"https://www.googleapis.com/auth/youtube.readonly",
                      // @"https://www.googleapis.com/auth/youtube.upload",
                       nil];

[sharedSignIn signIn];
</code></pre>

<p>Than I used AFNetworking library for GET request</p>

<pre><code>- (void) getInformationWithParams: (NSDictionary *) params
                       method: (NSString *) method
                    onSuccess: (void(^)(NSDictionary *responseObject)) success
                    onFailure: (void (^) (NSError *error)) failure {

[self.requestOperationManager GET:method
                       parameters:params
                         progress:nil
                          success:^(NSURLSessionDataTask * _Nonnull task, NSDictionary *responseObject) {

                              NSLog(@"%@", responseObject);

                              if (success) {
                                  success(responseObject);
                              }

                          }
                          failure:^(NSURLSessionDataTask * _Nullable task, NSError * _Nonnull error) {

                              NSLog(@"getInformationWithParams Error: %@", error);

                              if (failure) {
                                  failure(error);
                              }

                          }];
</code></pre>

<p>}</p>

<p>previously I did baseURL init </p>

<pre><code>        NSURL *baseURL = [NSURL URLWithString:@"https://www.googleapis.com/youtube/v3"];
    self.requestOperationManager = [[AFHTTPSessionManager alloc] initWithBaseURL:baseURL];
</code></pre>

<p>and in the end I get request through</p>

<pre><code>    NSDictionary *params = [NSDictionary dictionaryWithObjectsAndKeys:
                     @"snippet",   @"part",
                     @"true",   @"home",
                      myApiKey, @"key",
                        myAccessToken, @"access_token",
                        nil];

[[SMServerManager sharedManager] getInformationWithParams:params
                                                   method:@"activities"
                                                onSuccess:^(NSDictionary *responseObject) {

                                                }
                                                onFailure:^(NSError *error) {

                                                }];
</code></pre>

<p>I don't understand what I'm doing wrong.</p>

<p>PS: Requests work if they don't need to use acces_token. </p>