Coder Social home page Coder Social logo

helpscoutnet's Introduction

HelpScoutNet

HelpScoutNet is a .NET class library that provides an easy-to-use interface for the helpscout.net web api

##Methods Implemented

###Help Desk API

  • Conversation
    • List Conversations
    • Get Conversations
    • Get Attachment Data
    • Create Conversation
    • Update Conversation
    • Create Thread
  • Customers
    • List Customers
    • List Mailbox Customers
    • Get Customer
    • Create Customer
    • Update Customer
  • Mailboxes
    • List Mailboxes
    • Get Mailbox
    • Get Folders
  • Search
    • Conversations
    • Customers
  • Tags
    • List Tags
  • Users
    • List Users
    • Get User
    • List Users ny Mailbox
  • Workflows
    • List Workflows

###Docs API

Nothing done yet

##Examples

###Initialization of the client

var client = new HelpScoutClient(ApiKey);

###Search customers

var client = new HelpScoutClient(ApiKey);
var customersSearch = client.SearchCustomers(new SearchRequest{ Query = "(customer:\"[email protected]\")"});
foreach (var searchresult in customersSearch.Items)
{
    Console.WriteLine(searchresult.FirstName + searchresult.LastName);   
}

###List Mailboxes

var mailboxes = client.ListMailboxes();
foreach (var mailboxStub in mailboxes.Items)
{    
    Console.WriteLine(mailboxStub.Id);
}
  

###Create conversation

var newConv = client.CreateConversation(new Conversation
                {
                    Type = ConversationType.email,
                    Subject = "Testing the Helpscout API Mathieu",
                    Mailbox = new MailboxRef
                    {
                        Id = 38556
                    },
                    Status = ConversationStatus.active,
                    Customer = new Person
                    {
                        Email = "[email protected]",
                    },

                    Threads = new List<Thread>{
                        new Thread
                        {
                            Type = ThreadType.message,
                            Body = "This is the body of the email \n something else" + Environment.NewLine + "and again",
                            Status = ThreadStatus.active,
                            CreatedBy = new Person
                            {    
                                Id = 60895,
                                Type = PersonType.user,
                                Email = "[email protected]"
                            } 
                        }
                     }

                });

###Add a note, create thread

var thread = client.CreateThread(newconv.Id, new Thread
                {
                    CreatedBy = new Person
                    {
                        Id = 60895,
                        Type = PersonType.user,
                        Email = "[email protected]"
                    },
                    Type = ThreadType.note,
                    Body = "This is a note from API",
                    Status = ThreadStatus.active
                });

###Field Selectors

Each endpoint returns a default set of fields based upon the given request. However, you can override this behavior by supplying one or more field selectors to explicitly request the data you need.

Instead of returning a complete customer object, you could return just the ID and lastname.

client.GetCustomer(123, new CustomerRequest {Fields = new[] {"id", "lastName"}});
  

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.