Platform kreator QQ Huxuan Daftar Artikel Akun Resmi API (V1)
Status kesehatan API
Sehat Tersedia Terbatas Sebagian besar tidak tersedia Tidak ada data
Memuat status kesehatan...
Menampilkan artikel dari kreator Akun Resmi QQ Huxuan dalam rentang tanggal yang wajib diisi. Anda bisa memberi kata kunci judul sebagai parameter opsional dan memilih semua artikel atau artikel pesanan Huxuan. Gunakan untuk meninjau artikel dari penerbit tersebut.
Parameter
| Nama | Lokasi | Jenis | Wajib | Bawaan | Deskripsi |
|---|---|---|---|---|---|
token |
query | string |
Ya | - | Token autentikasi pengguna. |
appId |
query | string |
Ya | - | ID aplikasi pembuat Akun Resmi. |
keyword |
query | string |
Tidak | |
Kata kunci judul artikel. Biarkan kosong untuk mengembalikan semua artikel yang sesuai. |
articleType |
query | string |
Tidak | ALL |
Filter jenis artikel Tencent Huxuan. Nilai yang tersedia: - ALL: Semua artikel- ORDER: Urutan artikel Huxuan QQ |
startDate |
query | string |
Ya | - | Tanggal awal dalam format yyyyMMdd. |
endDate |
query | string |
Ya | - | Tanggal akhir dalam format yyyyMMdd. |
page |
query | integer |
Tidak | 1 |
Nomor halaman. Halaman pertama adalah 1. |
Contoh Kode
bash
curl --max-time 120 -X GET 'https://api.justoneapi.com/api/qq-huxuan/cgi-bin/advertiser/mp_publisher/get_user_articles/v1?token=YOUR_API_KEY&appId=VALUE&startDate=VALUE&endDate=VALUE'
text
Saya ingin menggunakan API "Daftar Artikel Akun Resmi (V1)" dari JustOneAPI.
URL dasar: https://api.justoneapi.com.
Jalur API: /api/qq-huxuan/cgi-bin/advertiser/mp_publisher/get_user_articles/v1?token=YOUR_API_KEY&appId=VALUE&startDate=VALUE&endDate=VALUE
Endpoint API: BASE_URL + /api/qq-huxuan/cgi-bin/advertiser/mp_publisher/get_user_articles/v1?token=YOUR_API_KEY&appId=VALUE&startDate=VALUE&endDate=VALUE
Metode HTTP: GET
Autentikasi: Tambahkan parameter query "token" ke URL.
Definisi OpenAPI: https://docs.justoneapi.com/openapi/qq-huxuan-creator-marketplace/official-account-article-list-v1-id.json
Parameter:
- token (query): Token autentikasi pengguna. (Wajib)
- appId (query): ID aplikasi pembuat Akun Resmi. (Wajib)
- keyword (query): Kata kunci judul artikel. Biarkan kosong untuk mengembalikan semua artikel yang sesuai.
- articleType (query): Filter jenis artikel Tencent Huxuan.
Nilai yang tersedia:
- `ALL`: Semua artikel
- `ORDER`: Urutan artikel Huxuan QQ
- startDate (query): Tanggal awal dalam format yyyyMMdd. (Wajib)
- endDate (query): Tanggal akhir dalam format yyyyMMdd. (Wajib)
- page (query): Nomor halaman. Halaman pertama adalah 1.
Format Kembalian: tangani dengan aman JSON atau teks sesuai dengan Content-Type yang sebenarnya.
Penanganan respons dan kode kesalahan:
1. Tentukan hasil pemrosesan dari kolom "code" dalam isi respons (code 0 berarti berhasil).
2. Batas waktu yang disarankan: Atur batas waktu permintaan menjadi 120 detik. Jika 120 detik terlalu lama untuk kebutuhan Anda, gunakan setidaknya 60 detik. Sebagian kecil permintaan mungkin mencapai batas waktu sebelum hasil diterima.
3. Kode hasil:
- 0: Berhasil
- 100: Token tidak valid atau tidak aktif
- 301: Gagal mengambil data. Silakan coba lagi.
- 302: Batas frekuensi permintaan terlampaui
- 303: Kuota harian terlampaui
- 400: Parameter tidak valid
- 500: Kesalahan internal server
- 600: Akses ditolak
- 601: Saldo tidak mencukupi
- 602: Batas anggaran token tercapai
4. Kode 601 berarti saldo bersama akun tidak mencukupi. Kode 602 berarti token API yang digunakan telah mencapai batas anggaran kumulatifnya sendiri. Menetapkan batas anggaran token tidak memindahkan dana dari saldo bersama akun.
Tolong bantu saya menulis skrip dalam bahasa pemrograman favorit saya untuk memanggil API ini dan menangani responsnya.
python
import requests
BASE_URL = "https://api.justoneapi.com" # Diberikan oleh server OpenAPI
url = BASE_URL + "/api/qq-huxuan/cgi-bin/advertiser/mp_publisher/get_user_articles/v1?token=YOUR_API_KEY&appId=VALUE&startDate=VALUE&endDate=VALUE"
response = requests.get(url, timeout=120)
print(response.status_code)
if response.content:
content_type = response.headers.get("content-type", "").lower()
if "json" in content_type:
try:
print(response.json())
except ValueError:
print(response.text)
elif content_type.startswith("text/") or "xml" in content_type or content_type.split(";", 1)[0].strip() in {"application/javascript", "application/x-www-form-urlencoded", "application/graphql"}:
print(response.text)
else:
with open("response.bin", "wb") as output:
output.write(response.content)
print(f"Saved {len(response.content)} bytes to response.bin")
js
const BASE_URL = "https://api.justoneapi.com"; // Diberikan oleh server OpenAPI
const url = BASE_URL + "/api/qq-huxuan/cgi-bin/advertiser/mp_publisher/get_user_articles/v1?token=YOUR_API_KEY&appId=VALUE&startDate=VALUE&endDate=VALUE";
const response = await fetch(url, {
method: "GET",
signal: AbortSignal.timeout(120000)
});
console.log(response.status);
const responseBytes = await response.arrayBuffer();
if (responseBytes.byteLength) {
const contentType = (response.headers.get("content-type") || "").toLowerCase();
const mediaType = contentType.split(";", 1)[0].trim();
const textual = contentType.startsWith("text/") || contentType.includes("json") || contentType.includes("xml") || ["application/javascript", "application/x-www-form-urlencoded", "application/graphql"].includes(mediaType);
if (textual) {
const responseText = new TextDecoder().decode(responseBytes);
let data = responseText;
if (contentType.includes("json")) {
try { data = JSON.parse(responseText); } catch { /* Keep the raw body. */ }
}
console.log(data);
} else {
console.log(`Received ${responseBytes.byteLength} binary bytes`);
}
}
java
import java.net.URI;
import java.net.http.HttpClient;
import java.net.http.HttpRequest;
import java.net.http.HttpResponse;
import java.time.Duration;
import java.nio.charset.StandardCharsets;
import java.nio.file.Files;
import java.nio.file.Path;
public class Main {
public static void main(String[] args) throws Exception {
final String BASE_URL = "https://api.justoneapi.com"; // Diberikan oleh server OpenAPI
final String url = BASE_URL + "/api/qq-huxuan/cgi-bin/advertiser/mp_publisher/get_user_articles/v1?token=YOUR_API_KEY&appId=VALUE&startDate=VALUE&endDate=VALUE";
HttpClient client = HttpClient.newBuilder().connectTimeout(Duration.ofSeconds(120)).build();
HttpRequest.Builder builder = HttpRequest.newBuilder()
.uri(URI.create(url))
.timeout(Duration.ofSeconds(120))
.method("GET", HttpRequest.BodyPublishers.noBody());
HttpRequest request = builder.build();
HttpResponse<byte[]> response = client.send(request, HttpResponse.BodyHandlers.ofByteArray());
System.out.println(response.statusCode());
String contentType = response.headers().firstValue("content-type").orElse("").toLowerCase();
String mediaType = contentType.split(";", 2)[0].trim();
if (contentType.startsWith("text/") || contentType.contains("json") || contentType.contains("xml") || mediaType.equals("application/javascript") || mediaType.equals("application/x-www-form-urlencoded") || mediaType.equals("application/graphql")) {
System.out.println(new String(response.body(), StandardCharsets.UTF_8));
} else {
Files.write(Path.of("response.bin"), response.body());
System.out.println("Saved " + response.body().length + " bytes to response.bin");
}
}
}
go
package main
import (
"fmt"
"io"
"os"
"strings"
"net/http"
"time"
)
const BASE_URL = "https://api.justoneapi.com" // Diberikan oleh server OpenAPI
func main() {
client := &http.Client{Timeout: 120 * time.Second}
url := BASE_URL + "/api/qq-huxuan/cgi-bin/advertiser/mp_publisher/get_user_articles/v1?token=YOUR_API_KEY&appId=VALUE&startDate=VALUE&endDate=VALUE"
req, _ := http.NewRequest("GET", url, nil)
resp, _ := client.Do(req)
defer resp.Body.Close()
fmt.Println(resp.StatusCode)
bodyBytes, _ := io.ReadAll(resp.Body)
contentType := strings.ToLower(resp.Header.Get("Content-Type"))
mediaType := strings.TrimSpace(strings.SplitN(contentType, ";", 2)[0])
if strings.HasPrefix(contentType, "text/") || strings.Contains(contentType, "json") || strings.Contains(contentType, "xml") || mediaType == "application/javascript" || mediaType == "application/x-www-form-urlencoded" || mediaType == "application/graphql" {
fmt.Println(string(bodyBytes))
} else {
os.WriteFile("response.bin", bodyBytes, 0600)
fmt.Printf("Saved %d bytes to response.bin\n", len(bodyBytes))
}
}
php
<?php
$BASE_URL = 'https://api.justoneapi.com'; // Diberikan oleh server OpenAPI
$url = $BASE_URL . '/api/qq-huxuan/cgi-bin/advertiser/mp_publisher/get_user_articles/v1?token=YOUR_API_KEY&appId=VALUE&startDate=VALUE&endDate=VALUE';
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, $url);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_TIMEOUT, 120);
curl_setopt($ch, CURLOPT_CUSTOMREQUEST, "GET");
$response = curl_exec($ch);
$status = curl_getinfo($ch, CURLINFO_RESPONSE_CODE);
$contentType = strtolower((string) curl_getinfo($ch, CURLINFO_CONTENT_TYPE));
curl_close($ch);
echo $status . PHP_EOL;
$mediaType = trim(explode(';', $contentType, 2)[0]);
if (str_starts_with($contentType, 'text/') || str_contains($contentType, 'json') || str_contains($contentType, 'xml') || in_array($mediaType, ['application/javascript', 'application/x-www-form-urlencoded', 'application/graphql'], true)) {
echo $response;
} else {
file_put_contents('response.bin', $response);
echo 'Saved ' . strlen($response) . ' bytes to response.bin' . PHP_EOL;
}
Field Respons
Field Kunci dalam respons yang sukses (code = 0).
Detail artikel11 kolom
data
| Kolom | Jenis | Deskripsi |
|---|---|---|
items |
array |
Artikel yang dikembalikan untuk pembuat yang dipilih dan rentang tanggal. |
items[].title |
string |
Judul tampilan artikel. |
items[].id |
string |
ID artikel yang dikembalikan dalam field id. |
items[].aid |
string |
Referensi artikel yang dikembalikan secara terpisah dalam field aid. |
items[].appid |
string |
ID aplikasi yang dilaporkan bersama dengan catatan artikel. |
items[].msgid |
integer |
ID pesan numerik yang dilaporkan bersama dengan artikel. |
items[].idx |
integer |
Posisi artikel ini dalam pesan yang dilaporkan. |
items[].url |
string |
Link artikel yang dikembalikan untuk catatan tersebut. |
items[].cover_url |
string |
Link gambar sampul yang dikembalikan untuk artikel. |
items[].publish_time |
string |
Waktu publikasi dalam satuan detik Unix yang dikodekan sebagai teks. |
items[].content |
string |
Field konten artikel yang dikembalikan sebagai teks, yang mungkin kosong. |
Kategori dan metrik10 kolom
data
| Kolom | Jenis | Deskripsi |
|---|---|---|
items[].article_type |
integer |
Kode jenis artikel yang dilaporkan untuk catatan ini. |
items[].industry_name |
string |
Label industri yang dilaporkan bersama artikel ini. |
items[].first_category_name |
string |
Label kategori tingkat pertama untuk artikel. |
items[].is_pinned |
integer |
Flag status “pinned” yang dilaporkan untuk artikel ini. |
items[].is_hidden |
integer |
Flag status “hidden” yang dilaporkan untuk artikel ini. |
items[].read_count |
string |
Jumlah pembaca yang ditampilkan sebagai teks. |
items[].fav_count |
string |
Jumlah yang disimpan yang ditampilkan sebagai teks. |
items[].share_count |
string |
Jumlah yang dibagikan yang ditampilkan sebagai teks. |
items[].like_count |
string |
Jumlah yang disukai yang ditampilkan sebagai teks. |
items[].comment_count |
string |
Jumlah komentar yang ditampilkan sebagai teks. |
Paginasi dan status5 kolom
data
| Kolom | Jenis | Deskripsi |
|---|---|---|
ret |
integer |
Kode status yang dilaporkan oleh Tencent Huxuan untuk hasil ini. |
page |
integer |
Nomor halaman yang dilaporkan untuk hasil artikel. |
total |
integer |
Jumlah total artikel yang sesuai yang dilaporkan oleh endpoint. |
total_start_date |
string |
Tanggal awal rentang hasil yang dilaporkan oleh endpoint. |
total_end_date |
string |
Tanggal akhir rentang hasil yang dilaporkan oleh endpoint. |
Contoh Respons
Memuat contoh respons...