Using the API in php

Thank you! I must of assumed JSON was like XML. The url that got the stacktrace was omeka-s/api. And the @language tip is very helpful. I was using the value table as a guide. So like this; ?

{
	"dcterms:spaital": [{
		"type": "literal",
		"@language": "en-CA",
		"property_id": 40,
                "@value": "Canada"
	}, {
		"type": "literal",
		"@language": "en-CA",
		"property_id": 40,
		"@value": "Canada - Ontario - Niagara Falls"
	}]
}

I ended up using php arrays anyway, so this is what json_encode() comes up with from this inside an item array that stores all the properties;

[dcterms:spaital] => Array
        (
            [0] => Array
                (
                    [type] => literal
                    [@language] => en-CA
                    [property_id] => 40
                    [@value] => Canada
                )

            [1] => Array
                (
                    [type] => literal
                    [@language] => en-CA
                    [property_id] => 40
                    [@value] => Canada - Ontario - Niagara Falls
                )

        )

Also if you know where I should start to authenticate properly that would also be a big help. I saw on this post you add it to the url like so ‘omeka-s/api/items?key_identity=blahBlah$key_credential=yadaYadaYada’