The value of @token
is being passed to HTTPPost()
, but that's missing the required string "Bearer " (which does appear in @accessToken
). In other words, your API request should instead look like:
HTTPPost(
"https://subdomainofcompany.rest.marketingcloudapis.com/interaction/v1/events",
"application/json",
@body,
@callstatus,
'Authorization',
@accessToken
)
An aside: CloudPages returns a status of 500 and also mentions 500 in the body. Legacy/Classic Microsites returns a status of 200 but is a little more helpful by mentioning 401 in the body.