rafaelmaeuer
2/16/2017 - 4:09 PM

Insert PHP variables into a JSON string - From http://stackoverflow.com/questions/2256307/can-i-insert-php-variables-into-a-json-string

$requestBody = '

{
    "attribute": {
        "@id": "' . $id . '",
        "@uri": "' . $uri . '",
        "person": {
            "@id": "222",
            "@uri": "https://api_name_removed.com/v1/People/222"
        },
        "attributeGroup": {
            "@id": "",
            "@uri": "",
            "name": null,
            "attribute": {
                "@id": "2404",
                "@uri": "",
                "name": null
            }
        },
        "lastUpdatedDate": null
    }
}';