// Authentication with SynAppz API
const synappz = require('synappz-api');
// Initialize with your API key
const client = new synappz.Client({
apiKey: 'your_api_key_here'
});
// Authenticate a user
client.auth.login({
username: 'user@example.com',
password: 'secure_password'
})
.then(response => {
// Store the access token
const accessToken = response.accessToken;
console.log('Authentication successful');
})
.catch(error => {
console.error('Authentication failed:', error);
});
Request Parameters
Parameter |
Type |
Required |
Description |
username |
string |
Required |
User's email or username |
password |
string |
Required |
User's password |
Response
{
"accessToken": "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9...",
"refreshToken": "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9...",
"expiresIn": 3600,
"user": {
"id": "user_123456",
"username": "johndoe",
"displayName": "John Doe",
"email": "user@example.com"
}
}
Request Parameters
Parameter |
Type |
Required |
Description |
refreshToken |
string |
Required |
Valid refresh token |
Response
{
"accessToken": "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9...",
"expiresIn": 3600
}
// User operations with SynAppz API
const synappz = require('synappz-api');
// Initialize with your API key
const client = new synappz.Client({
apiKey: 'your_api_key_here'
});
// Get user profile
client.users.getProfile('user_123456')
.then(user => {
console.log('User profile:', user);
})
.catch(error => {
console.error('Error fetching user:', error);
});
// Update user profile
client.users.updateProfile('user_123456', {
displayName: 'John Smith',
bio: 'Software developer and content creator'
})
.then(updatedUser => {
console.log('Updated profile:', updatedUser);
})
.catch(error => {
console.error('Error updating user:', error);
});
Path Parameters
Parameter |
Type |
Required |
Description |
userId |
string |
Required |
Unique identifier for the user |
Response
{
"id": "user_123456",
"username": "johndoe",
"displayName": "John Doe",
"bio": "Software developer and content creator",
"profileImage": "https://api.synappz.io/images/profiles/user_123456.jpg",
"followerCount": 1250,
"followingCount": 350,
"postCount": 42,
"isVerified": false,
"createdAt": "2025-01-15T12:00:00Z",
"updatedAt": "2025-07-10T15:30:00Z"
}
Path Parameters
Parameter |
Type |
Required |
Description |
userId |
string |
Required |
Unique identifier for the user |
Request Body
Parameter |
Type |
Required |
Description |
displayName |
string |
Optional |
User's display name |
bio |
string |
Optional |
User's biography |
profileImage |
file |
Optional |
User's profile image |
Response
{
"id": "user_123456",
"username": "johndoe",
"displayName": "John Smith",
"bio": "Software developer and content creator",
"profileImage": "https://api.synappz.io/images/profiles/user_123456.jpg",
"followerCount": 1250,
"followingCount": 350,
"postCount": 42,
"isVerified": false,
"createdAt": "2025-01-15T12:00:00Z",
"updatedAt": "2025-07-22T10:15:00Z"
}
// Content operations with SynAppz API
const synappz = require('synappz-api');
// Initialize with your API key
const client = new synappz.Client({
apiKey: 'your_api_key_here'
});
// Get trending content
client.content.getTrending({
limit: 10,
category: 'music'
})
.then(content => {
console.log('Trending content:', content);
})
.catch(error => {
console.error('Error fetching content:', error);
});
// Upload new content
const videoFile = fs.readFileSync('path/to/video.mp4');
client.content.upload({
file: videoFile,
title: 'My Awesome Video',
description: 'Check out this cool content!',
tags: ['music', 'original', 'synappz']
})
.then(response => {
console.log('Upload successful:', response);
})
.catch(error => {
console.error('Upload failed:', error);
});
Query Parameters
Parameter |
Type |
Required |
Description |
limit |
integer |
Optional |
Number of items to return (default: 20, max: 100) |
offset |
integer |
Optional |
Number of items to skip (default: 0) |
category |
string |
Optional |
Filter by content category |
Response
{
"items": [
{
"id": "content_789012",
"type": "video",
"title": "Amazing Sunset Timelapse",
"description": "Watch this beautiful sunset over the ocean",
"url": "https://api.synappz.io/videos/content_789012.mp4",
"thumbnailUrl": "https://api.synappz.io/thumbnails/content_789012.jpg",
"creator": {
"id": "user_123456",
"username": "johndoe",
"displayName": "John Doe",
"profileImage": "https://api.synappz.io/images/profiles/user_123456.jpg"
},
"stats": {
"views": 15420,
"likes": 2340,
"comments": 156,
"shares": 89
},
"createdAt": "2025-07-15T18:30:00Z"
},
// More content items...
],
"pagination": {
"total": 1250,
"limit": 10,
"offset": 0,
"hasMore": true
}
}
Request Body (multipart/form-data)
Parameter |
Type |
Required |
Description |
file |
file |
Required |
Content file (video, image, etc.) |
title |
string |
Required |
Content title |
description |
string |
Optional |
Content description |
tags |
array |
Optional |
Array of tag strings |
Response
{
"id": "content_901234",
"type": "video",
"title": "My Awesome Video",
"description": "Check out this cool content!",
"url": "https://api.synappz.io/videos/content_901234.mp4",
"thumbnailUrl": "https://api.synappz.io/thumbnails/content_901234.jpg",
"tags": ["music", "original", "synappz"],
"status": "processing",
"createdAt": "2025-07-22T10:30:00Z"
}
// Social interactions with SynAppz API
const synappz = require('synappz-api');
// Initialize with your API key
const client = new synappz.Client({
apiKey: 'your_api_key_here'
});
// Like a piece of content
client.social.like('content_789012')
.then(response => {
console.log('Like successful:', response);
})
.catch(error => {
console.error('Like failed:', error);
});
// Post a comment
client.social.comment('content_789012', {
text: 'This is amazing content! Love it!'
})
.then(comment => {
console.log('Comment posted:', comment);
})
.catch(error => {
console.error('Comment failed:', error);
});
Path Parameters
Parameter |
Type |
Required |
Description |
contentId |
string |
Required |
Unique identifier for the content |
Response
{
"success": true,
"contentId": "content_789012",
"likeCount": 2341,
"liked": true
}
Path Parameters
Parameter |
Type |
Required |
Description |
contentId |
string |
Required |
Unique identifier for the content |
Request Body
Parameter |
Type |
Required |
Description |
text |
string |
Required |
Comment text (max 500 characters) |
parentId |
string |
Optional |
Parent comment ID for replies |
Response
{
"id": "comment_345678",
"contentId": "content_789012",
"text": "This is amazing content! Love it!",
"user": {
"id": "user_123456",
"username": "johndoe",
"displayName": "John Doe",
"profileImage": "https://api.synappz.io/images/profiles/user_123456.jpg"
},
"likeCount": 0,
"replyCount": 0,
"createdAt": "2025-07-22T10:45:00Z"
}
Path Parameters
Response
Path Parameters
Request Body
Response