Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6052055
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 23, 20262026-05-23T07:53:07+00:00 2026-05-23T07:53:07+00:00

I am trying to import the contacts of a person using google contacts API

  • 0

I am trying to import the contacts of a person using google contacts API in the following PHP code . It uses OAuth 1.0 protocol :

<?php
    $consumer_key="www.spats.in";
    $secret="***********************";
    $mt = microtime();
    $rand = mt_rand();
    $nonce = md5($mt.$rand);

    $url="https://www.google.com/accounts/OAuthGetRequestToken";
    $params="oauth_callback=www.spats.in/nssc2/gmailContactsImport.php".
            "&oauth_consumer_key=$consumer_key".
            "&oauth_nonce=$nonce".
            "&oauth_signature_method=HMAC-SHA1".
            "&oauth_timestamp=".time().
            "&oauth_version=1.0".
            "&scope=https://www.google.com/m8/feeds/";

    $base_string = "GET&".urlencode($url).'?'.urlencode($params);
    $signature = base64_encode(hash_hmac('sha1', $base_string, $secret, true));
    $params.="&oauth_signature=".$signature;

    $result=file_get_contents($url."?".$params);
    echo $result;
?>

However, on executing the php code, the result is as follows :

signature_invalid base_string:GET&https%3A%2F%2Fwww.google.com%2Faccounts%2FOAuthGetRequestToken&oauth_callback%3Dwww.spats.in%252Fnssc2%252FgmailContactsImport.php%26oauth_consumer_key%3Dwww.spats.in%26oauth_nonce%3D36bc2ce5f00b79300d753bb94dc924df%26oauth_signature_method%3DHMAC-SHA1%26oauth_timestamp%3D1308644840%26oauth_version%3D1.0%26scope%3Dhttps%253A%252F%252Fwww.google.com%252Fm8%252Ffeeds%252F 

What is the problem with the signature? I can’t seem to figure it out.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-23T07:53:08+00:00Added an answer on May 23, 2026 at 7:53 am

    Okkay, the problem was with the key. I solved it myself.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm designing a Google Contacts Import application using OAuth and PHP. I'm trying to
i am trying to use Google OAuth to import a user 's contacts. In
I am using php5 and I am trying to import my contacts from my
I'm trying to download an image using this code: from urllib import urlretrieve urlretrieve('http://gdimitriou.eu/wp-content/uploads/2008/04/google-image-search.jpg',
I am trying to import the contact list from gmail using libgmailer.php but I
I'm trying to insert an array of new contacts from a temporary import table
I am trying to import the gmail contacts to my page but there is
I am trying to allow users to import their Hotmail contacts to my site
I'm trying to import a vcard into the android contacts. Within the contact manager
I am trying to get the profiles feed from my Google Apps domain using

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.