Connecting PHP on uCoz

PHP is a paid service, available in the “Optimal”, “Maximum”, and “Store” packages. Instructions for connecting PHP.

New authorization method via Bearer Token (recommended)

The new uAPI authorization method via Bearer Token does not require a PHP module. Read more about setting up on the "Getting Started" page.

Old authorization method OAuth 1.0a (obsolete, requires PHP module)

PHP module for uAPI. Version 2.5 dated February 20, 2019.

Download module

Module setup

Before using the module, you must set connection settings in the file uAPImodule.php:

Site address

$myWebsite = 'http://ucoz.ucoz.ru/';

Indicate the URL of your site on uCoz to access uAPI.

Please note:
  • URL must end with /
  • If your site has its own domain attached, please indicate it.
  • If the site is accessible via www, indicate the address along with www.

Examples:

$myWebsite = 'http://www.mywebsite.ucoz.ru/';
$myWebsite = 'http://www.mywebsite.com/';

Authorization parameters

oauth_consumer_key

Consumer Key - application key issued during registration in uAPI panel.

oauth_consumer_secret

Consumer Secret - application secret key. Used to generate a request signature.

oauth_token

OAuth Token - access token received after authorizing the application on the site.

oauth_token_secret

OAuth Token Secret - token secret. Used in conjunction with oauth_consumer_secret to sign requests.

Request method

The parameter defines the HTTP method used when accessing the API:

get | post | put | delete

The choice of method depends on the specific uAPI endpoint. Valid methods for each request are listed in the documentation.