ben
ben

Reputation: 6180

Use Yahoo Contacts API to import all contacts using there API, using OAuth2 token

I am able to get an OAuth 2.0 access token from Yahoo. I want to import my Yahoo contacts using their contacts API. I am searching for an example or tutorial explaining this and the closest I got to is this part making API request. The problem is that I do not understand how it is being used. Maybe if someone could point out to me how to use the token I am getting from OAuth 2.0 to get all my Yahoo contacts, that could really help me.

This is a sample token that I am trying to use with it.

{
      "access_token":"3BnekXnMvl4ylLQ1EplCHGwsA9yjK9b9Ay_jXxdFyyesD.On78E8c.2NszplCmZD.VqxNX46r.ayCfY99rbICnWcxqC7wR3VlI_hSJ4mG8ZlghyYJidTcOzpGnGfA89E2R.Omf3OkMue_7rQY6OkuGckm0ukmLfXOpQRmgEG4e24Y_oakM3xb3aFI9KVOGYdsPWm1nsepGqTomhqMzGteXlRKr3xCP2jRbyN82hV1MLu_uG3SDUYs.ZTjnnYSFgmzx3IxcdbRqAgRr9hSpWJR_Sg3quXfJQG5pnesTAu_oNrGE.wWDunAGzVYLsLElWhZuyoVlILBt8NGtqqbpw8MXZo._68mmEr5ORO9qebAYKaS3hBpfbEs41ZU4dfohglEil4oeKw6VzICu3TYttCjix2f.5f3uc69nybN2z20aiJ5sTLTJ4_1fycfdXz_JVdNLI6TR_aZlGO3fhuiw3h3Q1x5mc6xBcil3EuYUa_b2YJ9IDgEwAbalpFf2sSXeXAh0Wr4mCarrdV3xPpUd5DFG4n0yEIkSIwR_P_U2gj8BLpp.2mqPSQQRcXlCY8clx_kloqCCsv1Wsw4GjPkcYlBvtHACxypXuszAwV.sI_ME9envDAPMFOc9JTwTOkmXLeVKei4cN_V44lCTGtfBMYgraGFvq1AIrvUxb5UbF1EPmh9LpOY2S2_k32x9TTuh8RRZoaUJG7RQ2kbVt9B_aEMVzYFF8EhVn5gu8zTQsVjHx1ul9Y4VKRN5Aazx5HFJEDWSwlp3BTRJZPbRqFtQ7do1tF..D2NYDAGbuvJjG_UlUesy0mo7Pw4HmOqo5bb5b6Yz49kmtYMho2KUZk9",
      "token_type":"bearer",
      "expires_in":3600,
      "refresh_token":"ABcap1S5Z.8eIxtTG._Stv4SarhjDRH5373tRHzH6FNXTreGfghKnYW4w--",
      "xoauth_yahoo_guid":"D64PMTXWAMU6HYQRPVBVBEGPPU"
  }

Any help will be highly appreciated.

Upvotes: 1

Views: 3172

Answers (1)

Hans Z.
Hans Z.

Reputation: 53888

Use the access token in there (the value of the access_token element) in a call like this:

curl -H "Authorization: Bearer <access_token>" https://social.yahooapis.com/v1/user/me/contacts?format=json

assuming that the client application was authorized in the developer console to access the contacts API. You'll really need to use this API URL because the YDL endpoint (query.yahooapis.com) doesn't support OAuth tokens (yet?).

Upvotes: 3

Related Questions