chriswarren / desk

A Ruby wrapper for the Desk.com V2 REST API
MIT License
66 stars 80 forks source link

Desk.com gem ignores client config? #51

Closed thomasbalsloev closed 9 years ago

thomasbalsloev commented 9 years ago

Hi.

I've experienced something weird, but not necessarily a bug. Perhaps I've misunderstood something...

Anyway, after creating a case and returning the case object into a var I then tried to access the "message" property through the "raw" response like this:

new_case_object = desk.create_case(ticket_hash) mes = new_case_object.raw.message

where "desk" is my initialized Desk.com client.

The case DOES get created, but the code croaks with this error message: GET https://example.desk.com/api/v2/cases/3600/message: 401

It seems that when the request goes out for the "message" property somehow the subdomain gets reset or even that my initialized client doesn't get used in the request.

Has anybody else observed this behavior?

Best regards, Thomas Balsløv.

chriswarren commented 9 years ago

I haven't seen this happen before, and haven't been able to recreate it. What version of the gem are you using? Are you still seeing the issue?

thomasbalsloev commented 9 years ago

Hi Chris,

thank you for replying. I'm using version 1.0.5 of the gem.

I removed this part of the code as it was used to catch 422 errors before the desk.com changed strategy to croak on this error, but before the change I saw this on many occasions if not all (of the 422 incidents).

If you can't replicate this and nobody else get this, then do not bother with it for my sake. I was just curious if this was something others have run into...

Best regards, Thomas.