jbogarin / go-cisco-spark

Cisco Spark Go Package
MIT License
9 stars 1 forks source link

Doesn't support RFC5988 (Web Linking) #1

Closed cgiguy closed 6 years ago

cgiguy commented 6 years ago

Super long API responses get broken up into multiple messages. Seems that only the first API message is decoded and used.

I'm a golang noob and, even though I'll need to fix this for my application, will probably do it utterly un-golike.

Just figured I would bring the issue up!

jbogarin commented 6 years ago

Thanks for letting me know. I'll probably invest sometime over the weekend to figure out where the problem is.

cgiguy commented 6 years ago

Thanks very much for the quick response! Good luck!

jbogarin commented 6 years ago

Sorry for the delay. I was in the middle of changing the repo from Cisco Spark to Cisco Webex Teams and also changing the underlying library to simplify the operation of the SDK.

Check this repo Cisco Webex Teams Go SDK and let me know if you still have the same problem.

cgiguy commented 6 years ago

I'll grab that tonight and let you know how it goes. Thanks very much for doing this so quickly!

cgiguy commented 6 years ago

Hey, Jose.

I grabbed it and the same problem exists.

The problem is that it seems you are expecting only one response that contains all the content from the API query. This isn't the case with the WebEx Teams API. They support RFC5988 (Web Linking).

The API query can return partial information and then inform you that you need to do another query via the "Link" field in the HTTP Response Header.

This is an example of a dump of the Resp.Header: Link:[https://api.ciscospark.com/v1/people?displayName=a&cursor=bGltaXQ9MTAwJnN0YXJ0SW5k\ ZXg9MTAx; rel="next"]

If you see that, you need to re-query with the supplied URI to get the next bucket of information. When you're completely finished, the header will not contain a "Link:" field.

I was in the process of modifying the old go-cisco-spark/ciscospark/ciscospark.go Do function to requery until complete. But, with the new Resty stuff built into every method, it'll need to be done differently.

Hopefully, I'm being clear about the problem? If not, let me know.

Just know that I appreciate all of your effort on this project and you've saved ME a ton of work!

Thanks,

Mark

jbogarin commented 6 years ago

That's great feedback. Now I understand a whole lot better. Let me work on that and get back to you ASAP.

jbogarin commented 6 years ago

Sorry for the delay. I wanted to make the changes to the library to reflect the Webex Teams name change and also fix this issue. The new library is here.

https://github.com/jbogarin/go-cisco-webex-teams

I will leave this issue open for a couple of days to see if you have the chance to test it.

cgiguy commented 6 years ago

Sorry.. got very busy at work. I'll try to grab it and test it out on Monday. Thanks again for all your hard work!

cgiguy commented 6 years ago

Hey, Jose.

Just tried it and it works... at least in my cases! Thanks so very much for all your effort! I haven't looked yet but I'm betting that was a fair amount of effort to get working with the Resty interface!

Thanks again... much appreciated.

Mark

jbogarin commented 6 years ago

Mark,

The solution is not the best but I didn't want to keep you waiting. I'm glad it worked for you.

cgiguy commented 6 years ago

Jose, Works perfectly! Mark

cgiguy commented 6 years ago

Jose, At some point I'll get out from under what I'm doing and maybe be able to lend you a hand, if you ever need it. I at least owe you that!

Mark

jbogarin commented 6 years ago

Help is always appreciated. Ping me in Teams if you need something else ( jbogarin at altus dot cr)

cgiguy commented 6 years ago

Okay, sounds good.