$API_TOKEN=<YOUR_API_TOKEN>
$cat > input.json << 'EOF'
<{
< "items": [
< {
< "id": 1,
< "product": "Wireless earbuds",
< "rating": 5,
< "review": "Great sound for the price and the battery lasts two full days. Pairing took seconds."
< },
< {
< "id": 2,
< "product": "Wireless earbuds",
< "rating": 2,
< "review": "The left earbud stopped charging after three weeks. Support has not answered my emails."
< },
< {
< "id": 3,
< "product": "Standing desk",
< "rating": 4,
< "review": "Sturdy and easy to assemble. The motor is a bit loud when the desk goes up."
< },
< {
< "id": 4,
< "product": "Standing desk",
< "rating": 1,
< "review": "Arrived with a scratched top and two screws missing. I am sending it back."
< },
< {
< "id": 5,
< "product": "Coffee grinder",
< "rating": 3,
< "review": "Grinds evenly, but cleaning it is a chore and the lid feels flimsy."
< }
< ],
< "instruction": "Classify the sentiment of the review and name the main complaint in at most 8 words.",
< "outputFields": [
< {
< "name": "sentiment",
< "type": "category",
< "options": [
< "positive",
< "neutral",
< "negative"
< ],
< "description": "Overall tone of the review"
< },
< {
< "name": "mainComplaint",
< "type": "text",
< "description": "The main complaint in at most 8 words"
< }
< ]
<}
<EOF
$curl "https://api.apify.com/v2/actors/istmobot~ai-data-enricher/runs?token=$API_TOKEN" \
< -X POST \
< -d @input.json \
< -H 'Content-Type: application/json'