Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
Requirements for a valid API request
For making an API request to the SocialHub Publisher API you must provide the following data as query in the URL:
It is also required to send a application/json request content when making a HTTP POST or PUT request.
Generating a signature
A request signature is a SHA1-hash consisting of
- HTTP method
- Request URI (without query string)
- Raw request content
- App Secret Key as hashing-key
Example PHP code:
// The HTTP method.
$body = $request->getMethod() . '&';
// Request URI (without query string)
$body .= substr($request->getUri(), 0, strpos($request->getUri(), '?'));
// Raw, serialized request content
$body .= $request->getContent();
// Generating the signature SHA1-hash with the App Secret key as hashing-key.
$signature = hash_hmac('sha1', $body, $app_secret_key, FALSE);