PHP SDK for Organic Platform API Integration
You need an account with Organic in order to connect to the API. If you are interested enhancing your digital media with the power of Organic, please contact Organic sales.
You can retrieve your API key from inside the Organic dashboard, under Documentation > Wordpress Plugin. Note that while the API key is often used for our plugins, it can also be used directly with the SDK here.
Also, almost all actions within the SDK are performed within the context of an individual website. To get the UUID of the website you want to work with, go to the Documentation > Code Snippet section of your dashboard. The UUID is a bit difficult to find at the moment, but you can see it in the config string highlighted here after you have selected the site:
Organic publishes a GraphQL API endpoint to communicate with. Basic connection works like this:
use Organic\SDK\SDK;
$apiKey = '__FROM_YOUR_DASHBOARD__';
$siteId = '__UUID_FOR_YOUR_WEBSITE__';
$sdk = new SDK( $siteId, $apiKey );
If you are using Organic Ads on your website and want to pull your managed ads.txt content, you can pull it using:
$myAdsTxt = $sdk->queryAdsTxt();