cloudesire documentation

cloudesire documentation

  • Docs
  • API
  • Syndication
  • Glossary
  • Back to cloudesire.com

›API

Platform

  • Home
  • Platform modules
  • Glossary
  • Users and permissions
  • Billing
  • Event notification
  • Channel management
  • Live reporting
  • Orders approval workflow
  • Vendors approval workflow
  • Customer Cloud Credentials
  • Cloud providers
  • Email automation
  • Marketplace customization
  • Integrations
  • Tech Radar
  • Open Source
  • GDPR Compliance

Products Onboarding

  • Onboarding a new product
  • Product types

    • Syndicated applications
    • Cloud Services
    • Virtual-Machines
    • Services
  • Pricing Plans
  • Pricing models
  • Extra Resources
  • Order validation
  • External configuration parameter values

Available Integrations

  • vCloud VDC
  • OpenStack VDC
  • OKD projects
  • Commvault tenants
  • vCloud Availability tenants
  • Public Cloud Tenants
  • Kubernetes as a service
  • Helm charts
  • Google Workspace
  • Microsoft CSP
  • API as a Service
  • Keycloak

API

  • REST API Introduction
  • Java Client
  • TypeScript Client
  • PHP Client
  • API Reference
Edit

PHP Client for Cloudesire API

If you are a vendor looking to integrate the syndicated provisioning progress, or just call the Cloudesire API from PHP, this page is for you.

The simplest way to interact with a REST API in PHP is leveraging the sendgrid/php-http-client.

To install the library, please take a look at the following upstream documentation:

  • Requirements
  • Install with Composer
  • Install without Composer

A full example is available here.

Instantiate the client

To obtain an authenticated client you need to provide the URL of the Cloudesire API ($api_url) and a permanent authentication token ($token).

Avoid hard-coding those parameters, use environment variables or .ini files.

<?php
require __DIR__ . '/vendor/autoload.php';

$api_url = getenv('CLOUDESIRE_URL');
$token = getenv('CLOUDESIRE_TOKEN');
$headers = ['CMW-Auth-Token:' . $token];
$client = new SendGrid\Client($api_url, $headers);

Fetch subscription data

Every time you receive a syndication event, you need to fetch an updated view of the specific subscription resource.

$subscriptionId = 20000;
$response = $client->subscription()->_($subscriptionId)->get();
$subscription = json_decode($response->body(), true);

Set subscription endpoints

When the provisioning has been completed on your side, you need to provide the end-user endpoints to access your application.

$endpoints = [
    [
        'endpoint'    => 'https://www.yourapp.com/login',
        'description' => 'Login Page',
        'category'    => 'APP'
    ]
];
$response = $client->subscription()->_($subscriptionId)->endpoints()->post($endpoints);

Provide end-user instructions

Along with the end-user endpoints, you can provide textual instructions to the end-user.

$instructions = [
    'en' => 'Demo English Instructions',
    'it' => 'Istruzioni esemplificative in italiano'
];
$response = $client->subscription()->_($subscriptionId)->instructions()->post($instructions);

Set subscription deployment status to DEPLOYED

Once endpoints and end-user instructions, you can set the subscription deployment status to completed.

$requestBody = [
    'deploymentStatus' => 'DEPLOYED'
];
$response = $client->subscription()->_($subscriptionId)->patch($requestBody);

Set subscription deployment status to UNDEPLOYED

When the subscription expires, you need to forbid user to access your application and confirm the undeployment of the subscription.

$requestBody = [
    'deploymentStatus' => 'UNDEPLOYED'
];
$response = $client->subscription()->_($subscriptionId)->patch($requestBody);
Last updated by Giovanni Toraldo
← TypeScript ClientAPI Reference →
  • Instantiate the client
  • Fetch subscription data
  • Set subscription endpoints
  • Provide end-user instructions
  • Set subscription deployment status to DEPLOYED
  • Set subscription deployment status to UNDEPLOYED
Pages
Documentation IndexAPI ReferencePlatform modulesOpen SourceCorporate website
Social
TwitterFacebookGitHub
Copyright © 2025 Cloudesire.com by Engineering D.HUB