Post

1 follower Follow
0
Avatar

API endpoint Down?

Hi there.

We use the calrizen API a lot here, but we've been having hanging connections lately.

Here its my code:

public function login() {

$params = array(

'userName' => \Config::get('clarizen.username'),

'password' => \Config::get('clarizen.password')

);

try {

$this->client = new \SoapClient($this->soapUrl, $this->soapConfig);

var_dump($this); die;

$srvdef = $this->client->GetServerDefinition($params);

$this->client->__setLocation($srvdef->GetServerDefinitionResult->ServerLocation);

$response = $this->client->Login($params);

$this->sessionId = $response->LoginResult->SessionId;

$this->userId = $response->LoginResult->UserId;

$header[] = new \SoapHeader($this->soapApiUrl, 'Session', array("ID" => $this->sessionId));

$header[] = new \SoapHeader($this->soapQApiUrl, 'Session', array("ID" => $this->sessionId));

$this->client->__setSoapHeaders($header);

return true;

} catch (SoapFault $e) {

$this->errors[] = 'Error connecting to Clarizen';

$this->errors[] = $e->getMessage();

return false;

}

}

When I call this method, the programs keeps waiting and waiting forever after that $response = $this->client->Login($params); and nothing happens.

This happens locally and in production on several programs we have build using this API.

I just notice this issue yesterday but read in the forums that this is happening after April 6th or something like that.

Here it's my config:

/**

* Clarizen API config

*/

return array(

'soapUrl' => 'https://api2.clarizen.com/v1.0/Clarizen.svc?WSDL',

'soapApiUrl' => 'http://clarizen.com/api',

'soapQueryApiUrl' => 'http://clarizen.com/api/queries',

'username' => 'user',

'password' => 'pass'

);

Please advice

Cristian Andrés Araya Jiménez Answered

Please sign in to leave a comment.

4 comments

0
Avatar

Hi Cristian.

The API server itself is up. 

I don't think there's something wrong with your code, so the issue is probably related to communication.

First, I'd advise you to have your IT check if something is blocking the connection to the Clarizen API servers.

If you think the issue is on Clarizen's side, or you need assistance, please open a support ticket (https://success.clarizen.com/requests/new), so you'll have our support engineers  specific attention.

Hope this helps.

Ophir

Ophir Kenig 0 votes
Comment actions Permalink
0
Avatar

Hi Ophir. Thanks for the reply.

On one of our servers we have an implementation that's working correctly. The file is called update_hours.php

I added some echoing in order to test where it's failing. So if I do: php update_hours.php I get:

Clarizen app included

Clarizen login done

Clarizen fetch invoices

Clarizen fetch free hours

Now, in order to not mess up that file and continue debugging and cp the file: cp update_hours.php test.php

Then php test.php And its broken again. So I said maybe it's file permissions or owner right.

So In deed. I change users groups and permissions to the same. And it worked.

The question is. Do you have any idea what kind of permissions can be causing this behaviors? In terms of php? or ports or something along those lines.

Thanks

Cristian Andrés Araya Jiménez 0 votes
Comment actions Permalink
0
Avatar

Hi Cristian.

We've managed to reproduce a similar state here, so we currently think it's a configuration issue on our side. I expect they'll be working on it within the coming days, so I'll let you know when I have new information.

Hope this helps,

Ophir

Ophir Kenig 0 votes
Comment actions Permalink
0
Avatar

Hi Cristian. Our System Engineers have performed the changes and the issue seems to be resolved.

If you haven't yet, please retry your application, and let us know.

Hope this helps,

Ophir

Ophir Kenig 0 votes
Comment actions Permalink