개발하자
python FASTAPI를 사용하여 Xero에 새 연락처 추가
Cuire
2023. 10. 8. 16:47
반응형
python FASTAPI를 사용하여 Xero에 새 연락처 추가
python FASTAPI를 사용하여 Xero에 새 연락처를 추가하려고 합니다:
새 접점을 정하다
contact = {
"Contacts": [
{
"Name": "24 locks",
"FirstName": "Ben",
"LastName": "Bowden",
"EmailAddress": "ben.bowden@24locks.com",
"ContactPersons": [
{
"FirstName": "John",
"LastName": "Smith",
"EmailAddress": "john.smith@24locks.com",
"IncludeInEmails": "true"
}
]
}
]
}
콜제로API
get_url = 'https://api.xero.com/api.xro/2.0/Contacts'
response = requests.post(get_url,
headers = {
'Authorization': 'Bearer ' + access_token,
'Xero-tenant-id': xero_tenant_id,
'Accept': 'application/json'
},
data = contact
)
json_response = response.json()
다음 오류가 발생합니다:
{'ErrorNumber': 17, 'Type': 'NoDataProcessedException', 'Message': 'No data has been processed for this endpoint. This endpoint is expecting Contact data to be specifed in the request body.'}
누가 좀 도와줄래요?
제가 다른 방법으로 사용하고 있기 때문에 그렇게 추정해도 되고, 그 방법들은 잘 작동합니다.
감사해요.
대신 사용하거나 헤더를 설정해 보십시오
지정되지 않은 경우 기본값은 ,
반응형