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

Forum topics #221

Closed
abenciv opened this issue May 19, 2016 · 17 comments
Closed

Forum topics #221

abenciv opened this issue May 19, 2016 · 17 comments
Assignees
Milestone

Comments

@abenciv
Copy link

abenciv commented May 19, 2016

I used to get WebPortal forum topics this way:

api.Topics.GetTopicsByForum(forumIndex);

Now we switched to HelpCenter and it does not work anymore. What do I need to get the same list of topics from here?

https://devdept.zendesk.com/hc/en-us/community/topics/200619348-Announcements

Thanks.

@mozts2005
Copy link
Member

I think what you want are the help desk articles. some example code for them can be find here.

https://github.com/mozts2005/ZendeskApi_v2/blob/master/src/Tests/HelpCenter/ArticleTests.cs

@abenciv
Copy link
Author

abenciv commented May 19, 2016

Hi Elizabeth,

Is there a stable version supporting Help Center?

What about this constructor? I only have Url, user and password. Where do I get apiToken, locale and p_OAuthToken?

public HelpCenterApi(string yourZendeskUrl, string user, string password, string apiToken, string locale, string p_OAuthToken)

Thanks,

Alberto

@abenciv
Copy link
Author

abenciv commented May 23, 2016

Please disregard my previous request, I downloaded the latest stable version and I don't need those extra parameters.

Following your example, can you please show me how to get the list of topics on this forum?

https://csharpapi.zendesk.com/hc/en-us/community/topics/200298245-Community-Help

@mozts2005
Copy link
Member

mozts2005 commented May 23, 2016

the use if topics looks to be missing. Based on my read of the zendesk api docs we can added it.

Would you(@devDept) like to try an add this via pull request as you will be using the api and will be able to better insure that it will complete the task you need it to ?

@mozts2005 mozts2005 added this to the 4.0.0 milestone May 23, 2016
@abenciv
Copy link
Author

abenciv commented May 23, 2016

Hi Elizabeth,

Unfortunately I work in a totally different field and I am not familiar with CURL. Rest assured that I would test it immediately. I'm surprised to see that you don't cover something it was present for Web Portal.

We need this feature (api.Topics.GetTopicsByForum(forumIndex)) to get latest posts in the community forums and display them on the Corporate website home page. Since the day we switched to HelpCenter our home page is broken.

Thanks.

@mozts2005
Copy link
Member

mozts2005 commented May 23, 2016

I take a look and see what I can do but I will not be able to give you an eta. if you would be willing to email me with more detail about how this is used in your web site I can try to get a basic version working that should cover your needs.

Note: you should not need an understating of cURL to do the work your self. You will just need a good understanding of C# and copy, past.

@abenciv
Copy link
Author

abenciv commented May 23, 2016

I use it in this way, nothing complicated (still refers to Web Portal API, for HelpCenter is missing):

       ZendeskApi api = new ZendeskApi("https://devdept.zendesk.com/api/v2", "username", "password");

       // Announcements
       GetForumPosts(200619348, api, sortedList);

       // GetForumPosts() implementation 
       private static void GetForumPosts(int forumIndex, ZendeskApi api, SortedList<DateTime, Topic> sortedList)
       {
            GroupTopicResponse gtr = api.Topics.GetTopicsByForum(forumIndex);

            IList<Topic> topicList = gtr.Topics;

            foreach (Topic entry in topicList)
            {
                sortedList.Add(entry.UpdatedAt.Value.DateTime, entry);
            }
       }

@abenciv
Copy link
Author

abenciv commented May 24, 2016

Hi Elizabeth,

I see you did some changes, thanks. I tested the code.

Can I get the list of topics for forum with ID 200298245? Do you still need to implement it?

https://csharpapi.zendesk.com/hc/en-us/community/topics/200298245-Community-Help

@mozts2005
Copy link
Member

I have it where you can get the list of topics. I need to still add it so that you can get the post in that topic.

@mozts2005 mozts2005 modified the milestones: 3.5.0, 4.0.0 May 24, 2016
@abenciv
Copy link
Author

abenciv commented May 25, 2016

Thanks Elizabeth.

@abenciv
Copy link
Author

abenciv commented Jun 7, 2016

Hi Elizabeth,

Any news on this?

@mozts2005 mozts2005 self-assigned this Jul 16, 2016
@mozts2005
Copy link
Member

I just finished adding the post for the API. Let em know if this works for you.

@abenciv
Copy link
Author

abenciv commented Jul 19, 2016

Hi Elizabeth,

Regarding this:

https://csharpapi.zendesk.com/hc/en-us/community/topics/200298245-Community-Help

Are you able to query this:

api.HelpCenter.Topics.GetTopics(200298245).Topics

and get:

  • ātrais kredīts internetā no 18 gadiem
  • atrais kredits ogre
  • atrie krediti ar sliktu vesturi
  • ātrie kredīti visu diennakti
  • atrie krediti bez darba vietas no 18
  • pavļuts ātrie kredīti

I don't :-(

Thanks.

Alberto

@mozts2005
Copy link
Member

mozts2005 commented Jul 19, 2016

I think you may have the wrong code. try this
var posts = api.HelpCenter.Posts.GetPostsByTopicId(200298245).Posts

please let me know if that works.

@mozts2005 mozts2005 reopened this Jul 19, 2016
@abenciv
Copy link
Author

abenciv commented Jul 19, 2016

It works!

How would you get from:

https://csharpapi.zendesk.com/hc/en-us/sections/202119686-My-Test-section

this list instead?

  • My Test article
  • My Test article
  • My Test article
  • My Test article
  • My Test article
  • My Test article

Thanks.

@mozts2005
Copy link
Member

you would use

var articles = api.HelpCenter.Articles.GetArticlesBySectionId(202119686).Articles;

@abenciv
Copy link
Author

abenciv commented Jul 19, 2016

You changes completely fulfill my requirements. Thanks a lot!

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

No branches or pull requests

2 participants