Git Product home page Git Product logo

zendeskapi's Introduction

*Updated 6/17/2011: This project in now in Nuget! (Also it seems the Zendesk is now sometimes returning json instead of xml so these bugs have been fixed).
	- Also did some improvements on attachements.

*Updated 2/16/2011: Fixed bug changed the TicketStatus to TicketStatusID.

This is a full c# wrapper for the ZenDesk Api at: http://www.zendesk.com/api/rest-introduction.

*Note: Create and Update methods might have some unexpected behavior. It was never clear what fields could and could not be updated. So if you get an error it is probably because you are sending them to much data. I have already began a discussion about this issue which can be seen here: https://support.zendesk.com/requests/76352

Don't be afraid to fix any bugs you see and send me pull requests!

*Update - just added Sso support method: 
static string GetLoginUrl(string authToken, string httpsUrl, string name, string email, string returnToUrl = "")

Here is a list of the public methods, enjoy.

    bool AddEmailAddressToAUser(int userId, string email);
    bool AddTwitterHandleToUser(int userId, string twitterHandle);
    bool ApplyMacro(int macroId, int ticketId)
    bool AddComment(int ticketId, Comment comment)

       
    int CreateEntry(int forumId, int submitterId, string title, 
		string body, string currentTags, bool isLocked = false, bool isPinned = true);
    int CreateEntry(Entry entry);        
    int CreateOrUpdateForum(string name, string description, bool isLocked);
    int CreateOrUpdateForum(Forum forum);
    int CreateOrUpdateGroup(string name, List<int> userIds);
    int CreateOrUpdateGroup(Group group);       
    int CreateOrUpdateOrganization(string name, string defaultSite);
    int CreateOrUpdateOrganization(Organization newOrg);
    int CreatePost(int entryId, int userId, string body);
    int CreatePost(Post post);
    int CreateOrUpdateUser(string email, string name, string password, 
		Role role, RestrictedTo restrictionId, int[] groupIDs, bool isVerified = true);
    int CreateOrUpdateUser(User newUser);
    int CreateTicketAsEndUser(string endUserEmail, string subject, string description);
    int CreateTicketAsEndUser(string endUserEmail, Ticket ticket);      

    bool DestroyOrganization(int orgId);
    bool DestroyForum(int forumId);
    bool DestroyEntry(int entryId);
    bool DestroyPost(int postId);
    bool DestroyGroup(int groupId);
    bool DestroyUser(int userId);
    bool DestroyTicket(int ticketId);
    bool DeleteUserIdentity(int userId, int identityId);
             
    T Execute<T>(ZenRestRequest request) where T : new();
    RestResponse Execute(ZenRestRequest request);

    List<User> FindUsersByEmail(string email);
      
    List<T> GetCollection<T>(string resource, string rootElement = "");
    List<View> GetViews();
    View GetViewByName(string name);
    List<Organization> GetOgranizations();
    Organization GetOgranizationById(int id);
    int GetExistingForumId(Forum forum);
    List<Forum> GetForums();
    Forum GetForumById(int id);
    List<TicketField> GetTicketFields();
    List<Macro> GetMacros();
    List<Entry> GetEntriesByForumId(int forumId);
    Entry GetEntryById(int id);
    Post GetPostByIds(int entityId, int postId);
    List<Group> GetGroups();
    Group GetGroupById(int id);
    int[] GetAllGroupIDs();
    List<User> GetUsers();
    User GetUserById(int id);
    List<UserIdentity> GetUserIdentities(int userId);
    Ticket GetTicketById(int id);
    List<Ticket> GetAllTicketsForUser(string email);
    List<Ticket> GetTicketsForUserByPage(string email, int page = 1);
    List<Ticket> GetTicketsInViewByPage(int viewId, int page = 1);
    List<Ticket> GetAllTicketsInView(int viewId);
    List<TagScore> GetAllTags();
    List<Ticket> GetAllTicketsForTag(string tagName);
    List<Ticket> GetTicktesForTagByPage(string tagName, int page = 1);

    bool MakeUserIdentityPrimary(int userId, int identityId);
       
    List<User> QueryUsers(string query);
      
    bool UpdateOrganization(Organization org);
    bool UpdateForum(Forum forum);
    bool UpdateEntry(Entry entry);
    bool UpdatePost(Post post);
    bool UpdateGroup(Group group);
    bool UpdateUser(User user);
    bool UpdateTicket(Ticket ticket)
    bool UpdateTicket(int ticketId, string description);
    bool UpdateTicket(int ticketId, Comment comment);

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.