AnsweredAssumed Answered

Admin API returns booleans as strings

Question asked by mdenyse on Jun 13, 2018
Latest reply on Jun 14, 2018 by beverly

Has anyone noticed that the Admin API is returning Boolean values as strings in the JSON response? With your typical PHP json_decode() call, json_decode() isn't going to convert this to a Boolean, so if your code is testing for a Boolean you're in for a rude awakening. This has never come up with the Data API as I don't think anything ever gets returned as a Boolean from the API directly.

 

Here's the actual data returned from a 'List Schedules' call:

{

  "result": 0,

  "schedules": [

    {

      "backupType": {

        "backupTarget": "filemac:/Macintosh HD/Library/FileMaker Server/Data/Backups/",

        "clone": "false",

        "fromTarget": "All Databases",

        "maxBackups": 1,

        "target": 2,

        "verify": "false"

      },

      "dailyDays": 1,

      "daysOfTheWeek": "0000000",

      "daysOfTheWeekDetails": "",

      "emailAddresses": "",

      "enableEndDate": "false",

      "enabled": "false",

      "freqType": 1,

      "id": "2",

      "lastError": 0,

      "name": "My Schedule #1 (Once)",

      "repeatFrequency": 10,

      "repeatInterval": 1,

      "repeatTask": "false",

      "sendEmail": "false",

      "startDate": "2018-06-05 21:55:00",

      "status": 1,

      "taskType": "BACKUP"

    }

  ]

}

 

So, is this a bug or a feature?

 

Also, is the Admin API data metered? The output from the API is pretty printed, so if true we're literally paying for spaces and line breaks...

Outcomes