Skip to content

Latest commit

 

History

History
338 lines (247 loc) · 9.08 KB

EntryApi.md

File metadata and controls

338 lines (247 loc) · 9.08 KB

Org.OpenAPITools.Api.EntryApi

All URIs are relative to https://api.dtf.ru/v1.6

Method HTTP request Description
EntryCreate POST /entry/create
EntryLocate GET /entry/locate
GetEntryById GET /entry/{id}
GetPopularEntries GET /entry/{id}/popular
LikeEntry POST /like

EntryCreate

InlineResponse2002 EntryCreate (string title, string text, Object subsiteId, string attachments)

Создать запись

Example

using System;
using System.Diagnostics;
using Org.OpenAPITools.Api;
using Org.OpenAPITools.Client;
using Org.OpenAPITools.Model;

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

            var apiInstance = new EntryApi();
            var title = title_example;  // string |  (optional) 
            var text = text_example;  // string |  (optional) 
            var subsiteId = 8.14;  // Object |  (optional) 
            var attachments = attachments_example;  // string |  (optional) 

            try
            {
                InlineResponse2002 result = apiInstance.EntryCreate(title, text, subsiteId, attachments);
                Debug.WriteLine(result);
            }
            catch (Exception e)
            {
                Debug.Print("Exception when calling EntryApi.EntryCreate: " + e.Message );
            }
        }
    }
}

Parameters

Name Type Description Notes
title string [optional]
text string [optional]
subsiteId Object [optional]
attachments string [optional]

Return type

InlineResponse2002

Authorization

XDeviceToken

HTTP request headers

  • Content-Type: multipart/form-data
  • Accept: application/json

[Back to top] [Back to API list] [Back to Model list] [Back to README]

EntryLocate

InlineResponse2002 EntryLocate (string url)

Найти статью по ссылке

Example

using System;
using System.Diagnostics;
using Org.OpenAPITools.Api;
using Org.OpenAPITools.Client;
using Org.OpenAPITools.Model;

namespace Example
{
    public class EntryLocateExample
    {
        public void main()
        {
            
            var apiInstance = new EntryApi();
            var url = https://dtf.ru/games/22946-legendy-dwarf-fortress-saga-o-padenii-kreposti-boutmerded;  // string | Ссылка на статью

            try
            {
                InlineResponse2002 result = apiInstance.EntryLocate(url);
                Debug.WriteLine(result);
            }
            catch (Exception e)
            {
                Debug.Print("Exception when calling EntryApi.EntryLocate: " + e.Message );
            }
        }
    }
}

Parameters

Name Type Description Notes
url string Ссылка на статью

Return type

InlineResponse2002

Authorization

No authorization required

HTTP request headers

  • Content-Type: Not defined
  • Accept: application/json

[Back to top] [Back to API list] [Back to Model list] [Back to README]

GetEntryById

InlineResponse2002 GetEntryById (long? id)

Получить запись по ID

Example

using System;
using System.Diagnostics;
using Org.OpenAPITools.Api;
using Org.OpenAPITools.Client;
using Org.OpenAPITools.Model;

namespace Example
{
    public class GetEntryByIdExample
    {
        public void main()
        {
            
            var apiInstance = new EntryApi();
            var id = 789;  // long? | 

            try
            {
                InlineResponse2002 result = apiInstance.GetEntryById(id);
                Debug.WriteLine(result);
            }
            catch (Exception e)
            {
                Debug.Print("Exception when calling EntryApi.GetEntryById: " + e.Message );
            }
        }
    }
}

Parameters

Name Type Description Notes
id long?

Return type

InlineResponse2002

Authorization

No authorization required

HTTP request headers

  • Content-Type: Not defined
  • Accept: application/json

[Back to top] [Back to API list] [Back to Model list] [Back to README]

GetPopularEntries

InlineResponse2001 GetPopularEntries (long? id)

Получить популярные записи для определенной записи

Example

using System;
using System.Diagnostics;
using Org.OpenAPITools.Api;
using Org.OpenAPITools.Client;
using Org.OpenAPITools.Model;

namespace Example
{
    public class GetPopularEntriesExample
    {
        public void main()
        {
            
            var apiInstance = new EntryApi();
            var id = 789;  // long? | 

            try
            {
                InlineResponse2001 result = apiInstance.GetPopularEntries(id);
                Debug.WriteLine(result);
            }
            catch (Exception e)
            {
                Debug.Print("Exception when calling EntryApi.GetPopularEntries: " + e.Message );
            }
        }
    }
}

Parameters

Name Type Description Notes
id long?

Return type

InlineResponse2001

Authorization

No authorization required

HTTP request headers

  • Content-Type: Not defined
  • Accept: application/json

[Back to top] [Back to API list] [Back to Model list] [Back to README]

LikeEntry

InlineResponse2005 LikeEntry (long? id, string type, long? sign)

Лайкнуть запись / комментарий

Example

using System;
using System.Diagnostics;
using Org.OpenAPITools.Api;
using Org.OpenAPITools.Client;
using Org.OpenAPITools.Model;

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

            var apiInstance = new EntryApi();
            var id = 789;  // long? |  (optional) 
            var type = type_example;  // string | Тип контента:   * `content` - запись   * `comment` - комментарий (optional) 
            var sign = 789;  // long? | Изменить рейтинг  * `-1` - Понизить  * `0` - Сбросить  * `1` - Повысить  (optional) 

            try
            {
                InlineResponse2005 result = apiInstance.LikeEntry(id, type, sign);
                Debug.WriteLine(result);
            }
            catch (Exception e)
            {
                Debug.Print("Exception when calling EntryApi.LikeEntry: " + e.Message );
            }
        }
    }
}

Parameters

Name Type Description Notes
id long? [optional]
type string Тип контента: * `content` - запись * `comment` - комментарий [optional]
sign long? Изменить рейтинг * `-1` - Понизить * `0` - Сбросить * `1` - Повысить [optional]

Return type

InlineResponse2005

Authorization

XDeviceToken

HTTP request headers

  • Content-Type: multipart/form-data
  • Accept: application/json

[Back to top] [Back to API list] [Back to Model list] [Back to README]