Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

400 Client Error: BAD REQUEST for url on agents endpoint #18

Closed
RinkeRaven opened this issue Feb 26, 2019 · 2 comments
Closed

400 Client Error: BAD REQUEST for url on agents endpoint #18

RinkeRaven opened this issue Feb 26, 2019 · 2 comments

Comments

@RinkeRaven
Copy link
Contributor

The Zopim integration is returning a Bad Request error on the agents endpoint, full log:

2019-02-2 14:00:01,159Z tap - INFO HTTP request to "agents" endpoint took 5.478s, returned status code 400
2019-02-26 14:00:01,159Z tap - CRITICAL 400 Client Error: BAD REQUEST for url: https://www.zopim.com/api/v2/agents?limit=500&since_id=0
2019-02-26 14:00:01,159Z tap - Traceback (most recent call last):
2019-02-26 14:00:01,159Z tap - File "tap-env/bin/tap-zendesk-chat", line 10, in
2019-02-26 14:00:01,160Z tap - sys.exit(main())
2019-02-26 14:00:01,160Z tap - File "/code/orchestrator/tap-env/lib/python3.5/site-packages/tap_zendesk_chat/init.py", line 112, in main
2019-02-26 14:00:01,160Z tap - raise exc
2019-02-26 14:00:01,160Z tap - File "/code/orchestrator/tap-env/lib/python3.5/site-packages/tap_zendesk_chat/init.py", line 109, in main
2019-02-26 14:00:01,160Z tap - main_impl()
2019-02-26 14:00:01,160Z tap - File "/code/orchestrator/tap-env/lib/python3.5/site-packages/tap_zendesk_chat/init.py", line 105, in main_impl
2019-02-26 14:00:01,160Z tap - sync(ctx)
2019-02-26 14:00:01,161Z tap - File "/code/orchestrator/tap-env/lib/python3.5/site-packages/tap_zendesk_chat/init.py", line 91, in sync
2019-02-26 14:00:01,161Z tap - stream.sync(ctx)
2019-02-26 14:00:01,161Z tap - File "/code/orchestrator/tap-env/lib/python3.5/site-packages/tap_zendesk_chat/streams.py", line 59, in sync
2019-02-26 14:00:01,161Z tap - page = ctx.client.request(self.tap_stream_id, params)
2019-02-26 14:00:01,161Z tap - File "/code/orchestrator/tap-env/lib/python3.5/site-packages/backoff.py", line 286, in retry
2019-02-26 14:00:01,161Z tap - ret = target(*args, **kwargs)
2019-02-26 14:00:01,161Z tap - File "/code/orchestrator/tap-env/lib/python3.5/site-packages/tap_zendesk_chat/http.py", line 34, in request
2019-02-26 14:00:01,162Z tap - response.raise_for_status()
2019-02-26 14:00:01,162Z tap - File "/code/orchestrator/tap-env/lib/python3.5/site-packages/requests/models.py", line 940, in raise_for_status
2019-02-26 14:00:01,162Z tap - raise HTTPError(http_error_msg, response=self)
2019-02-26 14:00:01,162Z tap - requests.exceptions.HTTPError: 400 Client Error: BAD REQUEST for url: https://www.zopim.com/api/v2/agents?limit=500&since_id=0
2019-02-26 14:00:01,194Z main - INFO State update: adding bookmarks.agents.offset.id = null
2019-02-26 14:00:01,194Z main - INFO State update: adding bookmarks.chats.chat.end_timestamp = "2019-02-25T20:43:56Z"
2019-02-26 14:00:01,194Z main - INFO State update: adding bookmarks.chats.offline_msg.timestamp = "2018-07-20T15:59:15Z"
2019-02-26 14:00:01,194Z main - INFO State update: adding bookmarks.chats.offset.chat.next_url = null
2019-02-26 14:00:01,194Z target - INFO Exiting normally
2019-02-26 14:00:01,194Z main - INFO State update: adding bookmarks.chats.offset.offline_msg.next_url = null
2019-02-26 14:00:01,195Z main - INFO State update: adding currently_syncing = "agents"
2019-02-26 14:00:01,300Z main - INFO Target exited normally with status 0
2019-02-26 14:00:01,303Z main - INFO Exit status is: Discovery succeeded. Tap failed with code 1 and error message: "400 Client Error: BAD REQUEST for url: https://www.zopim.com/api/v2/agents?limit=500&since_id=0". Target succeeded.

@RinkeRaven
Copy link
Contributor Author

We found that setting limit=100 fixed the issue when directly calling the API. i.e. url would need to be https://www.zopim.com/api/v2/agents?limit=100&since_id=0

KAllan357 added a commit that referenced this issue Feb 27, 2019
changed default limit from 500 to 100 (fixes #18)
@KAllan357
Copy link
Contributor

After privately chatting this seems like its related to an issue in Zendesk itself where "Zendesk Support is linking user's phone number to the email field in Zendesk Chat" which causes a 400 from Zendesk with a lower level message saying:

 {"description": "email does not match pattern", "error": "SchemaError"}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants