API & Developers

API & Developers

Connect with other developers from around the world and collaborate on ideas using the Smartsheet API.

"errorCode": 1002, "message": "Your Access Token is invalid." EU

edited 03/03/25 in API & Developers

When I tired accessing the sheet, I was getting invalid access token. But after changing the region [EU]. Now I'm able to access the Smartsheet's' data.

Code :

import smartsheet

# Replace with your actual API key and sheet ID
api_key = "Your API key"  # Ensure this is a valid API key
sheet_id = valid sheet ID (num) # Replace with a valid sheet ID

# Initialize Smartsheet client for EU region with API key
client = smartsheet.Smartsheet(api_key, api_base="https://api.smartsheet.eu/2.0")

try:
    # Retrieve sheet details
    sheet = client.Sheets.get_sheet(sheet_id)

    print("Columns in the sheet:")
    for column in sheet.columns:
        print(f"Name: {column.title}, ID: {column.id}")

except smartsheet.exceptions.ApiError as e:
    print(f"Smartsheet API Error: {e}")
except Exception as e:
    print(f"An error occurred: {e}")

Answers

  • Overachievers Alumni

    hi @Prasanth_reddy,

    US domain and EU domain are completely different instances that are not having the same data inside.

    if you create sheet in EU domain is not visible at all in US domain and you cannnot share it with someone from US domain etc. the only way to have it in US domain would be to export to excel and import to US domain etc.

    that could be your issue hope it helps.

    Tomasz Kowalski

    The Real Smartsheet Enthusiast

    Is there anything else we can help you with? - book your time.

    MASA Consult - Your Aligned Smartsheet Gold Partner

    Find us on LinkedIn & Check our Smartsheet Solutions!

    Tag my name: @kowal if you want me to respond :)

Trending in API & Developers