All URIs are relative to https://dev.to/api
Method | HTTP request | Description |
---|---|---|
getUserReadinglist | GET /api/readinglist | Readinglist |
List<ArticleIndex> getUserReadinglist().page(page).perPage(perPage).execute();
Readinglist
This endpoint allows the client to retrieve a list of articles that were saved to a Users readinglist. It supports pagination, each page will contain `30` articles by default
import com.konfigthis.client.ApiClient;
import com.konfigthis.client.ApiException;
import com.konfigthis.client.ApiResponse;
import com.konfigthis.client.Dev;
import com.konfigthis.client.Configuration;
import com.konfigthis.client.auth.*;
import com.konfigthis.client.model.*;
import com.konfigthis.client.api.ReadinglistApi;
import java.util.List;
import java.util.Map;
import java.util.UUID;
public class Example {
public static void main(String[] args) {
Configuration configuration = new Configuration();
configuration.host = "https://dev.to/api";
configuration.apiKey = "YOUR API KEY";
Dev client = new Dev(configuration);
Integer page = 1; // Pagination page
Integer perPage = 30; // Page size (the number of items to return per page). The default maximum value can be overridden by \"API_PER_PAGE_MAX\" environment variable.
try {
List<ArticleIndex> result = client
.readinglist
.getUserReadinglist()
.page(page)
.perPage(perPage)
.execute();
System.out.println(result);
} catch (ApiException e) {
System.err.println("Exception when calling ReadinglistApi#getUserReadinglist");
System.err.println("Status code: " + e.getStatusCode());
System.err.println("Reason: " + e.getResponseBody());
System.err.println("Response headers: " + e.getResponseHeaders());
e.printStackTrace();
}
// Use .executeWithHttpInfo() to retrieve HTTP Status Code, Headers and Request
try {
ApiResponse<List<ArticleIndex>> response = client
.readinglist
.getUserReadinglist()
.page(page)
.perPage(perPage)
.executeWithHttpInfo();
System.out.println(response.getResponseBody());
System.out.println(response.getResponseHeaders());
System.out.println(response.getStatusCode());
System.out.println(response.getRoundTripTime());
System.out.println(response.getRequest());
} catch (ApiException e) {
System.err.println("Exception when calling ReadinglistApi#getUserReadinglist");
System.err.println("Status code: " + e.getStatusCode());
System.err.println("Reason: " + e.getResponseBody());
System.err.println("Response headers: " + e.getResponseHeaders());
e.printStackTrace();
}
}
}
Name | Type | Description | Notes |
---|---|---|---|
page | Integer | Pagination page | [optional] [default to 1] |
perPage | Integer | Page size (the number of items to return per page). The default maximum value can be overridden by "API_PER_PAGE_MAX" environment variable. | [optional] [default to 30] |
- Content-Type: Not defined
- Accept: application/json
Status code | Description | Response headers |
---|---|---|
200 | A list of articles in the users readinglist | - |