Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/diegostamigni/rest.cometchat
.NET SDK for CometChat REST APIs
https://github.com/diegostamigni/rest.cometchat
cometchat dotnet sdk
Last synced: about 2 months ago
JSON representation
.NET SDK for CometChat REST APIs
- Host: GitHub
- URL: https://github.com/diegostamigni/rest.cometchat
- Owner: diegostamigni
- License: mit
- Created: 2021-06-04T09:32:14.000Z (over 3 years ago)
- Default Branch: main
- Last Pushed: 2023-03-25T18:53:30.000Z (almost 2 years ago)
- Last Synced: 2023-04-03T17:46:47.788Z (almost 2 years ago)
- Topics: cometchat, dotnet, sdk
- Language: C#
- Homepage:
- Size: 93.8 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Rest.CometChat
This is an unofficial .NET (standard) library for [CometChat](https://prodocs.cometchat.com/reference) REST APIs supporting v2 and v3 API versions.[![.NET](https://github.com/diegostamigni/Rest.CometChat/actions/workflows/dotnet.yml/badge.svg)](https://github.com/diegostamigni/Rest.CometChat/actions/workflows/dotnet.yml)
## Description
All APIs are grouped in services:
* User service
* Friends service
* Messages service
* Groups service
* Roles service
* API Keys service
* Auth Tokens serviceAll concrete classes respect a contract (ex. `UserService` -> `IUserService`) making things easier for testing/mocking and people that wants to use dependency injection. All services need at least the `ICometChatConfig` which exposes the following properties:
* AppId
* ApiKey
* RegionBecause this config is strictly dependant on your project, you are supposed to inherit from this contract and provide an implementation upon service construction.
### Examples
#### Create user
```csharp
var config = MyConfig(); // inherits from `ICometChatConfig`
var userService = new UserService(config);
var result = await userService.CreateAsync(new(userUid, userName)
{
Avatar = "https://example.com/avatar.jpg",
Link = "https://userwebsite.example"
});
...
```#### List users
```csharp
var config = MyConfig(); // inherits from `ICometChatConfig`
var userService = new UserService(config);
var result = await userService.ListAsync(); // supports pagination via `ListUserOptions`
...
```### Supported APIs
- [x] User service
- [x] Friends service
- [ ] Messages service
- [ ] Groups service
- [ ] Roles service
- [ ] API Keys service
- [ ] Auth Tokens serviceFeel free to contribute! Support for missing APIs and tests are underway.