高层API在添加人员时会给出“无名"错误,即使已提供 [英] High rise API giving a 'No first name' error when adding a person, even though its provided

查看:39
本文介绍了高层API在添加人员时会给出“无名"错误,即使已提供的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试使用HighRise的API创建一个新人:

I'm attempting to create a new person using HighRise's 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'

但是,这给出了以下输出:

However, this gives the following output:

<?xml version="1.0" encoding="UTF-8"?>
<errors>
  <error>First name  is missing. Contacts must have a name</error>
</errors>

我很困惑,因为我似乎正在遵循他们的API并按他们期望的方式提供信息(如

I'm quite confused, as I seem to be following their API and providing the info as they expect it (as documented here).

这是他们API中的错误,还是我做错了什么?

Is this a bug in their API, or am I doing something wrong?

推荐答案

通常,它需要在XML POST请求中添加 Content-Type 标头.在您的curl请求中添加以下内容.

Usually it requires to add the Content-Type header with xml POST request. Add the following with your curl request.

-H "Content-Type: application/xml"

这篇关于高层API在添加人员时会给出“无名"错误,即使已提供的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
相关文章
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆