Comments (4)
Hey,
Are you using token or user password?
Em 07/10/2015 18:13, Victor Macedo de Moura [email protected] escreveu:
When I utilize the method "tickets()->findAll()" exactly like the example in readme, this exception returns:
Error completing request [url] https://betalabs.zendesk.com/api/v2/tickets.json [http method] GET
My code sample:
$zendesk = new ZendeskAPI($subdominio, $usuario);
$zendesk->setAuth('basic', ['username' => $usuario, 'token' => $senha]);
$tickets = $zendesk->tickets()->findAll();
When I try authenticate with HTTP configurations (with Scheme = "HTTP" AND Port = "80") (because I was making test in my local environment), this exception returns:
Client error response [url] http://betalabs.zendesk.com/api/v2/tickets/recent.json [http method] GET [status code] 400 [reason phrase] Bad Request [details] This is an HTTPS only API
How to proceed?
Waiting for answers,
Victor
Reply to this email directly or view it on GitHub:
#206
from zendesk_api_client_php.
Hi Victor,
Yes you can authenticate with Zendesk using http if you are using localhost but when you make the actual request to the endpoints you have to use the https.
Please do note that once you move this to an address other than localhost you will need https to authenticate with the API as well.
So when constructing the client for making API calls please use https as the scheme. The Zendesk API for security reasons has to use https.
Hopefully this helps.
Thanks,
Mio
from zendesk_api_client_php.
@RaFeNiX token.
@miogalang thanks for the explication. I applied a verification to use HTTP or HTTPS in correct environment. But unfortunately not resolved my problem. I try HTTP and HTTPS but the exceptions block me to continue. How can I fix them? Is better downgrade of api's version?
from zendesk_api_client_php.
Hi @victormacedo,
From the code snippet I am unable to say why exactly this is throwing an error for you. But from the error, what I can tell you is that https should ALWAYS be used even when calling the API from a local environment. The API will block any calls that are not https.
so you should be hitting https://betalabs.zendesk.com/api/v2/tickets/recent.json instead of http://betalabs.zendesk.com/api/v2/tickets/recent.json
Just to see add more context, you can see https://github.com/zendesk/zendesk_api_client_php/blob/master/samples/getTickets.php with a nice example.
Any additional details would also help me help you figure out what is going wrong.
I am unsure why the error is saying you are hitting the /tickets/recent.json
endpoint but the code is for findAll()
which is the tickets.json
endpoint
Thanks,
Mio
from zendesk_api_client_php.
Related Issues (20)
- PHP8 Error: array_merge() does not accept unknown named parameters HOT 1
- php 5.6 Parse error: syntax error, unexpected '?', expecting variable (T_VARIABLE) in /var/www/clients/client1/web6/web/vendor/guzzlehttp/guzzle/src/HandlerStack.php on line 47 HOT 1
- Update Packagist with the new version HOT 3
- Unmerged PRs HOT 3
- Okta HOT 2
- Oktane22
- Add comment to ticket HOT 3
- FindAll method Ambiguity in Error Webhooks HOT 3
- No events API support? HOT 2
- Type error: Argument 1 passed to GuzzleHttp\Client::send()
- Allow any PSR-17 and PSR-18 implementation to be used
- How to get the latest tickets created by a customer? HOT 2
- webhook count support not available ? HOT 1
- Repository maintenance status HOT 14
- Problem with updates of users HOT 2
- tickets createMany method implementation HOT 2
- No method called iterator available in Zendesk\API\Resources\Core\Tickets HOT 2
- Testing Slack notification HOT 3
- Test Issue HOT 3
- Another test HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from zendesk_api_client_php.