У кого -нибудь есть опыт подключения к API NetSuite? Ключи, все еще получая ошибку 401 при попытке подключиться к моему коду Python. Использование pycharm в качестве ide. < /P>
Вот мой код -< /p>
import requests
from requests_oauthlib import OAuth1
# Replace these with your actual NetSuite credentials
account_id = 'my_account_id'
consumer_key = 'my_consumer_key'
consumer_secret = 'my_consumer_secret'
token = 'my_token '
token_secret = 'my_token_secret'
url = f'https://{account_id}.suitetalk.api.netsuite.com/services/rest/record/v1/customer'
auth = OAuth1(consumer_key, consumer_secret, token, token_secret, signature_method='HMAC-SHA256')
headers = {
'Content-Type': 'application/json'
}
response = requests.get(url, auth=auth, headers=headers)
if response.status_code == 200:
print(response.json())
else:
print(f"Error: {response.status_code} - {response.json()}")
< /code>
error -< /p>
C:\\Users\\username\\AppData\\Local\\Programs\\Python\\Python313\\python.exe C:\\Users\\username\\PycharmProjects\\NetSuiteAPI\\netsuite_integration.py
Error: 401 - {'type': 'https://www.rfc-editor.org/rfc/rfc9110. ... ion-15.5.2', 'title': 'Unauthorized', 'status': 401, 'o:errorDetails': \[{'detail': 'Invalid login attempt.', 'o:errorCode': 'INVALID_LOGIN_ATTEMPT'}\]}
Process finished with exit code 0
Подробнее здесь: https://stackoverflow.com/questions/792 ... -in-python