3 Replies Latest reply on Sep 18, 2017 10:58 PM by niharika1108

    POST /places/{placeID}/avatar


      I'm using the Jive API to create a group (which is working fine). Once the group js created, I want to set the Avatar, but it's not working. I get the message Invalid image URI null with a return code of 400 (Bad Request, the URI is malformed)


      I'm following the information at Jive REST Rest API v3.7 → Place service


      I'm assuming that either the field is not actually uri (as indicated by the documentation) or something additional is missing.


      This is the section of PHP code I'm using. The $id contains the placeID (from the create).


      Has anyone got this working? If so, could they indicate where I've gone wrong. Thanks


        $avatar = array("uri" => "http://stax.causeway.com/images/Minion.png");


        $data = json_encode($avatar);


        $ch = curl_init($instanceURL . $apiURI . "/places/$id/avatar");

        curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);

        curl_setopt($ch, CURLOPT_CONNECTTIMEOUT, 5);

        curl_setopt($ch, CURLOPT_HTTPHEADER, array("Authorization: Bearer $accessToken", "Content-Type: application/json"));

        curl_setopt($ch, CURLOPT_POSTFIELDS, $data);

        curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false); // Don't worry if using SSL (https) and the certificate can not be verified


        $response = curl_exec($ch);

        $httpcode = curl_getinfo($ch, CURLINFO_HTTP_CODE);