Forums

Bug in Json API

The format of person.access_permissions, school_grade or locations isn't as in the documented format. 

The document specifies that each should be in a simple string array, whereas I'm getting various json objects back.


The three that I've listed are only the ones I've tried to use, but it seems that it might be an issue with all fields reported to be "string|array".


For completeness, here is some json I received that illustrates the issue:

This was snipped from people/getAll.json

{

            "id": "ed49ea2e-40f3-11e3-963d-e9c9319b7782",

            "date_added": "2013-10-29 23:43:35",

            "date_modified": "2013-10-29 23:55:34",

            "category_id": "90442e72-f3f3-11e2-9ed5-188c76acf9db",

            "firstname": "Greg",

            "preferred_name": "",

            "lastname": "Owens",

            "email": "greg.owens@me.com",

            "phone": "",

            "mobile": "",

            "admin": 0,

            "contact": 0,

            "archived": 0,

            "deceased": 0,

            "volunteer": 1,

            "status": "Active",

            "username": "greg.owens",

            "last_login": "2013-10-29 23:44:53",

            "country": "",

            "timezone": "",

            "picture": "https:\/\/secure.gravatar.com\/avatar\/8d8b21d82b2435885af0ea90d630cb4c\/?default=https%3A%2F%2Fd5w68ic4qi8w5.cloudfront.net%2Fimg%2Fdefault_gravatar.png&size=200&rating=G",

            "family_id": "",

            "family_relationship": "Other",

            "access_permissions": {

                "access_permission": [{

                    "id": "9043b032-f3f3-11e2-9ed5-188c76acf9db",

                    "name": "Admins"

                },

                {

                    "id": "90430fe2-f3f3-11e2-9ed5-188c76acf9db",

                    "name": "Members"

                }]

            },

            "departments": [],

            "service_types": [],

            "demographics": [],

            "locations": [],

            "family": [],

            "anniversary": "",

            "birthday": "",

            "development_child": "No",

            "gender": "",

            "giving_number": "",

            "home_address": "",

            "home_address2": "",

            "home_city": "",

            "home_country": "",

            "home_postcode": "",

            "home_state": "",

            "mailing_address": "",

            "mailing_address2": "",

            "mailing_city": "",

            "mailing_country": "",

            "mailing_postcode": "",

            "mailing_state": "",

            "marital_status": "Married",

            "receipt_name": "",

            "reports_to": "",

            "school_grade": {

                "id": "9051b682-f3f3-11e2-9ed5-188c76acf9db",

                "name": "12"

            },

            "security_code": "",

            "special_needs_child": "No"

        }

Hi David.


Thanks for the post.


The documentation for the field information is the data type for the request, not the response. 


Hope this clears things up a bit.


Stewart

Fair enough. 

What IS the format for the response? Do all string|array fields the same response?

Hi David


For the most part, the Response will be a JSON object, typically with an ID and Name, depending on the particular field that is being requested. We're going to look at adding correct documentation for the Request type and Response type over the next few weeks. 


Stewart

Thanks so much Stewart.

Here's something else: these fields will either be an array if they are null but an object if they aren't. I didn't mention it before because I couldn't find it again. 


 This is a snipped version of a groups/getAll.json

"group":[
    {
        "id":"0f75fe92-8a2f-11e3-9edb-094b5ffbcb0b",
        "departments":{"department":[{"id":"904ce88c-f3f3-11e2-9ed5-188c76acf9db",
            "name":"Worship Team",
            "sub_departments":{"sub_department":[{"id":"904d3cf6-f3f3-11e2-9ed5-188c76acf9db",
                "name":"Instruments"},
            {"id":"904e4132-f3f3-11e2-9ed5-188c76acf9db",
                "name":"Vocals"}]}}]},
    {
        "id":"c218c75a-4a83-11e3-963d-e9c9319b7782",
        "departments":[],
    }
]

 


Login or Signup to post a comment