Skip to content

Latest commit

 

History

History
33 lines (18 loc) · 1.48 KB

Examples.md

File metadata and controls

33 lines (18 loc) · 1.48 KB

Sonic Server Example

The SonicServerExample.php demonstrates a very basic implementation of a Sonic Platform. Requests to the Sonic API's endpoint are redirected to this file using Apache's ModRewrite (see .htaccess).

The code first parses the request's path into variables, then reads the SocialRecord examples from the data folder before initializing the Sonic class.

For simplicity, only requests for a user "Alice" are handled and only requests for the resources LIKE and PROFILE are implemented.

Sonic Client Example

The SonicClientExample.php demonstrates the use of the Sonic SDK for consuming a Sonic Platform's REST interface.

The code first reads the SocialRecord examples from the data folder before initializing the Sonic class.

For simplicity, only two requests (GET PROFILE and POST LIKE) are performed by the code.

API Examples

Simple examples demonstrating how to use the request builders to request or send data in the Sonic federation.

Create Social Record Example

Simple example how to use SocialRecordBuilder and SocialRecordManager to create, upload, and retrieve Social Records.