Highrise Custom Fields

2019-08-17 04:47发布

问题:

I am hoping someone can help me out with this. I am trying to use the Highrise API to insert some data, but for some reason I can not get the custom fields to insert. When I submit the curl request, all of the data except for the custom fields gets added and there is no error message. Below is the XML that is being posted:

<person>
    <first-name>Testing</first-name>
    <last-name>Account</last-name>
    <contact-data>
        <email-addresses>
            <email-address>
                <address>BigB@boom.com</address>
                <location>Work</location>
            </email-address>
        </email-addresses>
        <phone-numbers>
            <phone-number>
                <number>555-555-8811</number>
                <location>Work</location>
            </phone-number>
        </phone-numbers>
        <addresses>
                <address>
                <city>Intergalactic</city>
                <state>Space</state>
                <street>111 Sun Blvd</street>
                <zip>12345</zip>
                <location>Work</location>
            </address>
        </addresses>
    </contact-data>
    <subject_datas>
        <subject_data>
            <subject_field_id>111111</subject_field_id>
            <value>testing</value>
        </subject_data>
    </subject_datas>
</person>

This is an example that highrise has in the documentation:

<person>
  <first-name>John</first-name>
  <last-name>Doe</last-name>
  <title>CEO</title>
  <company-name>Doe Inc.</company-name>
  <background>A popular guy for random data</background>
  <linkedin_url>http://us.linkedin.com/in/john-doe</linkedin_url>
  <contact-data>
    <email-addresses>
      <email-address>
        <address>john.doe@example.com</address>
        <location>Work</location>
      </email-address>
    </email-addresses>
    <phone-numbers>
      <phone-number>
        <number>555-555-5555</number>
        <location>Work</location>
      </phone-number>
      <phone-number>
        <number>555-666-6666</number>
        <location>Home</location>
      </phone-number>
    </phone-numbers>
  </contact-data>
  <!-- start of custom fields -->
  <subject_datas type="array">
    <subject_data>
      <value>Chicago</value>
      <subject_field_id type="integer">2</subject_field_id>
    </subject_data>
  </subject_datas>
  <!-- end of custom fields -->
</person>

The subject_field_id is the global ID for that field not the individual entry id.

Here is the API documentation I have tried several combinations of things but no luck. I am hoping someone might have some experience with this..

回答1:

I had the same problem, you have to add attribute to "subject_datas":

<subject_datas type="array">

Then it should work.



回答2:

Add this to the subject data fields:

<subject-field-label>your fields label</subject-field-label>



标签: php xml highrise