The GID SDK for php is providing a wrapper for the
/public/v1/image (profile Image API) that simplifies all the work to integrate with.
This means that you don’t need to perform API calls or manage authentication tokens if you want to embed the Profile picture. The SDK will do everything for you. The following examples will show you how to render the actual profile image URL of any user. If the user haven’t uploaded a profile image, the default profile image is returned.
Example 1: get Profile picture of logged user:
With this usage, you can get the profile image of logged user, notice that you have previously to get the Object ID of the logged User
$userid = UserApi::getUserLoggedOid();
Example 2: get Profile picture of a user that is NOT logged:
If you have previously stored the object ID of the user, you can pass it to show the Profile picture of not logged users:
Example 3: get a 100px width profile picture of a logged user
Find below how your entire page should be. The profile picture API returns a 150px image by default, but you can customize your prefered size. The example is rendering the URL of the profile picture with 100px width.