title: Google Contacts API (contacts.readonly)
body: <p>I'm developing a C Library to access my google contacts information to be used in a C command line app (for personal use only).
  I'm trying to authenticate with the scope: <a href="https://www.googleapis.com/auth/contacts.readonly" rel="nofollow noreferrer">https://www.googleapis.com/auth/contacts.readonly</a>     but the answer is always "invalid_scope".
  Any suggestion?</p>
  
  <p>EDIT:
  Some more information about my problem.
  I created a Google Project and enabled some APIs (Contacts API and People API).
  I'm using curl and a JSON library to communicate with Google APIs.
  The code that I'm using is:</p>
  
  <pre><code>#define GOOGLE_AUTH_URL "https://accounts.google.com/o/oauth2/device/code"
  #define GOOGLE_AUTH_POST "client_id="GOOGLE_AUTH_CLIENT_ID"&amp;scope=email profile https://www.googleapis.com/auth/contacts.readonly"
  
  int main(void) {
      char * res = handle_url(GOOGLE_AUTH_URL,GOOGLE_AUTH_POST); // use curl to make a POST
  
      if (res==NULL) {
          Report("Error");
          return -1;
      }
      cJSON *obj = cJSON_Parse(res);
      printf("Result=%s\n",cJSON_Print(obj));
      return 0;
  }
  </code></pre>
  
  <p>... and the result is:</p>
  
  <pre><code>Result={
          "error":        "invalid_scope"
  }
  </code></pre>
  
  <p>If I change the define to:</p>
  
  <pre><code>#define GOOGLE_AUTH_POST "client_id="GOOGLE_AUTH_CLIENT_ID"&amp;scope=email profile https://www.googleapis.com/auth/contacts"
  </code></pre>
  
  <p>the result is:</p>
  
  <pre><code>Result={
          "verification_url":     "https://www.google.com/device",
          "expires_in":   1800,
          "interval":     5,
          "device_code":  "AH-1Ng2lAE01qw5HFlGQqT02q7dtmAE6WmKJ_FkH0mO4enJMybvCvRzXnazvyUm22-sJR51ZtKkIJjOT-QhO0PJBUZpCdLrOEw",
          "user_code":    "JNXW-WQPJ"
  }
  </code></pre>