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 (Moderator: Donald Lobo) »
  • Mobile Client version compatibility
Pages: [1] 2

Author Topic: Mobile Client version compatibility  (Read 2539 times)

bstalcup

  • I post occasionally
  • **
  • Posts: 47
  • Karma: 1
  • CiviCRM version: 4.7.3
  • CMS version: Joomla!
  • MySQL version: 5.5.36-cll-lve
  • PHP version: 5.3.29
Mobile Client version compatibility
June 10, 2013, 10:47:05 am
Hello all,

I have a fully functional mobile client that is designed to interface with the CiviCRM database (you can view individuals, access their information, etc.).  The only problem is that it is designed to work with CiviCRM 4.2.9, not any later versions.  As a result (after a few tests), I found that this client does not work with any version 4.3.0 or higher.

So I guess what I'm asking is were there any major changes to the infrastructure of CiviCRM in the upgrade from 4.2.x to 4.3. 

The main file that the program interfaces with is rest.php, if that helps at all.

Thanks.

Coleman Watts

  • Administrator
  • I’m (like) Lobo ;)
  • *****
  • Posts: 2346
  • Karma: 183
  • CiviCRM version: The Bleeding Edge
  • CMS version: Various
Re: Mobile Client version compatibility
June 10, 2013, 10:52:27 am
See the api changelog especially the part about rest changes.
Try asking your question on the new CiviCRM help site.

bstalcup

  • I post occasionally
  • **
  • Posts: 47
  • Karma: 1
  • CiviCRM version: 4.7.3
  • CMS version: Joomla!
  • MySQL version: 5.5.36-cll-lve
  • PHP version: 5.3.29
Re: Mobile Client version compatibility
June 11, 2013, 06:16:39 am
Are just the HTTP calls of authenticate changed, or are all means of access changed as well?

Thanks.

xavier

  • Forum Godess / God
  • I’m (like) Lobo ;)
  • *****
  • Posts: 4453
  • Karma: 161
    • Tech To The People
  • CiviCRM version: yes probably
  • CMS version: drupal
Re: Mobile Client version compatibility
June 11, 2013, 06:22:31 am
Not sure I understood the question. but remove the login call, add api_key=xxx&key=yyy on each of the other calls and it should be good.

Another change: all the calls that change the state of the db (create or delete) needs to be done over post, the get/getsingle... can be done using post or get.

Use the api explorer, it should help you finding your way.

Is your mobile client visible somewhere?

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

bstalcup

  • I post occasionally
  • **
  • Posts: 47
  • Karma: 1
  • CiviCRM version: 4.7.3
  • CMS version: Joomla!
  • MySQL version: 5.5.36-cll-lve
  • PHP version: 5.3.29
Re: Mobile Client version compatibility
June 11, 2013, 06:41:59 am
The mobile client is written in Javascript and the information is retreived through the database from that, not via a call to a URL, so I'm not sure how I could even add the api_key and key to the call.

Is there something I am missing?  I did not develop the app myself, but I'm pretty sure I have a basic understanding of how it works. 

Where can I access the API explorer?

Here is a link to the mobile client:  http://civicrmmobile.cloudaccess.net
Let me know what you think.  It's not functioning 100%, but it's something we're hoping to be able to contribute to Civi at some point in the future.
« Last Edit: June 11, 2013, 06:44:21 am by bstalcup »

xavier

  • Forum Godess / God
  • I’m (like) Lobo ;)
  • *****
  • Posts: 4453
  • Karma: 161
    • Tech To The People
  • CiviCRM version: yes probably
  • CMS version: drupal
Re: Mobile Client version compatibility
June 11, 2013, 07:21:18 am
Are you storing the result in some temporary table or is this directly hitting civi?

If the later, then you can simply rely on the native ajax backend, replace your call to rest.php to civicrm/ajax/rest and (assuming you are already authenticated) it should work directly by using your session cookie to authenticate

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

bstalcup

  • I post occasionally
  • **
  • Posts: 47
  • Karma: 1
  • CiviCRM version: 4.7.3
  • CMS version: Joomla!
  • MySQL version: 5.5.36-cll-lve
  • PHP version: 5.3.29
Re: Mobile Client version compatibility
June 11, 2013, 07:29:05 am
Quote from: xavier on June 11, 2013, 07:21:18 am
replace your call to rest.php to civicrm/ajax/rest


What should the directory of the civicrm/ajax/rest file be?  I can't seem to find it on either version 4.3.3 or 4.2.9


xavier

  • Forum Godess / God
  • I’m (like) Lobo ;)
  • *****
  • Posts: 4453
  • Karma: 161
    • Tech To The People
  • CiviCRM version: yes probably
  • CMS version: drupal
Re: Mobile Client version compatibility
June 11, 2013, 07:36:16 am
I meant the "normal" civicrm path (it's different for joomla, WP and drupal), like civicrm/contact/search for the search

this blog post should help you (sorry, it's using drupal as the CMS)

http://civicrm.org/API_version_3

and more details:
http://wiki.civicrm.org/confluence/display/CRMDOC43/AJAX+Interface
-Hackathon and data journalism about the European parliament 24-26 jan. Watch out the result

bstalcup

  • I post occasionally
  • **
  • Posts: 47
  • Karma: 1
  • CiviCRM version: 4.7.3
  • CMS version: Joomla!
  • MySQL version: 5.5.36-cll-lve
  • PHP version: 5.3.29
Re: Mobile Client version compatibility
June 11, 2013, 08:17:36 am
I can't seem to find the API explorer.  I watched your video and looked at the link you posted but I still can't seem to find it

if the URL for the civicrm folder on my website is

www.example.org/administrator/components/com_civicrm/civicrm/

How would I access the API explorer and subsequently the AJAX version of rest?

xavier

  • Forum Godess / God
  • I’m (like) Lobo ;)
  • *****
  • Posts: 4453
  • Karma: 161
    • Tech To The People
  • CiviCRM version: yes probably
  • CMS version: drupal
Re: Mobile Client version compatibility
June 11, 2013, 05:05:47 pm
http://joomla.demo.civicrm.org/administrator/?option=com_civicrm&task=civicrm/api/explorer

seems it's in the task param on joomla
-Hackathon and data journalism about the European parliament 24-26 jan. Watch out the result

bstalcup

  • I post occasionally
  • **
  • Posts: 47
  • Karma: 1
  • CiviCRM version: 4.7.3
  • CMS version: Joomla!
  • MySQL version: 5.5.36-cll-lve
  • PHP version: 5.3.29
Re: Mobile Client version compatibility
June 12, 2013, 06:52:14 am
Thank you, this helps a lot.  Will the ajax version continue to support the login authentication?  Or is that something that will be obsolete in a few patches

 

bstalcup

  • I post occasionally
  • **
  • Posts: 47
  • Karma: 1
  • CiviCRM version: 4.7.3
  • CMS version: Joomla!
  • MySQL version: 5.5.36-cll-lve
  • PHP version: 5.3.29
Re: Mobile Client version compatibility
June 12, 2013, 07:11:20 am
One more quick question,

What's the difference between "api_key" and "key"  (when entering values into the rest query)?  Specifically, what ARE they and where can I find them?  What role do they play in authentication?  I know that there is a site key and a key entered into the contact's information in the database, but I'm not sure how it does the authentication.  Is there something I'm missing?

Thanks.

xavier

  • Forum Godess / God
  • I’m (like) Lobo ;)
  • *****
  • Posts: 4453
  • Karma: 161
    • Tech To The People
  • CiviCRM version: yes probably
  • CMS version: drupal
Re: Mobile Client version compatibility
June 12, 2013, 07:14:02 am
Check out the wiki, it should clarify all that

http://wiki.civicrm.org/confluence/display/CRMDOC43/REST+interface
-Hackathon and data journalism about the European parliament 24-26 jan. Watch out the result

bstalcup

  • I post occasionally
  • **
  • Posts: 47
  • Karma: 1
  • CiviCRM version: 4.7.3
  • CMS version: Joomla!
  • MySQL version: 5.5.36-cll-lve
  • PHP version: 5.3.29
Re: Mobile Client version compatibility
June 12, 2013, 07:54:53 am
Okay, I took a look at that and it definitely cleared some things up, thanks.

However, when I enter a search query with the correct api_key and key, I get no response (however when I make one of them incorrect, I get an error message).  When I use this search query:
Code: [Select]
rest.php?entity=Contact&action=get&debug=1&sequential=1&json=1&api_key=APIKEYHERE&key=KEYHEREI should get a list of 25 (the default max) contacts in the database, but I'm getting no response

Any clue why it might be doing this?  Do I have to modify the REST.php file at all?  It says something about it in the wiki article, but it seems outdated, since none of the things it said to change were still in the REST.php file.

Thanks
« Last Edit: June 12, 2013, 08:02:59 am by bstalcup »

xavier

  • Forum Godess / God
  • I’m (like) Lobo ;)
  • *****
  • Posts: 4453
  • Karma: 161
    • Tech To The People
  • CiviCRM version: yes probably
  • CMS version: drupal
Re: Mobile Client version compatibility
June 12, 2013, 09:34:40 am
No response is weird, check the log, you should get a warning or error.

As for using the ajax backend: its point is to rely on the CMS authentication, as long as the login is done in your CMS and the session is set, it will work

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

Pages: [1] 2
  • CiviCRM Community Forums (archive) »
  • Old sections (read-only, deprecated) »
  • Developer Discussion (Moderator: Donald Lobo) »
  • Mobile Client version compatibility

This forum was archived on 2017-11-26.