curl -X POST 'https://api.weir.ai/org/talent/license/talent_123456789' \
-H 'Authorization: Bearer YOUR_ACCESS_TOKEN' \
-H 'x-source: console' \
-F 'name=Social Media Campaign' \
-F 'type=social_media' \
-F 'description=License for social media usage' \
-F 'appearanceFee=5000' \
-F 'canCrawl=true' \
-F '[email protected]' \
-F '[email protected]'
{
"data": {
"licenseId": "lic_123456789",
"talentId": "talent_123456789",
"name": "Social Media Campaign",
"type": "social_media",
"appearanceFee": 5000.00,
"canCrawl": true,
"imageCount": 2,
"status": "active",
"createdAt": "2024-01-22T15:30:00Z"
},
"message": "License created successfully",
"status": "success"
}
Create a new NIL license for talent
curl -X POST 'https://api.weir.ai/org/talent/license/talent_123456789' \
-H 'Authorization: Bearer YOUR_ACCESS_TOKEN' \
-H 'x-source: console' \
-F 'name=Social Media Campaign' \
-F 'type=social_media' \
-F 'description=License for social media usage' \
-F 'appearanceFee=5000' \
-F 'canCrawl=true' \
-F '[email protected]' \
-F '[email protected]'
{
"data": {
"licenseId": "lic_123456789",
"talentId": "talent_123456789",
"name": "Social Media Campaign",
"type": "social_media",
"appearanceFee": 5000.00,
"canCrawl": true,
"imageCount": 2,
"status": "active",
"createdAt": "2024-01-22T15:30:00Z"
},
"message": "License created successfully",
"status": "success"
}
curl -X POST 'https://api.weir.ai/org/talent/license/talent_123456789' \
-H 'Authorization: Bearer YOUR_ACCESS_TOKEN' \
-H 'x-source: console' \
-F 'name=Social Media Campaign' \
-F 'type=social_media' \
-F 'description=License for social media usage' \
-F 'appearanceFee=5000' \
-F 'canCrawl=true' \
-F '[email protected]' \
-F '[email protected]'
{
"data": {
"licenseId": "lic_123456789",
"talentId": "talent_123456789",
"name": "Social Media Campaign",
"type": "social_media",
"appearanceFee": 5000.00,
"canCrawl": true,
"imageCount": 2,
"status": "active",
"createdAt": "2024-01-22T15:30:00Z"
},
"message": "License created successfully",
"status": "success"
}
const createLicense = async (talentId, licenseData, accessToken) => {
const formData = new FormData();
formData.append('name', licenseData.name);
formData.append('type', licenseData.type);
formData.append('description', licenseData.description);
formData.append('appearanceFee', licenseData.appearanceFee);
formData.append('canCrawl', licenseData.canCrawl);
// Add images
licenseData.images?.forEach(image => {
formData.append('images', image);
});
const response = await fetch(`https://api.weir.ai/org/talent/license/${talentId}`, {
method: 'POST',
headers: {
'Authorization': `Bearer ${accessToken}`,
'x-source': 'console'
// Don't set Content-Type - browser sets it with boundary for FormData
},
body: formData
});
if (!response.ok) throw new Error(`HTTP error! status: ${response.status}`);
return await response.json();
};
Was this page helpful?