Jump to content

API return error code 1708 (wrong parameter): which one?


Recommended Posts

Trying to create a record on FMS18 using its API, sometime I get an error response: {"messages":[{"code":"1708","message":"Parameter value is invalid"}],"response":{}}

I know what this means, but i wonder if there is a way to get back from FMS, with the error message, which parameter (field) is the culprit.

I am pretty sure that, having to deal with US and European date format, my seldom error depends on this. But the error message is so vague...

Thanks

Link to post
Share on other sites

At first glance it doesn't strike me as a field-data issue, The 1700 series of errors have to do with the request itself, not with the content of the payload.  It sounds to me that the request is sometimes adding a URL parameter that is not expected.  Since the 'create record' call is a POST there shouldn't be any URL parameters.

Have you checked the Data API log on FMS?

Link to post
Share on other sites

Ok, I found the problem.

One of the parameter, that would go in a FM text field of the new created record, trows the error response if it is true, as boolean, or even "true" as text, because in the json conversion wasn't inserted in between quotes. Changing it to 1 or 0 or else, doesn't return the error anymore.

Just for completeness, I am creating new FM records from an external environment, in LiveCode.

I can easily solve this particular problem but this wasn't my point:

Is it possibile to find out which parameter or wrong field name or missing field in the destination layout, returns an error from FMS?

Link to post
Share on other sites

Short answer, no.

If you try to push data to a validated field for instance you'll get the message but not what field:

{
    "messages": [
        {
            "code""503",
            "message""Value in field is not within the range specified in validation entry options"
        }
    ],
    "response": {}
}
 
What you can do however is to use the metadata endpoint for your target layout and get the data types and validation rules for each field on it, so that you can vet your data against them before sending it over.
Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.