Skip to content

Commit

Permalink
Merge pull request #282 from apivideo/java-client-chore/java_swift_an…
Browse files Browse the repository at this point in the history
…droid_rate_limiting_release

[SDK README - api.video-java-client] chore(config): bump java and swift clients/uploaders version
  • Loading branch information
ThibaultBee committed Apr 25, 2024
2 parents e105d9d + ba5882f commit 0735a9d
Showing 1 changed file with 23 additions and 4 deletions.
27 changes: 23 additions & 4 deletions sdks/api-clients/apivideo-java-client.md
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ Add this dependency to your project's POM:
<dependency>
<groupId>video.api</groupId>
<artifactId>java-api-client</artifactId>
<version>1.3.2</version>
<version>1.3.3</version>
<scope>compile</scope>
</dependency>
```
Expand All @@ -44,7 +44,7 @@ Add this dependency to your project's POM:
Add this dependency to your project's build file:

```groovy
implementation "video.api:java-api-client:1.3.2"
implementation "video.api:java-api-client:1.3.3"
```

#### Others
Expand All @@ -57,7 +57,7 @@ mvn clean package

Then manually install the following JARs:

* `target/java-api-client-1.3.2.jar`
* `target/java-api-client-1.3.3.jar`
* `target/lib/*.jar`

### Code sample
Expand Down Expand Up @@ -346,6 +346,7 @@ Method | HTTP request | Description
- [RestreamsResponseObject](https://github.com/apivideo/api.video-java-client/blob/main/docs/RestreamsResponseObject.md)
- [TokenCreationPayload](https://github.com/apivideo/api.video-java-client/blob/main/docs/TokenCreationPayload.md)
- [TokenListResponse](https://github.com/apivideo/api.video-java-client/blob/main/docs/TokenListResponse.md)
- [TooManyRequests](https://github.com/apivideo/api.video-java-client/blob/main/docs/TooManyRequests.md)
- [UploadToken](https://github.com/apivideo/api.video-java-client/blob/main/docs/UploadToken.md)
- [Video](https://github.com/apivideo/api.video-java-client/blob/main/docs/Video.md)
- [VideoAssets](https://github.com/apivideo/api.video-java-client/blob/main/docs/VideoAssets.md)
Expand Down Expand Up @@ -377,7 +378,25 @@ Method | HTTP request | Description
- [WebhooksListResponse](https://github.com/apivideo/api.video-java-client/blob/main/docs/WebhooksListResponse.md)


### Documentation for Authorization
### Rate Limiting

api.video implements rate limiting to ensure fair usage and stability of the service. The API provides the rate limit values in the response headers for any API requests you make. The /auth endpoint is the only route without rate limitation.

In this client, you can access these headers by using the `*WithHttpInfo()` or `*Async` versions of the methods. These methods return the `ApiResponse` that contains the response body and the headers, allowing you to check the `X-RateLimit-Limit`, `X-RateLimit-Remaining`, and `X-RateLimit-Retry-After` headers to understand your current rate limit status.
Read more about these response headers in the [API reference](https://docs.api.video/reference#limitation).

Here is an example of how to use these methods:

```java
ApiVideoClient client = new ApiVideoClient("YOUR_API_KEY");
ApiResponse<Video> response = client.videos().uploadWithUploadTokenWithHttpInfo("YOUR_UPLOAD_TOKEN", File("my-video.mp4"));
Map<String, List<String>> headers = response.getHeaders();
System.out.println("X-RateLimit-Limit: " + headers.get("X-RateLimit-Limit").get(0));
System.out.println("X-RateLimit-Remaining: " + headers.get("X-RateLimit-Remaining").get(0));
System.out.println("X-RateLimit-Retry-After: " + headers.get("X-RateLimit-Retry-After").get(0));
```

### Authorization

#### API key

Expand Down

0 comments on commit 0735a9d

Please sign in to comment.