Skip to content

About

The C# library for the API whatsgate.ru

Resources

Stars

0 stars

Watchers

1 watching

Forks

Repository files navigation

IO.Swagger - the C# library for the API whatsgate.ru

Интерфейс для взаимодействия с клиентом Whatsapp

This C# SDK is automatically generated by the Swagger Codegen project:

  • API version: 1.0.0
  • SDK version: 1.0.0
  • Build package: io.swagger.codegen.v3.generators.dotnet.CSharpClientCodegen For more information, please visit https://whatsgate.ru/

Frameworks supported

  • .NET 4.0 or later
  • Windows Phone 7.1 (Mango)

Dependencies

The DLLs included in the package may not be the latest version. We recommend using NuGet to obtain the latest version of the packages:

Install-Package RestSharp
Install-Package Newtonsoft.Json
Install-Package JsonSubTypes

NOTE: RestSharp versions greater than 105.1.0 have a bug which causes file uploads to fail. See RestSharp#742

Installation

Run the following command to generate the DLL

  • [Mac/Linux] /bin/sh build.sh
  • [Windows] build.bat

Then include the DLL (under the bin folder) in the C# project, and use the namespaces:

using IO.Swagger.Api;
using IO.Swagger.Client;
using IO.Swagger.Model;

Packaging

A .nuspec is included with the project. You can follow the Nuget quickstart to create and publish packages.

This .nuspec uses placeholders from the .csproj, so build the .csproj directly:

nuget pack -Build -OutputDirectory out IO.Swagger.csproj

Then, publish to a local feed or other host and consume the new package via Nuget as usual.

Getting Started

using System;
using System.Diagnostics;
using IO.Swagger.Api;
using IO.Swagger.Client;
using IO.Swagger.Model;

namespace Example
{
    public class Example
    {
        public void main()
        {
            // Configure API key authorization: ApiKeyAuth
            Configuration.Default.ApiKey.Add("X-API-Key", "YOUR_API_KEY");
            // Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
            // Configuration.Default.ApiKeyPrefix.Add("X-API-Key", "Bearer");

            var apiInstance = new DefaultApi();
            var body = new CheckBody(); // CheckBody | Проверяет, зарегистрирован ли указанный номер в WhatsApp. Номер указывается в формате только цифр, например 79999999999

            try
            {
                // Проверка зарегистрирован ли номер в WhatsApp
                InlineResponse2001 result = apiInstance.CheckPost(body);
                Debug.WriteLine(result);
            }
            catch (Exception e)
            {
                Debug.Print("Exception when calling DefaultApi.CheckPost: " + e.Message );
            }
        }
    }
}

Documentation for API Endpoints

All URIs are relative to https://whatsgate.ru/v1

Class Method HTTP request Description
DefaultApi CheckPost POST /check Проверка зарегистрирован ли номер в WhatsApp
DefaultApi GetChatsPost POST /get-chats Возвращает список активных чатов
DefaultApi SeenPost POST /seen Отправляет команду в чат, что последние сообщения просмотрены
DefaultApi SendMessage POST /send Отправка сообщения
_Api GetMediaPost POST /get-media Возвращает объект медиафайла, прикрепленного к сообщению

Documentation for Models

Documentation for Authorization

ApiKeyAuth

  • Type: API key
  • API key parameter name: X-API-Key
  • Location: HTTP header

About

The C# library for the API whatsgate.ru

Resources

Stars

0 stars

Watchers

1 watching

Forks

Releases

Packages

Contributors

Languages