Skip to content

Commit 611c2ca

Browse files
committed
docs: 完善文档
1 parent e9d81ca commit 611c2ca

File tree

9 files changed

+85
-16
lines changed

9 files changed

+85
-16
lines changed

LICENSE

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
MIT License
22

3-
Copyright (c) 2021-2021 RHQYZ
3+
Copyright (c) 2021 RHQYZ
44

55
Permission is hereby granted, free of charge, to any person obtaining a copy
66
of this software and associated documentation files (the "Software"), to deal

README.md

+3-3
Original file line numberDiff line numberDiff line change
@@ -15,8 +15,8 @@
1515

1616
## 特性
1717

18-
- 基于 `Flurl.Http`,可与 `IHttpClientFactory` 集成
19-
- 支持 .NET Framework 4.6.1+、.NET Standard 2.0+、.NET Core 2.0+、.NET 5+
18+
- 基于 `Flurl.Http`
19+
- 支持 .NET Framework 4.6.2+、.NET Standard 2.0+、.NET Core 2.0+、.NET 5.0+ 多目标框架
2020
- 支持 Windows / Linux / macOS 多平台部署。
2121
- 支持 `System.Text.Json`(默认)和 `Newtonsoft.Json` 两种序列化方式。
2222
- 强类型接口模型。
@@ -34,7 +34,7 @@
3434
| 抖音开放平台 | [![NuGet Version](https://img.shields.io/nuget/v/SKIT.FlurlHttpClient.ByteDance.DouyinOpen.svg?label=NuGet)](https://www.nuget.org/packages/SKIT.FlurlHttpClient.ByteDance.DouyinOpen) <br> [![NuGet Download](https://img.shields.io/nuget/dt/SKIT.FlurlHttpClient.ByteDance.DouyinOpen.svg?sanitize=true&label=Downloads)](https://www.nuget.org/packages/SKIT.FlurlHttpClient.ByteDance.DouyinOpen) | [开发文档](./docs/DouyinOpen/README.md) |
3535
| 抖店开放平台(今日特卖、放心购) | _已停止维护_ | [开发文档](./docs/DouyinShop/README.md) |
3636
| 巨量引擎开放平台(头条广告) | _开发中_ | |
37-
| TikTok Developer | [![NuGet Version](https://img.shields.io/nuget/v/SKIT.FlurlHttpClient.ByteDance.TikTokGlobal.svg?label=NuGet)](https://www.nuget.org/packages/SKIT.FlurlHttpClient.ByteDance.TikTokGlobal) <br> [![NuGet Download](https://img.shields.io/nuget/dt/SKIT.FlurlHttpClient.ByteDance.TikTokGlobal.svg?sanitize=true&label=Downloads)](https://www.nuget.org/packages/SKIT.FlurlHttpClient.ByteDance.TikTokGlobal) | [Documentation](./docs/TikTokGlobal/README.md) |
37+
| TikTok Developer API | [![NuGet Version](https://img.shields.io/nuget/v/SKIT.FlurlHttpClient.ByteDance.TikTokGlobal.svg?label=NuGet)](https://www.nuget.org/packages/SKIT.FlurlHttpClient.ByteDance.TikTokGlobal) <br> [![NuGet Download](https://img.shields.io/nuget/dt/SKIT.FlurlHttpClient.ByteDance.TikTokGlobal.svg?sanitize=true&label=Downloads)](https://www.nuget.org/packages/SKIT.FlurlHttpClient.ByteDance.TikTokGlobal) | [Documentation](./docs/TikTokGlobal/README.md) |
3838
| TikTok Shop Open Platform | [![NuGet Version](https://img.shields.io/nuget/v/SKIT.FlurlHttpClient.ByteDance.TikTokGlobalShop.svg?label=NuGet)](https://www.nuget.org/packages/SKIT.FlurlHttpClient.ByteDance.TikTokGlobalShop) <br> [![NuGet Download](https://img.shields.io/nuget/dt/SKIT.FlurlHttpClient.ByteDance.TikTokGlobalShop.svg?sanitize=true&label=Downloads)](https://www.nuget.org/packages/SKIT.FlurlHttpClient.ByteDance.TikTokGlobalShop) | [Documentation](./docs/TikTokGlobalShop/README.md) |
3939

4040
---
+60
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,60 @@
1+
## API Reference Manual
2+
3+
Naming Policies:
4+
5+
- Request Models: _`${API}`_ + `Request`
6+
- Response Models: _`${API}`_ + `Response`
7+
- API Methods: `Execute` + _`${API}`_ + `Async`
8+
9+
---
10+
11+
### API Functions
12+
13+
<details>
14+
15+
<summary>[View Details]</summary>
16+
17+
- Manage User Access Tokens
18+
- Fetch an Access Token Using an Authorization Aode: `OAuthAccessToken`
19+
- Refresh an Access Token Using a Refresh Token: `OAuthRefreshToken`
20+
- Revoke Access: `OAuthRevokeToken`
21+
- QR Code Authorization
22+
- Get QR Code: `OAuthGetQrcode`
23+
- Check QR Code Status: `OAuthCheckQrcode`
24+
- Content Posting
25+
- Video - Direct Post
26+
- Initialize the Posting Pequest: `PostPublishVideoInit`
27+
- Send Video to TikTok Servers: `PostUploadVideo`
28+
- Video - Upload
29+
- Initialize Video Upload: `PostPublishInboxVideoInit`
30+
- Send Video to TikTok Servers: `PostUploadVideo`
31+
- Photo - Direct Post
32+
- Initialize the Posting Pequest: `PostPublishContentInit`
33+
- Query Creator Info: `PostPublishCreatorInfoQuery`
34+
- Get Post Status: `PostPublishStatusFetch`
35+
- Data Portability
36+
- Add Data Request: `UserDataAdd`
37+
- Cancel Data Request: `UserDataCancel`
38+
- Check Status of Data Request: `UserDataCheck`
39+
- Download: `UserDataDownload`
40+
- Display
41+
- Get User Info: `UserInfo`
42+
- Query Videos: `VideoQuery`
43+
- List Videos: `VideoList`
44+
- Research
45+
- Query Videos: `ResearchVideoQuery`
46+
- Query User Info: `ResearchUserInfo`
47+
- Query Video Comments: `ResearchVideoCommentList`
48+
- Query User Liked Videos: `ResearchUserLikedVideos`
49+
- Query User Pinned Videos: `ResearchUserPinnedVideos`
50+
- Query User Followers: `ResearchUserFollowers`
51+
- Query User Following: `ResearchUserFollowing`
52+
- Query User Reposted Videos: `ResearchUserRepostedVideos`
53+
- Commercial Content
54+
- Query Ads: `ResearchAdlibAdQuery`
55+
- Query Advertisers: `ResearchAdlibAdvertiserQuery`
56+
- Get Ad Details: `ResearchAdlibAdDetail`
57+
- Get Ad Report: `ResearchAdlibAdReport`
58+
- Query Commercial Content: `ResearchAdlibCommercialContentQuery`
59+
60+
</details>

docs/TikTokGlobal/README.md

+16-7
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,20 @@
11
# SKIT.FlurlHttpClient.ByteDance.TikTokGlobal
22

3-
A HTTP API SDK for [TikTok Developer](https://developers.tiktok.com/) based on `Flurl.Http`.
3+
A HTTP API SDK for [TikTok Developer API](https://developers.tiktok.com/) based on `Flurl.Http`.
44

55
---
66

77
## Features
88

9-
- Based on TikTok Developer Open API.
9+
- Based on TikTok Developer API.
1010

1111
---
1212

1313
## Get Started
1414

15+
> [!IMPORTANT]
16+
> The documents are applicable to version 3.x of this SDK. If you are using version 2.x, please move to the archived branches on GitHub/Gitee.
17+
1518
### Installation:
1619

1720
```shell
@@ -27,12 +30,12 @@ A HTTP API SDK for [TikTok Developer](https://developers.tiktok.com/) based on `
2730
```csharp
2831
using SKIT.FlurlHttpClient.ByteDance.TikTokGlobal;
2932

30-
var options = new TikTokClientOptions()
33+
var options = new TikTokV2ClientOptions()
3134
{
3235
ClientKey = "${CLIENT_KEY}",
3336
ClientSecret = "${CLIENT_SECRET}}"
3437
};
35-
var client = new TikTokClient(options);
38+
var client = TikTokV2ClientBuilder.Create(options).Build();
3639
```
3740

3841
### Requests & Responses:
@@ -44,7 +47,7 @@ using SKIT.FlurlHttpClient.ByteDance.TikTokGlobal.Models;
4447
/* Example: Fetch Access Token Using Authorization Code */
4548
var request = new OAuthAccessTokenRequest()
4649
{
47-
Code = "${AUTHORIZATION_CODE}"
50+
Code = "AUTHORIZATION_CODE"
4851
};
4952
var response = await client.ExecuteOAuthAccessTokenAsync(request);
5053
if (response.IsSuccessful())
@@ -54,7 +57,13 @@ if (response.IsSuccessful())
5457
}
5558
else
5659
{
57-
Console.WriteLine("ErrorCode: " + response.Error?.ErrorCode);
58-
Console.WriteLine("ErrorMessage: " + response.Error?.ErrorMessage);
60+
Console.WriteLine("Error: " + response.ErrorCode);
61+
Console.WriteLine("ErrorDescription: " + response.ErrorDescription);
5962
}
6063
```
64+
65+
---
66+
67+
## Basic Usage
68+
69+
- [API Reference Manual](./Basic_ModelDefinition.md)

docs/TikTokGlobalShop/README.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -65,4 +65,4 @@ else
6565

6666
## Basic Usage
6767

68-
- [API Reference Manual.](./Basic_ModelDefinition.md)
68+
- [API Reference Manual](./Basic_ModelDefinition.md)

src/SKIT.FlurlHttpClient.ByteDance.TikTokGlobal/Extensions/TikTokV2ClientExecuteOAuthExtensions.cs

+2-2
Original file line numberDiff line numberDiff line change
@@ -76,7 +76,7 @@ public static class TikTokV2ClientExecuteOAuthExtensions
7676
/// <param name="request"></param>
7777
/// <param name="cancellationToken"></param>
7878
/// <returns></returns>
79-
public static async Task<Models.OAuthRevokeResponse> ExecuteOAuthRevokeAsync(this TikTokV2Client client, Models.OAuthRevokeRequest request, CancellationToken cancellationToken = default)
79+
public static async Task<Models.OAuthRevokeTokenResponse> ExecuteOAuthRevokeTokenAsync(this TikTokV2Client client, Models.OAuthRevokeTokenRequest request, CancellationToken cancellationToken = default)
8080
{
8181
if (client is null) throw new ArgumentNullException(nameof(client));
8282
if (request is null) throw new ArgumentNullException(nameof(request));
@@ -90,7 +90,7 @@ public static class TikTokV2ClientExecuteOAuthExtensions
9090
IFlurlRequest flurlReq = client
9191
.CreateFlurlRequest(request, HttpMethod.Post, "oauth", "revoke", "");
9292

93-
return await client.SendFlurlRequestAsFormUrlEncodedAsync<Models.OAuthRevokeResponse>(flurlReq, data: request, cancellationToken: cancellationToken).ConfigureAwait(false);
93+
return await client.SendFlurlRequestAsFormUrlEncodedAsync<Models.OAuthRevokeTokenResponse>(flurlReq, data: request, cancellationToken: cancellationToken).ConfigureAwait(false);
9494
}
9595

9696
#region Qrcode

src/SKIT.FlurlHttpClient.ByteDance.TikTokGlobal/Models/OAuth/OAuthRevokeRequest.cs src/SKIT.FlurlHttpClient.ByteDance.TikTokGlobal/Models/OAuth/OAuthRevokeTokenRequest.cs

+1-1
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ namespace SKIT.FlurlHttpClient.ByteDance.TikTokGlobal.Models
33
/// <summary>
44
/// <para>表示 [POST] /oauth/revoke/ 接口的请求。</para>
55
/// </summary>
6-
public class OAuthRevokeRequest : TikTokV2Request
6+
public class OAuthRevokeTokenRequest : TikTokV2Request
77
{
88
/// <summary>
99
/// 获取或设置 TikTok ClientKey。如果不指定将使用构造 <see cref="TikTokV2Client"/> 时的 <see cref="TikTokV2ClientOptions.ClientKey"/> 参数。

src/SKIT.FlurlHttpClient.ByteDance.TikTokGlobal/Models/OAuth/OAuthRevokeResponse.cs src/SKIT.FlurlHttpClient.ByteDance.TikTokGlobal/Models/OAuth/OAuthRevokeTokenResponse.cs

+1-1
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ namespace SKIT.FlurlHttpClient.ByteDance.TikTokGlobal.Models
33
/// <summary>
44
/// <para>表示 [POST] /oauth/revoke/ 接口的响应。</para>
55
/// </summary>
6-
public class OAuthRevokeResponse : TikTokV2Response
6+
public class OAuthRevokeTokenResponse : TikTokV2Response
77
{
88
}
99
}

0 commit comments

Comments
 (0)