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) »
  • Help with Version 2 API Login in 3.4.8?
Pages: [1]

Author Topic: Help with Version 2 API Login in 3.4.8?  (Read 862 times)

pbarmak

  • I post occasionally
  • **
  • Posts: 111
  • Karma: 3
  • CiviCRM version: 3.3.5
  • CMS version: Pressflow 6.19
  • MySQL version: 5.1
  • PHP version: 5.2.10
Help with Version 2 API Login in 3.4.8?
September 20, 2014, 04:21:29 pm
Hi all,
We're slowly trying to upgrade ourselves from 3.3.x to 4.5.  Our idea was to get to 3.4.8 and then 4.1, and so on.  For now, we wanted to get to 3.4.8 and continue using version 2 of the APIs (until I have time to convert all our code over to v3).

However, leaving everything as it was in our code, our first call to the API, the login, is failing.  This is our rest call:
https://crm.forwardedge.org/sites/all/modules/civicrm/extern/rest.php?q=civicrm/login&name=feicron&pass=*******&key=********

We immediately get this error: "Sorry, unrecognized username or password."

I haven't checked on whether we need to do something special to keep using the v2 API in 3.4.8.  I tried putting "&version=2" in the call but that didn't help.

Any chance some one knows the quick solution to this?  I'd love to keep our production code running in v2 while I take my time converting.  Appreciate the help!

Eileen

  • Forum Godess / God
  • I’m (like) Lobo ;)
  • *****
  • Posts: 4195
  • Karma: 218
    • Fuzion
Re: Help with Version 2 API Login in 3.4.8?
September 20, 2014, 05:25:21 pm
We have one customer we were unable to completely get off v2 api - they are running 4.4.7 with the v2 api folder from a prior version copied in. We are not using rest though & I wouldn't expect rest to work with v2 api
Make today the day you step up to support CiviCRM and all the amazing organisations that are using it to improve our world - http://civicrm.org/contribute

Coleman Watts

  • Administrator
  • I’m (like) Lobo ;)
  • *****
  • Posts: 2346
  • Karma: 183
  • CiviCRM version: The Bleeding Edge
  • CMS version: Various
Re: Help with Version 2 API Login in 3.4.8?
September 20, 2014, 05:32:14 pm
afaik rest does not work with v2. You'd have to copy the old rest file from 3.3, rename it, and stick it somewhere (maybe it would work to put it in your civicrm custom php folder so it doesn't get overritten by upgrades).
Then you'd need to do a search/replace in your code to call the renamed file.
Try asking your question on the new CiviCRM help site.

pbarmak

  • I post occasionally
  • **
  • Posts: 111
  • Karma: 3
  • CiviCRM version: 3.3.5
  • CMS version: Pressflow 6.19
  • MySQL version: 5.1
  • PHP version: 5.2.10
Re: Help with Version 2 API Login in 3.4.8?
September 20, 2014, 06:12:05 pm
Well, I tried copying the rest files (both rest and CRM/Utils/REST.php) from 3.3, but I only end up with different errors from before:
Contact Creation Error:
Unknown function invocation.

Is there something else that might work?

Coleman Watts

  • Administrator
  • I’m (like) Lobo ;)
  • *****
  • Posts: 2346
  • Karma: 183
  • CiviCRM version: The Bleeding Edge
  • CMS version: Various
Re: Help with Version 2 API Login in 3.4.8?
September 21, 2014, 12:44:28 pm
In addition to copying the rest file you also need to copy the entire api/v2 directory.

If you get more errors I suggest you enable debug and backtrace so you can better see what they are.

Upgrading your code would also work :)
Try asking your question on the new CiviCRM help site.

Pages: [1]
  • CiviCRM Community Forums (archive) »
  • Old sections (read-only, deprecated) »
  • Developer Discussion »
  • APIs and Hooks (Moderator: Donald Lobo) »
  • Help with Version 2 API Login in 3.4.8?

This forum was archived on 2017-11-26.