CiviCRM Community Forums (archive)

*

News:

Have a question about CiviCRM?
Get it answered quickly at the new
CiviCRM Stack Exchange Q+A site

This forum was archived on 25 November 2017. Learn more.
How to get involved.
What to do if you think you've found a bug.



  • CiviCRM Community Forums (archive) »
  • Old sections (read-only, deprecated) »
  • Developer Discussion »
  • APIs and Hooks (Moderator: Donald Lobo) »
  • Problem adding address data through REST URLs
Pages: [1]

Author Topic: Problem adding address data through REST URLs  (Read 2388 times)

AJA

  • Guest
Problem adding address data through REST URLs
December 01, 2008, 04:24:13 pm
The title says most of it, but to be precise, the majority of the field names in the returned XML from a contact search through a REST call don't actually add any data. Only the first_name last_name, email and custom data fields (i.e. "custom_16") seem to do anything.

Here's an example URL string that my scripts generate in order to update data

http://my-server/path/to/drupal/modules/civicrm/extern/rest.php?q=civicrm/contact/add&contact_id=7371&first_name=Test&last_name=Test&email=test@example.com&street_address=abc123dr&postal_code=12345&phone=(123)+129+345-5678&custom_41=Howdy&contact_type=Individual&key=<blahblah>

The custom field is updated, and so are the email and name fields - nothing else.

Is there any place to look for this info that isn't totally misleading and cryptic (like the profile standalone forms tend to be)?

Or, maybe someone, just, like knows the answer :~)

xavier

  • Forum Godess / God
  • I’m (like) Lobo ;)
  • *****
  • Posts: 4453
  • Karma: 161
    • Tech To The People
  • CiviCRM version: yes probably
  • CMS version: drupal
Re: Problem adding address data through REST URLs
December 01, 2008, 11:08:59 pm
Hi,

Have a look at the api, the rest is just a wrapper: api/v2/Contact.php

I'd guess you have to set the location type (HOME, WORK...) to make it work. Don't know the syntax (nor if it works without changing the code).
I've seen that for email there is already a workaround.

Have a look a the name of the fields in the contact edit form, might be a hint of the right syntax.

Good luck
-Hackathon and data journalism about the European parliament 24-26 jan. Watch out the result

Pages: [1]
  • CiviCRM Community Forums (archive) »
  • Old sections (read-only, deprecated) »
  • Developer Discussion »
  • APIs and Hooks (Moderator: Donald Lobo) »
  • Problem adding address data through REST URLs

This forum was archived on 2017-11-26.