ugcinc 1.3.0 → 1.4.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +43 -1
- package/dist/posts.d.ts +1 -0
- package/dist/types.d.ts +2 -0
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -52,7 +52,8 @@ For complete API documentation, including all endpoints, parameters, and example
|
|
|
52
52
|
### Posts
|
|
53
53
|
- Create video posts
|
|
54
54
|
- Create slideshow posts
|
|
55
|
-
- Get post status
|
|
55
|
+
- Get post status (includes platform URL when complete - TikTok or Instagram)
|
|
56
|
+
- Get posts with filters (by accountIds, postIds, date range)
|
|
56
57
|
- Get post statistics
|
|
57
58
|
|
|
58
59
|
### Tasks
|
|
@@ -112,6 +113,47 @@ const response = await client.posts.createVideo({
|
|
|
112
113
|
});
|
|
113
114
|
```
|
|
114
115
|
|
|
116
|
+
**Get posts with filters:**
|
|
117
|
+
```typescript
|
|
118
|
+
// Get specific posts by ID
|
|
119
|
+
const response = await client.posts.getPosts({
|
|
120
|
+
postIds: ['post-uuid-1', 'post-uuid-2']
|
|
121
|
+
});
|
|
122
|
+
|
|
123
|
+
// Get posts by account
|
|
124
|
+
const response = await client.posts.getPosts({
|
|
125
|
+
accountIds: ['account-uuid']
|
|
126
|
+
});
|
|
127
|
+
|
|
128
|
+
if (response.ok) {
|
|
129
|
+
response.data.forEach(post => {
|
|
130
|
+
console.log(`Post ${post.id}: ${post.status}`);
|
|
131
|
+
// For complete posts, postUrl will contain the platform URL
|
|
132
|
+
// TikTok: https://www.tiktok.com/@username/video/social_id
|
|
133
|
+
// Instagram: https://www.instagram.com/p/social_id/
|
|
134
|
+
if (post.postUrl) {
|
|
135
|
+
console.log(`Watch at: ${post.postUrl}`);
|
|
136
|
+
}
|
|
137
|
+
});
|
|
138
|
+
}
|
|
139
|
+
```
|
|
140
|
+
|
|
141
|
+
**Check post status:**
|
|
142
|
+
```typescript
|
|
143
|
+
const response = await client.posts.getStatus({
|
|
144
|
+
postId: 'post-uuid'
|
|
145
|
+
});
|
|
146
|
+
|
|
147
|
+
if (response.ok) {
|
|
148
|
+
console.log(`Status: ${response.data.status}`);
|
|
149
|
+
// postUrl is available when status is "complete"
|
|
150
|
+
// Format depends on platform (TikTok or Instagram)
|
|
151
|
+
if (response.data.postUrl) {
|
|
152
|
+
console.log(`Post URL: ${response.data.postUrl}`);
|
|
153
|
+
}
|
|
154
|
+
}
|
|
155
|
+
```
|
|
156
|
+
|
|
115
157
|
## TypeScript Support
|
|
116
158
|
|
|
117
159
|
This package is written in TypeScript and provides full type definitions:
|
package/dist/posts.d.ts
CHANGED
package/dist/types.d.ts
CHANGED
|
@@ -82,6 +82,7 @@ export interface Post {
|
|
|
82
82
|
media_urls: string[] | null;
|
|
83
83
|
music_post_id: string | null;
|
|
84
84
|
scheduled_at: string | null;
|
|
85
|
+
postUrl?: string;
|
|
85
86
|
}
|
|
86
87
|
export interface PostStat {
|
|
87
88
|
id: string;
|
|
@@ -133,6 +134,7 @@ export interface GetTasksParams {
|
|
|
133
134
|
}
|
|
134
135
|
export interface GetPostsParams {
|
|
135
136
|
accountIds?: string[];
|
|
137
|
+
postIds?: string[];
|
|
136
138
|
startDate?: string;
|
|
137
139
|
endDate?: string;
|
|
138
140
|
}
|