Post

3 followers Follow
0
Avatar

Clarizen.svc api v.2 in visual studio for C# development

I added Clarizen.svc api v.2 service reference into our visual studio project..
In documentation showing iClarizen interface contains five (5) methods:
Execute (BaseMessage)
Login (Username, Password, LoginOptions)
Logout
Metadata (MetadataMessage)
Query (QueryExpression)

All method is accessible but "Query" is not accessible , it is not showing into this API (even is it not available into metadata) but according to documentation it should be in this API. So what will be the problem?

can any one please help me about this ?

Rakesh Panwar Answered

Please sign in to leave a comment.

5 comments

0
Avatar

Hi Rakesh,
Thanks for pointing that out. The Query service was (in API V1.0) just a shortcut for sending some Query (like EntityQuery) through the Execute method. I suggest you use the Execute method instead.
I'll check it with my colleagues if the Query service was deprecated, and we'll update the documentation if so.
Hope this helps,
Ophir

Ophir Kenig 0 votes
Comment actions Permalink
0
Avatar

That's correct. We've deprecated the Query method since it can be used via the Execute method.
We'll need to update the docs

Eyal Post 0 votes
Comment actions Permalink
0
Avatar

Can you please suggest me code , how can i use Execute method instead Query?
My code example:
Clarizen clarizenClient = new Clarizen();
MyWorkItemsQuery query = new MyWorkItemsQuery();
query.ItemsType = WorkItemType.Task;
......etc
QueryResult qr = clarizenClient.Query(query);

Rakesh Panwar 0 votes
Comment actions Permalink
0
Avatar

QueryResult qr = clarizenClient.Execute(new BaseMessage[]{query})[0] as QueryResult;

The benefit of using Execute is the ability to perform several API calls in one roundtrip to the server.

Eyal Post 0 votes
Comment actions Permalink
0
Avatar

Thank you so much for your reply!

Now i want to two main things into this c# code:
1. Get all Project list via this API
2. Get widget URL (Roadmap Widget or Gantt) via API
Can you please share code for this ?

Rakesh Panwar 0 votes
Comment actions Permalink