Use this API to make synchronous and asynchronous calls to Custom AI Services
curl https://{{ tenant }}.lightenup.ai/customaiservice/{serviceName} \
--request POST \
--header "Authorization: Bearer {access_token}" \
--header "Content-Type: application/json" \
--data @- << EOF
{
"{input 1}": "{input text 1}",
"{input 2}": "{input text 2}",
...
"{input n}": "{input text n}"
}
EOF
{
headers: {
'Content-Type': 'application/json',
'Access-Control-Allow-Headers': '*',
'Access-Control-Allow-Methods': allowMethods,
'Access-Control-Allow-Origin': GLOBALS.CORS_ORIGIN,
'Access-Control-Allow-Credentials': true
},
body: {
'output1': 'output 1 response',
'output2': 'output 2 response',
}
}
curl https://{{ tenant }}.lightenup.ai/webhook/customaiservice/{serviceName}\
--request POST \
--header "Authorization: Bearer {access_token}" \
--header "Content-Type: application/json" \
--data @- << EOF
{
"input1": "input text 1",
"input2": "input text 2",
..
"inputn": "input text n"
}
EOF
{
"outputs": [
{
"execution_id": "80e49440-33e4-45f5-9e7e-3504cffa86ff"
}
],
"service": "cinema_users_segmentation"
}
curl https://{{ tenant }}.lightenup.ai/admin/stats\
--request POST \
--header "Authorization: Bearer {access_token}" \
--header "Content-Type: application/json" \
--data @- << EOF
{
"execution_id": "{execution_id from step 1}",
"opCode": "exec_logs"
}
EOF
"results": [
{
"userid": "12345",
"username": "jon",
"firstname": "Jon",
"lastname": "Doe",
"email": "jon.doe@example.com",
"registrationdate": "2020-01-15",
"membershipstatus": "Active",
"preferredgenre": "Action",
"favoritemovie": "Inception",
"movieswatched": "150",
"lastlogindate": "2023-10-10",
"itemspurchased": "20",
"location": "New York, NY",
"birthdate": "1990-05-24",
"gender": "Male",
"cinemavisitsthismonth": "5",
"cinemavisitsthisyear": "60",
"lifetimecinemavisits": "200",
"toppurchaseditem": "Popcorn",
"mostactivedaypoints": "Friday",
"points": "1500"
}
],