The UA Write API returns a JSON containing the following:
"type":"InvalidJson"
Cause
The body of your call may be incorrectly formatted.
The error message is typically quite precise:
Example
"message":"Unable to parse the provided JSON: Unexpected character ('\"' (code 34)): was expecting comma to separate Object entries at line 2, column 24."
The body of your call may contain one or more properties whose specified value doesn’t match the format expected by the UA Write API.
For example, specifying a string rather than an integer as an
outcome
value when logging a usage analytics event would produce and
InvalidObject
error.
If you’re using an API key to authenticate your call, this key may have been disabled or deleted in the target Coveo organization, or your IP address may not have access to the key.
Modify the API key accordingly, or create a new API key with the required
privileges
.
The token header you’re sending may not be properly formatted.
For example, there may be a typo like
Baerer
.
Resolution
Ensure that your token header has the form
Authorization: Bearer <token>
, where
<token>
is your access token.
MissingParameter
Symptom
The UA Write API returns a JSON containing the following:
"type":"MissingParameter"
Cause
The body of your call may lack certain required key-value pairs.
The error message is typically quite precise:
Example
"message":"Parameter 'customEvent.eventType' is missing."
The access token you’re using isn’t associated with any
organization
.
Most of the time, this error occurs when authenticating with an Oauth2 token which, unlike API keys and
search tokens
, isn’t associated with a specific organization.
Resolution
Specify a valid value for the
org
query parameter, or use an access token that’s associated with an organization (that is, an API key or a search token).
UnauthorizedHub
Symptom
The UA Write API returns a JSON containing the following:
"type":"UnauthorizedHub"
Cause
Usually, this error occurs when you’re authenticating with a search token whose
searchHub
doesn’t match the value of
originLevel1
in your request body.
The error message is typically quite precise:
Example
"message":"You are not authorized to insert events in search hub 'ExternalSearch' since your token restricts you to search hub 'SupportHub'.",
Ensure that the value of
originLevel1
in your UA Write request matches the
searchHub
of your search token, or
request a new search token
with the appropriate
searchHub
.
Ensure that there aren’t any typos in the
originLevel1
value you specified.
The access token that you’re using doesn’t grant sufficient privileges in the target Coveo organization.
Resolution
Ensure that your access token has the privileges required to log usage analytics events to the organization you specified.
If you’re using an API key, make sure that it has the privilege to push analytics data to Coveo (that is, the
Allowed
access level on the
Analytics data
domain
).
Ensure that there aren’t any typos in the organization ID you specified.
The UA Write API endpoint that you’re trying to reach doesn’t exist.
Most of the time, this error is due to a typo.
You have exceeded the maximum number of calls that you can make in a given amount of time.
You’re most likely attempting to log far more usage analytics events than are required, or there may be an issue in your application which is causing it to log far more events than intended.
Resolution
Wait until your calls are no longer being throttled before using the service again.
In the future, ensure that your application makes UA Write API calls at a more standard rate.
Need help with our product? Please
open a support case
for expert assistance. Use this feedback option to comment on the article only.
Need help with our product? Please
open a support case
for expert assistance. Use this feedback option to comment on the article only.