DevHub API Documentation
  • Introduction
  • Authentication
  • Errors
  • Getting started guides
    • Business-focused Sites
    • Location-focused Sites
    • Location pages and store locator with custom theme
    • Site publishing with site builder access
  • Code examples
    • Python
    • PHP
    • Perl
  • Best practices
    • Our unique IDs, versus yours
    • State and country codes
  • Core Resources
    • Sites
    • Businesses
    • Locations
    • Domains
    • Proxies
  • Content Resources
    • Pages
    • Content
    • Images
    • Files
    • Modules
    • Plugins
    • Themes
  • Logging and analytics
    • Analytics
    • Contact Logs
  • Single Sign On (SSO)
    • Introduction
    • Assigning a site's user
  • Live Preview API
    • What is the Live Preview API?
  • Advanced
    • Domain aliases
    • Language codes
    • Projects
    • Site Check
    • Traces
    • Webmail
  • Local Storage API
    • What is the Local Storage API?
  • Headless CMS
    • Locations search
  • Visitor Localization SDK
    • Visitor Localization SDK
Powered by GitBook
On this page
  • GET request
  • POST request

Was this helpful?

  1. Code examples

PHP

GET request

<?php

$oauth = new OAuth('PROVIDEDKEYHERE', 'PROVIDEDSECRETHERE', OAUTH_SIG_METHOD_HMACSHA1);
$oauth->fetch('/api/v2/sites/');
$content = $oauth->getLastResponse();

?>

POST request

<?php

$params = array(
    'domain' => 'somebusinessname.com',
    ...
);
$body = json_encode($params);
$oauth = new OAuth('PROVIDEDKEYHERE', 'PROVIDEDSECRETHERE', OAUTH_SIG_METHOD_HMACSHA1);
$oauth->fetch('/api/v2/sites/', $body, 'POST', array('Content-Type' => 'application/json'));
$content = $oauth->getLastResponse();

?>
PreviousPythonNextPerl

Last updated 6 years ago

Was this helpful?