반응형
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.'}
누가 좀 도와줄래요?
제가 다른 방법으로 사용하고 있기 때문에 그렇게 추정해도 되고, 그 방법들은 잘 작동합니다.
감사해요.
대신 사용하거나 헤더를 설정해 보십시오
지정되지 않은 경우 기본값은 ,
반응형
'개발하자' 카테고리의 다른 글
파이썬으로 ssh-agent를 영구적으로 시작하는 방법은? (0) | 2023.10.09 |
---|---|
입력 파일 상태에 대한 정의 유형: 반응+타입스크립트 (0) | 2023.10.09 |
플러터 리버팟: 첫 번째 실행이 실패한 후 FutureProvider를 트리거하는 방법은 무엇입니까? (0) | 2023.10.08 |
terraform plan이 Error를 반환합니다: 지원되지 않는 인수 (1) | 2023.10.07 |
Terraform lambda source_code_hash 업데이트 동일한 코드로 (0) | 2023.10.07 |