mirror of
https://github.com/retailcrm/api-client-dotnet.git
synced 2024-11-24 22:06:02 +03:00
Update README.md
This commit is contained in:
parent
36fb113030
commit
61ef0fbd4a
28
README.md
28
README.md
@ -1,28 +1,28 @@
|
||||
.NET-клиент для retailCRM API
|
||||
=============================
|
||||
|
||||
.NET-клиент для работы с [RetailCRM API](http://www.retailcrm.ru/docs/rest-api/index.html).
|
||||
.NET-клиент для работы с [RetailCRM API](http://www.retailcrm.pro/docs/Developers/ApiVersion3).
|
||||
|
||||
version: 3.0.4
|
||||
|
||||
Обязательные требования
|
||||
Requirements
|
||||
-----------------------
|
||||
* [Newtonsoft.Json](http://james.newtonking.com/json)
|
||||
|
||||
Установка через NuGet
|
||||
Install with NuGet
|
||||
---------------------
|
||||
|
||||
Для начала требуется скачать и установить сам [NuGet](http://docs.nuget.org/consume/installing-nuget).
|
||||
Install [NuGet](http://docs.nuget.org/consume/installing-nuget).
|
||||
|
||||
После этого для установки клиента требуется запустить комманду в [Package Manager Console](http://docs.nuget.org/docs/start-here/using-the-package-manager-console)
|
||||
Run this command into [Package Manager Console](http://docs.nuget.org/docs/start-here/using-the-package-manager-console)
|
||||
``` bash
|
||||
PM> Install-Package RetailCRM.ApiClient
|
||||
```
|
||||
|
||||
Примеры использования
|
||||
Usage
|
||||
---------------------
|
||||
|
||||
### Получение информации о заказе
|
||||
### Get order
|
||||
|
||||
``` csharp
|
||||
using RetailCrm;
|
||||
@ -32,7 +32,7 @@ ApiClient api;
|
||||
try
|
||||
{
|
||||
api = new ApiClient(
|
||||
"https://demo.retailcrm.ru",
|
||||
"https://demo.retailcrm.pro",
|
||||
"T9DMPvuNt7FQJMszHUdG8Fkt6xHsqngH"
|
||||
);
|
||||
}
|
||||
@ -55,14 +55,14 @@ if (response.isSuccessful()) {
|
||||
System.Console.WriteLine(response["totalSumm"]);
|
||||
} else {
|
||||
System.Console.WriteLine(
|
||||
"Ошибка получения информации о заказа: [Статус HTTP-ответа " +
|
||||
"Error: [HTTP-code " +
|
||||
response["statusCosde"] + "] " +
|
||||
response["errorMsg"]
|
||||
);
|
||||
}
|
||||
|
||||
```
|
||||
### Создание заказа
|
||||
### Create order
|
||||
|
||||
``` csharp
|
||||
using RetailCrm;
|
||||
@ -112,7 +112,7 @@ Dictionary<string, object> tmpOrder = new Dictionary<string, object>(){
|
||||
{"code", "courier"},
|
||||
{"date", DateTime.Now.ToString("Y-m-d")},
|
||||
{"address", new Dictionary<string, object>(){
|
||||
{"text", "exampleing"}
|
||||
{"text", "example"}
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -131,12 +131,12 @@ catch (WebException e)
|
||||
|
||||
if (response.isSuccessful() && 201 == response["statusCosde"]) {
|
||||
System.Console.WriteLine(
|
||||
"Заказ успешно создан. ID заказа в retailCRM = " + response["id"]
|
||||
"Order created. Order ID is " + response["id"]
|
||||
);
|
||||
} else {
|
||||
System.Console.WriteLine(
|
||||
"Ошибка создания заказа: [Статус HTTP-ответа " +
|
||||
response["statusCosde"] + "] " +
|
||||
"Error: [HTTP-code " +
|
||||
response["statusCode"] + "] " +
|
||||
response["errorMsg"]
|
||||
);
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user