Jump to content


Photo

Testing my API but not getting

api

  • Please log in to reply
7 replies to this topic

#1 eugeneb

eugeneb

    Advanced Member

  • Members
  • PipPipPip
  • 352 posts
  • LocationCenturion, south Africa

Posted 20 September 2018 - 06:23 AM

Any help will be appreciated. I am testing my API for integration with Gravity forms from Wordpress.

 

However I cannot get past the credentials authentication.

 

Currently just testing via the web-interface following the wiki instructions. Having followed previous forum threads on this issue I have tried it all including:

  • Correct url: https://xxxx.co.za/i...i2/appInfo.json
  • Username and Password popup dialogue filled in using user name and API key for user. Once entered it just pops up again and doesnt submit
  • User is active and set to system Admin
  • On server using PHP v5.6.25

 

What am I doing wrong?



#2 alt_f4

alt_f4

    Advanced Member

  • Premium Members
  • PipPipPip
  • 367 posts
  • LocationGermany

Posted 20 September 2018 - 07:48 AM

stupid question: did you try different browsers (remembering some problems with Chrome)?



#3 eugeneb

eugeneb

    Advanced Member

  • Members
  • PipPipPip
  • 352 posts
  • LocationCenturion, south Africa

Posted 20 September 2018 - 07:58 AM

Hi Alt,

 

Not stupid at all...hehe. As I did that after posting the thread. Great minds think alike hey...lol.

 

But yes I did. Firefox and IE. All the same. The username/password dialogue box just keeps popping up so no autho info is submitted. It might well be on my server or PHP side but I dont know where to look or do some testing.

 

Some previous threads mentioned talk of the way PHP is setup, other mentioned write access to folders. But not sure how those would influence it.

 

Basic firefox response is:

 

httpHeaders   Content-Type "application/json; charset=utf-8" WWW-Authenticate "Basic realm=\"X2Engine API v2\"" reqHeaders   Content-Length "0" Upgrade-Insecure-Requests "1" Connection "close" Cookie "__utma=46772002.1467150461.1499866447.1499866447.1502115271.2; __tawkuuid=e::tuit.co.za::Ibfr7WEizdEkVxBwIv42AZV+oNFiU6FOl+W7bFJM8RBOFqwK8JU4XhJED62BC3as::2; _ga=GA1.3.1467150461.1499866447; x2_key=TIcKzJZEvy5xbuTbvkVaQLlMYzTD4WyO; PHPSESSID=vlkif822v4d87aovctlvqg41v1; YII_CSRF_TOKEN=813fcc22874664b0601338a2e7457aaf2ec4855d" Accept-Encoding "gzip, deflate, br" Accept-Language "en-US,en;q=0.5" Accept "text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8" User-Agent "Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:61.0) Gecko/20100101 Firefox/61.0" Host "crmdemo.xxxxx.co.za" message "Missing user credentials: user" error true status 401

#4 pofa2007

pofa2007

    Member

  • Members
  • PipPip
  • 10 posts

Posted 20 September 2018 - 10:19 PM

Hello, have some forms, our field tecnitians use to update services, close actions and upload files:

 

1. form posts to a .php file 

2. php file uses webservices and some pdo sql code to update x2crm

 

working fine

 

can send you our code, if interested



#5 eugeneb

eugeneb

    Advanced Member

  • Members
  • PipPipPip
  • 352 posts
  • LocationCenturion, south Africa

Posted 20 September 2018 - 10:33 PM

Hi Pofa,

 

thanks for the offer. You are welcome to send anything that might help.

 

However, I have to get Gravity forms integrated as that is the norm for our customer base where we do their websites with CRM. I have a brilliant 3rd party WP plugin that makes it easy to interface with the RestAPI, but I cant find why I cant access my API.

 

Currently awaiting all my technical resources for feedback on where to test further.



#6 eugeneb

eugeneb

    Advanced Member

  • Members
  • PipPipPip
  • 352 posts
  • LocationCenturion, south Africa

Posted 28 September 2018 - 08:38 AM

[SOLVED]

 

I found the problem after much searching. Crazy how the answer is sometimes closer than you think.

 

On my server I use Fast-CGI for PHP. This prevented the Username and API key to pass through. To solve I updated my .htaccess file with the following:

 

# THIS FIXES THE F....ING API !!!! WHOOOHOOO
RewriteCond %{HTTP:Authorization} ^(.*)
RewriteRule .* - [e=HTTP_AUTHORIZATION:%1]
 
Passing through perfectly and this created a great solution for a integration between Gravity Forms (Wordpress) and X2CRM.
 
My solution is also posted on this forum at: http://community.x2c...-and-available/


#7 alt_f4

alt_f4

    Advanced Member

  • Premium Members
  • PipPipPip
  • 367 posts
  • LocationGermany

Posted 11 December 2019 - 11:19 PM

 

[SOLVED]

 

I found the problem after much searching. Crazy how the answer is sometimes closer than you think.

 

On my server I use Fast-CGI for PHP. This prevented the Username and API key to pass through. To solve I updated my .htaccess file with the following:

 

# THIS FIXES THE F....ING API !!!! WHOOOHOOO
RewriteCond %{HTTP:Authorization} ^(.*)
RewriteRule .* - [e=HTTP_AUTHORIZATION:%1]
 
Passing through perfectly and this created a great solution for a integration between Gravity Forms (Wordpress) and X2CRM.
 
My solution is also posted on this forum at: http://community.x2c...-and-available/

 

 

On Version 8, the API call (username/password) failed -- is anyone using the API with v 8.0?

 

 

Regards!



#8 alt_f4

alt_f4

    Advanced Member

  • Premium Members
  • PipPipPip
  • 367 posts
  • LocationGermany

Posted 11 December 2019 - 11:27 PM

Solved...my plugin makes use of TLS 1.0  :ph34r: what was deactivated yesterday by our provider.







Also tagged with one or more of these keywords: api

0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users