Start a conversation

Error: "FIELD_INVALID" When Performing API Calls

Overview

While making an API call, users may receive the following error message

FIELD_INVALID

Within it, you will have the parameters that are triggering this issue when trying to integrate with your website. Something, similar to the results below should be displaying.

For example, using the API call from Retrieve Metric will create a URL similar to the one below:

https://mycompany.kayako.com/api/v1/insights/cases/metrics.json?start_at=2018-04-23&end_at=2018-04-29


Which would generate the following response:

status 400
errors

0

code "FIELD_INVALID"
parameter "start_at"
message "The value of the field is invalid"

more_info "https://developer.kayako.com/api/v1/reference/errors/FIELD_INVALID"

1
code "FIELD_INVALID"
parameter "end_at"
message "The value of the field is invalid"
more_info "https://developer.kayako.com/api/v1/reference/errors/FIELD_INVALID"

logs

0

level "NOTICE"

message "To avoid long delays instead of supplying username and password with each request use just the session id"

  

Information

If you receive the above error when using dates, for example, it means the API call you are using appears to be incomplete. The start_at and end_at arguments are both strings, and you need to use this format: YYYY-MM-DDThh:mm:ssTZD to add the time text. The API call that you need to make would look something like this:

https://mycompany.kayako.com/api/v1/insights/cases/metrics?start_at=2018-04-23T00:00:00.000Z&end_at=2018-04-29T23:59:59.999Z&previous_start_at=2018-04-16T00:00:00.000Z&previous_end_at=2018-04-22T23:59:59.999Z&interval=DAY&trial=false&include=*&fields=metric(name,value)


Note
: In case you also encounter an AUTHENTICATION_LOCKED error by using Basic Auth, please make sure your account username and password are correct. If they are, as a workaround, try adding a &_session_id argument at the end, as shown in the example below:
 

https://mycompany.kayako.com/api/v1/insights/cases/metrics?start_at=2018-04-23T00:00:00.000Z&end_at=2018-04-29T23:59:59.999Z&previous_start_at=2018-04-16T00:00:00.000Z&previous_end_at=2018-04-22T23:59:59.999Z&interval=DAY&trial=false&include=*&fields=metric(name,value)&_session_id=R6sO5GEedW0NLhrDd46659a751e2b41a02008b4271d5ed44660bb3ef1CYLvDVirR


Another scenario with a similar issue could be when trying to find a user by email with the Retrieve smart lists of users API call, which, if not configured adequately, will generate the same error as before. Following the same process as before, you will need to build your URL similar to the one below to make the API request retrieve the data you need:

https://mycompany.kayako.com/api/v1/users/filter?fields=data(full_name)

 In this example, we are instructing Kayako to fetch the user using the full name, with user role defined as 'customer.'

Choose files or drag and drop files
Was this article helpful?
Yes
No
  1. ATLAS

  2. Posted

Comments