Trying to retrieve all contacts in zendesk sell using API | Community
Skip to main content

Trying to retrieve all contacts in zendesk sell using API

  • January 11, 2022
  • 4 replies
  • 0 views

Hanna14

Hello - 

I am trying to retrieve all contacts in zendesk sell using the following code:

import requests
import json

response = requests.get(
    url='https://api.getbase.com/v2/contacts',
    headers={
      'Accept': 'application/json',
      'Authorization': 'Bearer $ACCESS_TOKEN'
    },
    verify=True
  )

print(response.text)

I am getting this output:

{"errors":[{"error":{"code":"unauthorized","message":"request is unauthorized","details":"Required access token is missing, malformed, expired, or invalid."},"meta":{"type":"error","links":{"more_info":"https://developers.getbase.com/docs/rest/articles/errors"}}}],"meta":{"type":"errors","http_status":"401 Unauthorized","logref":"f0e9da8e6f52da411e187017dead7b69","links":{"more_info":"https://developers.getbase.com/docs/rest/articles/errors"}}}

Does anyone know what I am doing wrong here?

4 replies

Eric27
  • January 12, 2022
Hi Hanna,

It looks like your oAuth token isn't valid. Have you went through the process outlined here?

Thanks!

Hanna14
  • Author
  • January 12, 2022

Hi Eric,

I'm looking at my OAuth2 Settings in Zendesk Sell, but I cannot see the Access Token. It is shown as ************************e4. Should I create a new one?

Hanna


Hanna14
  • Author
  • January 27, 2022

Hi Eric, 

You can disregard my last message. I figured it out!

Hanna


Sanket11
  • July 26, 2023

Hello Hanna,

I am facing the same issue

What resolution You have applied?