Create a like
Adds a like to a prompt.
If the prompt was created using a pack (i.e: orig_prompt_id
is set) - a like will be added to the original prompt as well.
Parameters
Returns
Returns status code 201 if successful and no content.
POST /prompts/:prompt_id/likes
- cURL
- Node.js
- Python
curl -X POST -H "Authorization: Bearer $API_KEY" https://api.astria.ai/prompts/:prompt_id/like
const fetch = require(`node-fetch');
const FormData = require('form-data');
const API_URL = 'https://api.astria.ai/prompts/:prompt_id/like';
const API_KEY = 'YOUR_API_KEY'; // Replace with your actual API key
const headers = { Authorization: `Bearer ${API_KEY}` }
fetch(API_URL, {
method: 'POST',
headers: headers,
}).then(response => response.json())
import requests
API_URL = 'https://api.astria.ai/prompts/:prompt_id/like'
API_KEY = 'YOUR_API_KEY' # Replace with your actual API key
headers = {
'Authorization': f'Bearer {API_KEY}'
}
response = requests.post(API_URL, headers=headers)
Response
Status code: 201 Created