#!/bin/bash

random_email="user_$(openssl rand -hex 7)@test.com"
# random_email="user_095abd5c1284ba@test.com"
random_application_id="app_$(openssl rand -hex 12)"
random_candidate_id="cand_$(openssl rand -hex 12)"
random_redirect_url="https://redirecturl.com/$(openssl rand -hex 8)"
locale_key="en-US"
org_auth="3a9168a6db571a23ee5c10cea9"
# standlone assessment traitify
package_id="0fe0617b-be9f-494f-a820-669c478d1b0d"
curl -X POST https://app.stag.traitify.com/api/dash/assessments/orders \
    -d "{\"package\": \"$package_id\", \"workflow\": \"email\", \"assessment_taker\": {\"email\": \"$random_email\", \"candidate_id\": \"$random_candidate_id\", \"application_id\": \"$random_application_id\", \"locale_key\": \"$locale_key\"}, \"redirect_url\": \"$random_redirect_url\"}" \
    -u "x:$org_auth" \
    -H "Content-Type: application/json" \
--verbose | jq
