- API version: 1.0.0
- Build date: 2019-12-27T00:51:33.049404+08:00[Asia/Shanghai]
No description provided (generated by Swagger Codegen https://github.com/swagger-api/swagger-codegen)
Automatically generated by the Swagger Codegen
Building the API client library requires:
- Java 1.7+
- Maven/Gradle
To install the API client library to your local Maven repository, simply execute:
mvn clean install
To deploy it to a remote Maven repository instead, configure the settings of the repository and execute:
mvn clean deploy
Refer to the OSSRH Guide for more information.
Add this dependency to your project's POM:
<dependency>
<groupId>io.swagger</groupId>
<artifactId>swagger-java-client</artifactId>
<version>1.0.0</version>
<scope>compile</scope>
</dependency>
Add this dependency to your project's build file:
compile "io.swagger:swagger-java-client:1.0.0"
At first generate the JAR by executing:
mvn clean package
Then manually install the following JARs:
target/swagger-java-client-1.0.0.jar
target/lib/*.jar
Please follow the installation instruction and execute the following Java code:
java
import com.douyin.open.*;
import com.douyin.open.auth.*;
import com.douyin.open.model.*;
import com.douyin.open.client.DefaultApi;
import java.io.File;
import java.util.*;
public class DefaultApiExample {
public static void main(String[] args) {
DefaultApi apiInstance = new DefaultApi();
String clientKey = "clientKey_example"; // String | 应用唯一标识
String clientSecret = "clientSecret_example"; // String | 应用唯一标识对应的密钥
String code = "code_example"; // String | 授权码
String grantType = "grantType_example"; // String | 写死\"authorization_code\"即可
try {
OauthAccessTokenResponse result = apiInstance.oauthAccessTokenGet(clientKey, clientSecret, code, grantType);
System.out.println(result);
} catch (ApiException e) {
System.err.println("Exception when calling DefaultApi#oauthAccessTokenGet");
e.printStackTrace();
}
}
}
import com.douyin.open.*;
import com.douyin.open.auth.*;
import com.douyin.open.model.*;
import com.douyin.open.client.DefaultApi;
import java.io.File;
import java.util.*;
public class DefaultApiExample {
public static void main(String[] args) {
DefaultApi apiInstance = new DefaultApi();
String clientKey = "clientKey_example"; // String | 应用唯一标识
String clientSecret = "clientSecret_example"; // String | 应用唯一标识对应的密钥
String grantType = "grantType_example"; // String |
try {
OauthClientTokenResponse result = apiInstance.oauthClientTokenGet(clientKey, clientSecret, grantType);
System.out.println(result);
} catch (ApiException e) {
System.err.println("Exception when calling DefaultApi#oauthClientTokenGet");
e.printStackTrace();
}
}
}
import com.douyin.open.*;
import com.douyin.open.auth.*;
import com.douyin.open.model.*;
import com.douyin.open.client.DefaultApi;
import java.io.File;
import java.util.*;
public class DefaultApiExample {
public static void main(String[] args) {
DefaultApi apiInstance = new DefaultApi();
String clientKey = "clientKey_example"; // String | 应用唯一标识
String grantType = "grantType_example"; // String | 填refresh_token
String refreshToken = "refreshToken_example"; // String | 填写通过access_token获取到的refresh_token参数
try {
OauthRefreshTokenResponse result = apiInstance.oauthRefreshTokenGet(clientKey, grantType, refreshToken);
System.out.println(result);
} catch (ApiException e) {
System.err.println("Exception when calling DefaultApi#oauthRefreshTokenGet");
e.printStackTrace();
}
}
}
import com.douyin.open.*;
import com.douyin.open.auth.*;
import com.douyin.open.model.*;
import com.douyin.open.client.DefaultApi;
import java.io.File;
import java.util.*;
public class DefaultApiExample {
public static void main(String[] args) {
DefaultApi apiInstance = new DefaultApi();
String clientKey = "clientKey_example"; // String | 应用唯一标识
String responseType = "responseType_example"; // String | 填写code
String scope = "scope_example"; // String | 应用授权作用域,多个授权作用域以英文逗号(,)分隔
String redirectUri = "redirectUri_example"; // String | 授权成功后的回调地址,必须以http/https开头。
String state = "state_example"; // String | 用于保持请求和回调的状态
try {
apiInstance.platformOauthConnectGet(clientKey, responseType, scope, redirectUri, state);
} catch (ApiException e) {
System.err.println("Exception when calling DefaultApi#platformOauthConnectGet");
e.printStackTrace();
}
}
}
All URIs are relative to https://open.douyin.com
Class | Method | HTTP request | Description |
---|---|---|---|
DefaultApi | oauthAccessTokenGet | GET /oauth/access_token/ | 获取access_token |
DefaultApi | oauthClientTokenGet | GET /oauth/client_token/ | 生成client_token |
DefaultApi | oauthRefreshTokenGet | GET /oauth/refresh_token/ | 刷新access_token |
DefaultApi | platformOauthConnectGet | GET /platform/oauth/connect/ | 获取授权码(code) |
- OauthAccessTokenResponse
- OauthAccessTokenResponseData
- OauthClientTokenResponse
- OauthClientTokenResponseData
- OauthRefreshTokenResponse
- OauthRefreshTokenResponseData
All endpoints do not require authorization. Authentication schemes defined for the API:
It's recommended to create an instance of ApiClient
per thread in a multithreaded environment to avoid any potential issues.