boutzo 0 Posted February 24, 2015 Share Posted February 24, 2015 (edited) I'm sorry to ask these silly questions. But I'm having trouble translating the examples from the swagger ui to actual c# code. Is there some documentation that will translate. Basically what it says. How can I do it? Its only 2 parameters but what type of query is it? Do you do an item query and then do a foreach on the baseitemdto to get the parameters you're looking for? I have an episode id and I need to get the series ID from it. An episode query does not have that parameter. Edited February 24, 2015 by boutzo Link to comment Share on other sites More sharing options...
Cheesegeezer 3089 Posted February 24, 2015 Share Posted February 24, 2015 I'm sorry to ask these silly questions. But I'm having trouble translating the examples from the swagger ui to actual c# code. Is there some documentation that will translate. Basically what it says. How can I do it? Its only 2 parameters but what type of query is it? JSON is that what you're after? Link to comment Share on other sites More sharing options...
boutzo 0 Posted February 24, 2015 Author Share Posted February 24, 2015 (edited) I know the strings are in JSON format its the formatting of the c# code. Swagger only shows the parameters the url string and the response body none of the underlying code beneath. Do you just send an itemQuery about a file and will the baseItemDto pretty much give you anything you want to know about a file? Edited February 24, 2015 by boutzo Link to comment Share on other sites More sharing options...
Angelblue05 4130 Posted February 25, 2015 Share Posted February 25, 2015 (edited) @@boutzo I'm not sure I fully understand your question, but you can do a JSON Get request /Items?Ids=EpisodeId. The JSON response will return the baseItemDto list that includes the SeriesId by default. It will look something like this: Again, I'm not sure I fully understand what you are looking for. I hope this help somehow... Edited February 25, 2015 by Angelblue05 Link to comment Share on other sites More sharing options...
boutzo 0 Posted February 25, 2015 Author Share Posted February 25, 2015 (edited) I know I can type that into a browser and get that response. But I was trying to get that same response in c# with an item query. I since figured it out and got it working. I guess the question should have been, "What is the work flow of obtaining different parameters ?" I came up with this. ItemQuery -> go through BaseItemDto and choose the params I need, store them into a variable, do work. Thanks Edited February 25, 2015 by boutzo Link to comment Share on other sites More sharing options...
ebr 14949 Posted February 25, 2015 Share Posted February 25, 2015 The real correct answer is to use a Json serializer and deserialize those objects into proper c# classes. Again, if you use the ApiClient provided for .net it will do all of this for you... Link to comment Share on other sites More sharing options...
chef 3749 Posted February 25, 2015 Share Posted February 25, 2015 Link to comment Share on other sites More sharing options...
boutzo 0 Posted February 25, 2015 Author Share Posted February 25, 2015 Got It. Fun stuff. Learning a lot. Thanks Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now