高层 API 在添加人员时出现 'No first name' 错误,即使它已提供
High rise API giving a 'No first name' error when adding a person, even though its provided
我正在尝试使用 HighRise 的 API 创建一个新人:
curl -u xxxxxxx:X -XPOST -d '<?xml version="1.0" encoding="UTF-8"?>
<person>
<first-name>Test</first-name>
<last-name>Acct</last-name>
<title>CEO</title>
<company-name>Test inc</company-name>
<contact-data>
<email-addresses>
<email-address>
<address>a@b.com</address>
<location>Home</location>
</email-address>
</email-addresses>
<phone-numbers>
<phone-number>
<number>1111</number>
<location>Home</location>
</phone-number>
</phone-numbers>
</contact-data>
</person>' 'https://xxxxxx.highrisehq.com/people.xml'
但是,这会产生以下输出:
<?xml version="1.0" encoding="UTF-8"?>
<errors>
<error>First name is missing. Contacts must have a name</error>
</errors>
我很困惑,因为我似乎在关注他们 API 并提供他们期望的信息(如记录 here)。
这是他们 API 中的错误,还是我做错了什么?
通常需要添加 Content-Type
header 和 xml POST 请求。在您的 curl 请求中添加以下内容。
-H "Content-Type: application/xml"
我正在尝试使用 HighRise 的 API 创建一个新人:
curl -u xxxxxxx:X -XPOST -d '<?xml version="1.0" encoding="UTF-8"?>
<person>
<first-name>Test</first-name>
<last-name>Acct</last-name>
<title>CEO</title>
<company-name>Test inc</company-name>
<contact-data>
<email-addresses>
<email-address>
<address>a@b.com</address>
<location>Home</location>
</email-address>
</email-addresses>
<phone-numbers>
<phone-number>
<number>1111</number>
<location>Home</location>
</phone-number>
</phone-numbers>
</contact-data>
</person>' 'https://xxxxxx.highrisehq.com/people.xml'
但是,这会产生以下输出:
<?xml version="1.0" encoding="UTF-8"?>
<errors>
<error>First name is missing. Contacts must have a name</error>
</errors>
我很困惑,因为我似乎在关注他们 API 并提供他们期望的信息(如记录 here)。
这是他们 API 中的错误,还是我做错了什么?
通常需要添加 Content-Type
header 和 xml POST 请求。在您的 curl 请求中添加以下内容。
-H "Content-Type: application/xml"