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) »
  • Discussion »
  • Extensions (Moderators: mathieu, totten, kasiawaka) »
  • api calls
Pages: [1]

Author Topic: api calls  (Read 707 times)

dlats

  • I post occasionally
  • **
  • Posts: 77
  • Karma: 0
  • CiviCRM version: 4.0.7
  • CMS version: Drupal 7.12
  • MySQL version: 5.0.91
  • PHP version: 5.2.17
api calls
July 07, 2013, 12:35:22 pm
I have an extension with lots of js on the page .tpl. I've added some api functions for CaseTypes. One of these has a stringified complex object that it tries to send resulting in a 406.

form_data['obj'] = JSON.stringified(data_obj);
 CRM.api('CASEType', 'get', form_data,
          {success: function(data) {
          .............
         }
          }
        );
   });

Coleman Watts

  • Administrator
  • I’m (like) Lobo ;)
  • *****
  • Posts: 2346
  • Karma: 183
  • CiviCRM version: The Bleeding Edge
  • CMS version: Various
Re: api calls
July 07, 2013, 02:01:03 pm
You do not need to stringify objects before sending them into CRM.api. You may pass in objects.
Try asking your question on the new CiviCRM help site.

dlats

  • I post occasionally
  • **
  • Posts: 77
  • Karma: 0
  • CiviCRM version: 4.0.7
  • CMS version: Drupal 7.12
  • MySQL version: 5.0.91
  • PHP version: 5.2.17
Re: api calls
July 07, 2013, 02:11:03 pm
Thanks. That fixed it.

Pages: [1]
  • CiviCRM Community Forums (archive) »
  • Discussion »
  • Extensions (Moderators: mathieu, totten, kasiawaka) »
  • api calls

This forum was archived on 2017-11-26.