All Projects → staviloglu → Taviloglu.Wrike.ApiClient

staviloglu / Taviloglu.Wrike.ApiClient

Licence: MIT License
.NET Client for Wrike API

Programming Languages

C#
18002 projects

Projects that are alternatives of or similar to Taviloglu.Wrike.ApiClient

NClient
💫 NClient is an automatic type-safe .Net HTTP client that allows you to call web service API methods using annotated interfaces or controllers without boilerplate code.
Stars: ✭ 25 (+4.17%)
Mutual labels:  http-client, api-client, rest-client
restofus
Restofus - a cross-platform (REST) API client.
Stars: ✭ 18 (-25%)
Mutual labels:  http-client, api-client, rest-client
RESTEasy
REST API calls made easier
Stars: ✭ 12 (-50%)
Mutual labels:  http-client, api-client, rest-client
Clamor
The Python Discord API Framework
Stars: ✭ 14 (-41.67%)
Mutual labels:  wrapper, api-client
Proxy
The type-safe REST library for .NET Standard 2.0 (NetCoreStack Flying Proxy)
Stars: ✭ 40 (+66.67%)
Mutual labels:  http-client, rest-client
tcWebHooks
WebHooks plugin for Teamcity. Supports many build states and payload formats.
Stars: ✭ 128 (+433.33%)
Mutual labels:  webhooks, webhook
dynamic-cli
A Modern, user-friendly command-line HTTP client for the API testing, and if you're stuck - Search and browse StackOverflow without leaving the CLI
Stars: ✭ 151 (+529.17%)
Mutual labels:  http-client, api-client
Rx.Http
A reactive way to make HTTP Request in .NET Core 🚀
Stars: ✭ 62 (+158.33%)
Mutual labels:  http-client, rest-client
discord-twitter-webhooks
🤖 Stream tweets to Discord
Stars: ✭ 47 (+95.83%)
Mutual labels:  webhooks, webhook
sevenbridges-python
SevenBridges Python Api bindings
Stars: ✭ 41 (+70.83%)
Mutual labels:  api-client, rest-client
apiron
🍳 apiron is a Python package that helps you cook a tasty client for RESTful APIs. Just don't wash it with SOAP.
Stars: ✭ 106 (+341.67%)
Mutual labels:  api-client, rest-client
YuiAPI
一个浏览器API测试客户端,API文档生成器,支持chrome/firefox/新版edge
Stars: ✭ 25 (+4.17%)
Mutual labels:  api-client, rest-client
drowsy
😪 Lazy integrations tool for RESTful interfaces to aid POC development and streamline integrations
Stars: ✭ 19 (-20.83%)
Mutual labels:  api-client, rest-client
FireflySoft.RateLimit
It is a rate limiting library based on .Net standard.
Stars: ✭ 76 (+216.67%)
Mutual labels:  aspnetcore, dotnet-framework
bitrix
Bitrix24 REST API client that doesn't suck. Suffer no more.
Stars: ✭ 59 (+145.83%)
Mutual labels:  api-client, rest-client
restler
Restler is a beautiful and powerful Android app for quickly testing REST API anywhere and anytime.
Stars: ✭ 120 (+400%)
Mutual labels:  http-client, rest-client
github-release-notifier
Automatize tasks when a specific package got a new release - Github Release Notifier
Stars: ✭ 21 (-12.5%)
Mutual labels:  webhooks, webhook
unity-simple-http
A dead simple HTTP client for Unity3D
Stars: ✭ 32 (+33.33%)
Mutual labels:  http-client, rest-client
csharp-http-client
Twilio SendGrid's C# HTTP Client for calling APIs
Stars: ✭ 25 (+4.17%)
Mutual labels:  http-client, rest-client
iris
Watch on Kubernetes events, filter and send them as standard wehbook to any system
Stars: ✭ 57 (+137.5%)
Mutual labels:  webhooks, webhook

Taviloglu.Wrike.ApiClient Build Status BCH compliance

.NET Client for Wrike API. Feel free to show your ❤️ by giving a star

Donate

If you find this library useful and if it saved you time, you can support my work.

Client Usage NuGet NuGet Downloads

Create your Wrike Client and just call the function you need.

Create client with permanent token

var client = new WrikeClient("permanent_token");

Create client with ClientId, ClientSecret, AuthorizationCode (Use oAuth2.0)

//create the authorization url
var authorizationUrl = WrikeClient.GetAuthorizationUrl(
                ClientId,
                redirectUri: "http://localhost",
                state: "myTestState",
                scope: new List<string> { WrikeScopes.Default, WrikeScopes.wsReadWrite });
//After the user authorizes your client using the authroization url, 
//wrike will redirect user to the provided redirect_uri with the authorization code
//See https://developers.wrike.com/documentation/oauth2 for more details

//create client
var client = new WrikeClient(new WrikeAccessTokenRequest(
                ClientId,
                ClientSecret,
                AuthorizationCode), "redirect_uri");

//refresh token if needed
client.RefreshToken();

Create client with AccessToken and Host

var accesTokenResponse = WrikeClient.GetAccesToken(new WrikeAccessTokenRequest(
                ClientId,
                ClientSecret,
                AuthorizationCode), "http://localhost");

var client = new WrikeClient(accesTokenResponse.AccessToken, accesTokenResponse.Host);

//you need new client when you need to refresh token
var refreshTokenResponse = WrikeClient.RefreshToken(ClientId, ClientSecret, 
                accesTokenResponse.RefreshToken, accesTokenResponse.Host);

client = new WrikeClient(refreshTokenResponse.AccessToken, accesTokenResponse.Host);

CRUD operations

//create client
var client = new WrikeClient("permanent_token");

//get the list of custom fields
//https://developers.wrike.com/documentation/api/methods/query-custom-fields
var customFields = await client.CustomFields.GetAsync();

//create new custom field
//https://developers.wrike.com/documentation/api/methods/create-custom-field
var newCustomField = new WrikeCustomField("Title", WrikeCustomFieldType.Text);
newCustomField = await client.CustomFields.CreateAsync(newCustomField);

//delete a task
await client.Tasks.DeleteAsync("taskId");

Provide custom HttpClient instance

By default, we use the classic new HttpClient() way of instantiating our own instance of HttpClient. We do, however, provide a way for you to pass in your own customized implementation of it so that you can use whatever custom Policies, Throttling, etc. that you require. The recommended way of creating HttpClients is using IHttpClientFactory as specified by the official Microsoft docs here

In order to provide your own instance of HttpClient for this library to use, you simply need to provide it in the constructor for WrikeHttpClient:

var client = new WrikeClient("permanent_token", customHttpClient: customHttpClientImplementation);

For more details on usage checkout the Taviloglu.Wrike.ApiClient.Samples project

WebHooks Usage NuGet NuGet Downloads

Create your WrikeWebHookController by subclassing and implementing WrikeWebHookControllerBase abstract class provided in Taviloglu.Wrike.WebHook library. Don't forget to set a route to your new controller.

    [Route("api/[controller]")]
    public class WrikeWebHookController : WrikeWebHookControllerBase
    {
        protected override void OnAttachmentAdded(WrikeWebHookEvent wrikeWebHookEvent)
        {
            throw new NotImplementedException();
        }
        
        /*
            implement other events...
        */
     }

When your WrikeWebHookController is ready for responding to post requests, create a webhook using the Wrike Client

//create client
var client = new WrikeClient("permanent_token");
//create new webhook
//https://developers.wrike.com/documentation/webhooks
var newWebHook = new WrikeWebHook("https://<your-host>/api/wrikewebhook");
newWebHook = await client.WebHooks.CreateAsync(newWebHook);

Then Wrike will send post requests to the url you provided. For more details check out wrike's documentation


Note: WrikeWebHook library uses Newtonsoft.json serializer, which is not default serializer on ASP.NET Core 3.0+ or Framework 5.0+ versions. On recent ASP.NET projects you may need to install Microsoft.AspNetCore.Mvc.NewtonsoftJson package and activate it as follows;

services.AddControllers().AddNewtonsoftJson();

See Issue#33


Endpoint IsImplemented Group
[GET] /contacts 1 Contacts
[GET] /contacts/{contactId},{contactId},... - up to 100 IDs 1
[PUT] /contacts/{contactId} 1
[GET] /users/{userId} 1 Users
[PUT] /users/{userId} 1
[GET] /groups/{groupId} 1 Groups
[GET] /groups 1
[POST] /groups 1
[PUT] /groups/{groupId} 1
[DELETE] /groups/{groupId} 1
[GET] /invitations 1 Invitations
[POST] /invitations 1
[PUT] /invitations/{invitationId} 1
[DELETE] /invitations/{invitationId} 1
[GET] /account 1 Accounts
[PUT] /account 1
[GET] /workflows 1 Workflows
[POST] /workflows 1
[PUT] /workflows/{workflowId} 1
[GET] /customfields 1 Custom Fields
[GET] /customfields/{customfieldId},{customfieldId},... - up to 100 Ids 1
[POST] /customfields 1
[PUT] /customfields/{customfieldId} 1
[GET] /folders 1 Folders & Projects
[GET] /folders/{folderId}/folders 1
[GET] /folders/{folderId},{folderId},... - up to 100 IDs 1
[POST] /folders/{folderId}/folders 1
[POST] /copy_folder/{folderId} 1
[PUT] /folders/{folderId} 1
[DELETE] /folders/{folderId} 1
[GET] /tasks 1 Tasks
[GET] /folders/{folderId}/tasks 1
[GET] /tasks/{taskId},{taskId},... - up to 100 IDs 1
[POST] /folders/{folderId}/tasks 1
[PUT] /tasks/{taskId} 1
[DELETE] /tasks/{taskId} 1
[GET] /comments 1 Comments
[GET] /folders/{folderId}/comments 1
[GET] /tasks/{taskId}/comments 1
[GET] /comments/{commentId},{commentId},... - up to 100 Ids 1
[POST] /folders/{folderId}/comments 1
[POST] /tasks/{taskId}/comments 1
[PUT] /comments/{commentId} 1
[DELETE] /comments/{commentId} 1
[GET] /tasks/{taskId}/dependencies 1 Dependencies
[GET] /dependencies/{dependencyId},{dependencyId},... - up to 100 IDs 1
[POST] /tasks/{taskId}/dependencies 1
[PUT] /dependencies/{dependencyId} 1
[DELETE] /dependencies/{dependencyId} 1
[GET] /timelogs 1 Timelogs
[GET] /contacts/{contactId}/timelogs 1
[GET] /folders/{folderId}/timelogs 1
[GET] /tasks/{taskId}/timelogs 1
[GET] /timelog_categories/{timelog_categoryId}/timelogs 1
[GET] /timelogs/{timelogId} 1
[POST] /tasks/{taskId}/timelogs 1
[PUT] /timelogs/{timelogId} 1
[DELETE] /timelogs/{timelogId} 1
[GET] /timelog_categories 1 Timelog Categories
[GET] /attachments 1 Attachments
[GET] /folders/{folderId}/attachments  1
[GET] /tasks/{taskId}/attachments 1
[GET] /attachments/{attachmentId},{attachmentId},... - up to 100 Ids 1
[GET] /attachments/{attachmentId}/download 1
[GET] /attachments/{attachmentId}/preview  1
[GET] /attachments/{attachmentId}/url 1
[POST] /folders/{folderId}/attachments 1
[POST] /tasks/{taskId}/attachments 1
[PUT] /attachments/{attachmentId} 1
[DELETE] /attachments/{attachmentId} 1
[GET] /version 1 Version
[GET] /ids 1 Ids
[GET] /colors 1 Colors
[POST] /folders/{folderId}/webhooks 1 Webhooks
[GET] /webhooks 1
[GET] /webhooks/{webhookId},{webhookId} 1
[PUT] /webhooks/{webhookId} 1
[DELETE] /webhooks/{webhookId} 1
[POST] https://www.wrike.com/oauth2/token (getToken) 1 oAuth2.0
[POST] https://www.wrike.com/oauth2/token (refreshToken) 1
Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].