Skip to main content

Integration API Reference

Cloudike PAYG integration documentation provides a comprehensive guide for customers to connect their systems with Cloudike's platform, enabling seamless authentication, subscription management, and SMS notifications.

Definitions​

The main subjects involved in the cross-integrations are described below:

TermDescription
Cloudike PAYG (or Cloudike)Cloudike PAYG (Pay-As-You-Go) is a universal software platform owned by Cloudike Inc. and hosted on its Amazon AWS account. The platform is designed to launch various projects for different Customers, enabling them to provide cloud services to their end users.
CustomerA company that has contracted with Cloudike Inc. and uses Cloudike PAYG resources to provision its users.
Customer Core SystemThe Customer Core System (hereafter referred to as Customer's System) is an infrastructure of the specific Customer that is located on the Customer's hardware resources (i.e., outside of Cloudike PAYG). It can be integrated with Cloudike PAYG's infrastructure via the Internet.
UserAn end user of Cloudike PAYG who belongs to a specific Customer (and hence to a specific Tenant).
TenantA tenant is an isolated entity in the Cloudike PAYG platform created for a specific Customer. The concept of a tenant includes: - Private tenant settings (e.g., name, description, logo, project domain, various Customer's System endpoints, etc.) - Customer's Users - A set of Packages
PackageA product that includes Cloudike's cloud disk quota and can be purchased by Users.
SubscriptionA Package that has been activated for a specific User.

User Authentication Procedure​

All Cloudike PAYG apps (web, Android and iOS) and all tenants use the same authentication method.

The first API method is used by clients when the user first launches the client. This API method provides a list of all tenants available to end users on the Platform.

During the first launch, the user must select a Tenant (i.e., project) they wish to register or log into.

  • The API method accepts the user's phone number (optional parameter) as input.
  • As output, the server returns a list of tenants recommended for this phone number.
  • Recommendation logic can be implemented by analyzing:
    • The phone number's country prefix
    • The source IP address of the requesting client
    • The domain entered by the user in the browser (for web clients)

If no phone number is provided, the method will return an array with all tenants available on the Platform.

The second API method is used to retrieve the public Privacy Policy content of the selected Tenant. The third API method signs the user up or in.

GET https://payg.cloudike.com/api/3/tenants/

Request Parameters​

ParameterTypeRequiredDescription
phonestringOptionalIf provided, the system will return a sublist of a few recommended tenants.

Output​

Returns an array of tenants with the following fields:

FieldTypeDescription
tenant_namestringThe name of the tenant (i.e., internal ID).
frontend_urlstringA web link to the public frontend.
titlestringA human-readable name of the tenant.
descriptionstringA brief summary of the project.
logo_urlstringA URL to the tenant's logo.
available_langsstringA list of languages available for the tenant.

Response Codes​

CodeDescription
200 OKThe request was successful.

Example Response (JSON)​

{
"_embedded": {
"tenants": [
{
"tenant_name": "star",
"title": "StarCloud",
"frontend_url": "https://starcloud.example.com/",
"description": "The solution for backing up your best moments",
"logo_url": "https://starcloud.example.com/assets/logo.svg",
"available_langs": "en, kk",
"_links": {
"self": {
"href": "https://payg.cloudike.com/api/3/tenants/101/"
}
}
},
{
"tenant_name": "ice",
"title": "IceCloud",
"frontend_url": "https://icecloud.example.com/",
"description": "Secure storage for your files and documents",
"logo_url": "https://domain.ice/ice-logo.svg",
"available_langs": "en, id",
"_links": {
"self": {
"href": "https://payg.cloudike.com/api/3/tenants/167/"
}
}
}
]
}
}

Get the "Privacy Policy" Document of the Tenant​

GET https://payg.cloudike.com/api/3/offers/

Request Parameters​

ParameterTypeRequiredDescription
offsetnumberNoThe starting position of the returned list.
limitnumberNoThe number of results to return.
tenant_namestringYesThe Tenant's name.
typestringYesThe required offer's code. Use "privacy_policy".
langstringYesThe language code of the offer (e.g., "en").

API documentation of the method: https://be-saas.cloudike.com/backend_docs/rest/api/3/core_pkg/offers_app/Offers/index.html

Example Request​

GET https://payg.cloudike.com/api/3/offers/?offset=0&limit=2&tenant_name=star_cloud&type=privacy_policy&lang=en

Response Codes​

CodeDescription
200 OKThe request was successful.

Example Response (JSON)​

{
"_links": {
"self": {
"href": "https://payg.cloudike.com/api/3/offers/"
},
"next": {
"href": "https://payg.cloudike.com/api/3/offers/?limit=2&offset=2"
}
},
"_embedded": {
"offers": [
{
"created": "2025-02-14T13:01:57.117000+00:00",
"updated": "2025-02-14T13:01:57.117000+00:00",
"id": "67af3ec589695ea21a9ef830",
"tenant_name": "star_cloud",
"type": "privacy_policy",
"lang": "en",
"url": "",
"_links": {
"self": {
"href": "https://payg.cloudike.com/api/3/offers/67af3ec589695ea21a9ef830/"
},
"content": {
"href": "https://payg.cloudike.com/api/3/offers/67af3ec589695ea21a9ef830/content/"
},
"offer_view": {
"href": "https://payg.cloudike.com/offers/67af3ec589695ea21a9ef830"
}
}
}
]
}
}

Notes​

The _embedded → offers field contains the array of offers. Each offer contains two useful fields:

  • _links → content contains a link to download the offer content, which is formatted with HTML markup.

    • The URL could be used to insert the content into an HTML page.
  • _links → offer_view contains a link to the web frontend's view page, which would display the offer as a separate HTML page.

Method of User Authentication (Sign-up/Sign-in)​

POST https://payg.cloudike.com/api/3/tenants/<tenant_name>/payg/phone_otp_auth_tokens/

Request Parameters​

ParameterTypeRequiredDescription
long_livedbooleanNoBy default False. Set to True to create long-lived tokens for mobile apps.
device_descriptionstringNo (if long_lived=True)Description of the device.
phonestringYesThe user's phone number.
actionstringYesOne of "login" or "reg".
sms_otpstringYesOne-time password (OTP) sent via SMS (e.g., "12345").

Output Parameters​

ParameterTypeDescription
idstringID of the created authentication token.
client_typestringType of client.
device_descriptionstringTaken from the input parameter.
createdstringTimestamp of token creation (ISO 8601 format).
expiresstringExpiration time of the token (ISO 8601 format).
last_activitystringTime of last account activity (ISO 8601 format).
user_idnumberCloudike user account unique ID.
tenant_namestringTenant where the user's account belongs.
tokenstringSession token (secret).
user_createdbooleanTrue if a new user account was created during authentication.

Response Codes​

  • 201 Created – Token successfully created.
{
"id": "Z6Mk8BqiYtZ6Ffpd",
"client_type": "android-client",
"client_version": "1.2.0",
"device_description": "Android 10",
"created": "2025-02-05T08:44:32.229000+00:00",
"expires": "2025-03-08T08:44:32.229000+00:00",
"last_activity": null,
"user_id": 55651,
"tenant_name": "project_123",
"secret": "Zt0q3CAcQg6OKMZwcGbtAQ",
"token": "Z6Lk8BqiYtZ6Ffpd:Zt0q3CAcQb6OKMZwcGbtAQ",
"user_created": false,
"_links": {
"self": { "href": "https://payg.cloudike.com/api/3/users/55651/tokens/Z6Mk8BqiYtZ6Ffpd/" },
"user": { "href": "https://payg.cloudike.com/api/3/users/55651/" },
"credential": { "href": "https://payg.cloudike.com/api/3/users/55651/credentials/67a324ef1aa262d67a15fa4b/" },
}
}
  • 422 ValidationError – Incorrect or missing input parameters. Usually requires additional parameters; check the body for specific required fields:
    • input OTP required
    • incorrect OTP was inputted
{
"code": "ValidationError",
"description": "The request has wrong parameters.",
"detail": {
"sms_otp": "Required",
"password": "Required"
}
}
  • 429 TooManyIncorrectAttempts – Too many incorrect attempts; temporary block applied. The response contains the number of seconds until the block ends.

HTTP Headers​

Retry-After: 59

Response Body​

{
"code": "TooManyIncorrectAttempts",
"description": "The action could not be performed because there were too many incorrect attempts by the client. Try again after a while.",
"detail": {
"retry_after": 59
}
}

SMS Notifications Sent to the User​

We have two options for sending SMS notifications:

  1. Customer provides Cloudike PAYG with an endpoint to the standard SMPP protocol interface.
  2. Customer implements the REST API as described below.

REST API for Sending SMS​

POST https://smsgate.customer.com/send-sms

HTTP Headers​

  • Authorization: Bearer JWT
  • Content-type: application/json

Request Parameters​

ParameterTypeRequiredDescription
msisdnnumberYesRecipient's phone number.
messagestringYesMessage text.

Response Codes​

HTTP CodeDescription
200 OKMessage was successfully sent.
400 Bad RequestIncorrect request format. The platform will not retry the message.
422 Unprocessable EntityInvalid phone number or message text (too long/invalid). The platform will not retry the message.
429 Too Many RequestsToo many requests were sent. The platform will retry the message later.
5xx Server ErrorsSMSGate is temporarily down. The platform will retry the message.

Example Request​

POST https://smsgate.customer.com/send-sms

HTTP Headers​

  • Authorization: Bearer JWT
  • Content-type: application/json

Request Body​

{
"msisdn": 123456789012,
"message": "12345 is your sign-in code for StarCloud"
}

User Subscriptions Management​

Subscription Model and Concepts​

Cloudike PAYG platform provides a specific set of packages tailored to each Customer. The tenant's packages are available for subscription by tenant's users.

Cloudike's package model has the following fields:

Field NameTypeDescription
idstringUnique ID of the package.
customer_product_idstringUnique ID of package from Customer's side.
namestringHuman-readable name of the package.
costnumberThe package's cost for one period, in the natural number of minor currency units (i.e. “cents”). Can be 0, in this case the subscription is free for user. Cloudike still requests purchase approval from Customer's side by calling /purchase_package_approve.
cost_scalenumberBy default, it is 100. This represents the number of minor currency units (“cents”) in one major currency unit (“dollar”).
currencystringThe currency's code, from ISO 4217.
sizenumberThe amount of storage provided by subscription to the user's quota (in bytes).
durationnumberThe number of period_type time periods included in the pre-paid period. Can be 0, that means the end-less pre-paid period (one-time purchase, not a subscription), Cloudike will never do auto-renewal tries for such package.
period_typestringThere are four variants: hour, day, month, year.
is_defaultbooleanWhether it is the default package or not. The default package can only exist once. If it exists, it is automatically purchased by the system for the user when they get a 0 quota.
is_enabledbooleanWhether the package is enabled or disabled. The system does not allow users to subscribe to a disabled package.
is_visiblebooleanWhether the package is displayed in Cloudike's applications and allowed for user's self-purchasing. The packages with is_visible=false parameters will not be displayed and allowed to purchase in the apps. Such packages could be subscribed only by MO request from Customer's side.
tenant_namestringAssigning the package to a specific Customer based on their tenant name.
descriptionstringAn internal brief summary (not visible to end users).
discount.is_enabledbooleanWhether the package's discount is enabled or disabled.
discount.costnumberThe package's cost for one period during the discount period.
discount.period_typestringDiscount's period type (hour, day, month or year).
discount.durationnumberDuration of discount periods.

Subscription Rules​

Cloudike's end users initially have a 0 GB disk quota. Users cannot use Cloudike cloud functions with a 0 GB quota. To upload any data to the cloud, a positive disk quota (>0 GB) is required.

Subscription Mechanism​

  • Packages are required for incremental increases in the user's disk quota.
  • Packages can be purchased by users either in Cloudike apps or via MO requests from the Customer's System.
  • A successful package purchase results in an active subscription.
  • A user can have either no active subscription or only one active subscription at a time.
    • Users cannot have two or more active subscriptions simultaneously.

Upgrade & Downgrade Subscription Rules​

If a user has an active subscription and orders another subscription:

  1. If the new subscription has a larger size, Cloudike will activate it, canceling the old subscription immediately.
  2. If the new subscription has a smaller or equal size, the system will block the change.

Subscription Cancellation​

A User or Customer's System can initiate the cancellation of an active subscription.

  • Cancellation means:
    • Auto-prolongation stops.
    • The subscription remains active until the end of the current pre-paid period.
    • Once the pre-paid period expires, the subscription is automatically closed.

Default Package​

  • A default package is optional. Cloudike sets one up if the Customer asks for it.
  • A tenant can have only one default package.
  • Default package behavior:
    • Cloudike tries to purchase it automatically for every new user account.
    • Cloudike tries to purchase it again when a user loses their active subscription and their quota drops to 0 GB.
    • It can be free (cost = 0) or paid, depending on the Customer's preference.
  • If the tenant has no default package, or its purchase is not approved, the user's quota stays at 0 GB.

Subscription Approval​

  • Subscription to any package requires approval from the Customer's System.
  • Unsubscribing does not require approval, but Cloudike notifies the Customer's system about any such event.

Subscription Renewal​

  • For each package, Cloudike and the Customer agree before the package is created who renews it: Cloudike or the Customer's billing.
  • Packages renewed by the Customer's billing: the Customer's System doesn't send renewal requests, and there is no grace period. The subscription stays active until the Customer's System unsubscribes the user.
  • Packages renewed by Cloudike:
    • When the paid period ends, Cloudike asks the Customer's System to approve the renewal by calling /purchase_package_approve with "action": "renew".
    • If the renewal is not approved, the subscription enters a renewal grace period. The subscription stays active during the renewal grace period.
    • The renewal grace period has two parts, both set in days for each package:
      • Paid grace period. Comes first and is paid for by the Customer. It is optional: 0 days means there is no paid grace period.
      • Free grace period. Comes next and is provided by Cloudike. It is 2 days by default and can be changed by agreement, down to 0 days.
    • During the whole renewal grace period, Cloudike retries the renewal about every 8 hours (3 times a day).
    • If the renewal is still not approved when both grace periods end, the subscription is canceled.
    • Cloudike doesn't notify the Customer's System when the renewal grace period starts. The subscription_renewed event is sent only after a successful renewal.

Account Deletion at 0 GB Quota​

This is separate from the renewal grace period.

  • If a user's quota drops to 0 GB, for example because the subscription was canceled and the default package was not purchased, a 7-day deletion period begins.
  • During these 7 days, Cloudike sends daily SMS notifications about the upcoming removal of the account and its data.
  • If the user still has no package after 7 days, Cloudike deletes the user account and all associated data.

Customer's System API​

User's Subscription Approval​

Cloudike will call the Customer API to approve actions related to user subscriptions, such as:

  • Creation of a new subscription
  • Renewal (prolongation) of an already active subscription, for packages renewed by Cloudike

POST https://customer.com/purchase_package_approve

HTTP Headers​

  • Authorization: Bearer JWT
  • Content-Type: application/json

Request Parameters​

ParameterTypeRequiredDescription
msisdnnumberno1User's phone number (MSISDN).
emailstringno1User's email.
package_idstringno2Unique package ID in Cloudike system.
customer_product_idstringno2Unique package ID on Customer's side.
actionstringyes"create" (new subscription) or "renew" (subscription prolongation).
costnumberyesSubscription cost in minor currency units (e.g., cents).
cost_scalenumberyesScale factor (default: 100, e.g., cents per dollar).
currencystringyesCurrency code (ISO 4217 format).
trx_idstringyesUnique transaction ID (max length: 100 bytes, UUID v4 recommended).

Response Codes​

HTTP CodeDescription
200 OKCustomer's billing processed the request in real time (the charge was approved or declined). Return the result in the JSON body:
{
"action": "approved"
}

or

{
"action": "declined"
}
HTTP CodeDescription
202 AcceptedRequest was successfully accepted by Customer's billing, queued, and will be processed asynchronously. Once billing processes the request (i.e., charges the user), it must send a callback to Cloudike's backend with the result by calling the corresponding method.

Optionally, the Customer's billing can return a web page URL to redirect the user to, for example to choose a payment method or enter card details.

In the JSON body:
{
"approval_page": "https://domain.com/page/to/be/displayed/for/user"
}
HTTP CodeDescription
400 Bad RequestIncorrect format of request. No retries required.
422 Unprocessable EntityInvalid msisdn, package_id, or other parameters. No retries required.
429 Too Many RequestsToo many requests sent. The sender can retry later.
5xx Server ErrorsWeb service is temporarily broken. The sender can retry later.

Cloudike's Side API​

Create or Delete a User Subscription​

This is a low-level method for managing any user's subscriptions. This request is sent from the Customer's side to the Cloudike system.

The request is executed immediately and synchronously: it creates a new subscription or deletes an existing one for the user with the specified msisdn.

Creating a subscription:

  • The user is assumed to have already paid for the subscription; Cloudike does not send a charge request.
  • If no user with this MSISDN exists in Cloudike, a new user account is created when the request succeeds.
  • If the user already has this subscription, no duplicate is created.
  • If the user has another active subscription (with a different package_id), Cloudike cancels it first and then creates the new one: a user can have only one active subscription at a time.

Deleting a subscription:

  • The subscription is deleted immediately, even if its prepaid period has not ended.
  • If the user has no active subscription with this package_id, the request still succeeds (200 OK).

The idempotency_key parameter must be unique for each Customer's transaction; send the same value only when retrying the same request. It should be HEX of a randomly generated UUID version 7 value - 32 chars without hyphens in lower-case, for example e50e8400e29b41d4a7164266a544b301. Any other random 32-character string can also be used.

POST https://payg-provisioner.cloudike.com/provisioning-api/1/tenants/<tenant_name>/payg/subscription_changes/

HTTP Headers​

  • Authorization: Bearer JWT
  • Content-Type: application/json

Request Parameters​

ParameterTypeRequiredDescription
msisdnnumberno1User's phone number (MSISDN).
emailstringno1User's email.
package_idstringno2Unique package ID in Cloudike system.
customer_product_idstringno 2Customer's side package ID
actionstringyes"create" (to create new subscription of any package) or "delete" (to unsubscribe).
reasonstringnoEmpty by default. Any human readable text (for logging of operation), max 250 chars.
idempotency_keystringyesUnique transaction ID. It should be HEX of randomly generated UUID version 7 value - 32 chars without hyphens in lower-case. Example: 'e50e8400e29b41d4a7164266a544b301'. Any other random 32-character string can also be used.

Response Codes​

HTTP CodeDescription
200 OKRequest was successfully processed.
201 CreatedRequest was successfully processed.
400 Bad RequestIncorrect format of request. No retries required.
401 UnauthorizedInvalid secret was sent. No retries required.
422 Unprocessable EntityInvalid msisdn, package_id, action or other mandatory parameters. No retries required.
429 Too Many RequestsToo many requests sent. The sender can retry later.
5xx Server ErrorsWeb service is temporarily broken. The sender can retry later.

MO Request to Purchase a Package for the User​

This is an MO (Mobile Originated) message with a user's request sent from the Customer's side to the Cloudike system (as the content provider). The request invokes Cloudike to approve package purchase (by calling the /purchase_package_approve API from the previous section) and then (after callback receiving) to create a new subscription for the user.

Cloudike always calls the /purchase_package_approve method on Customer's side, even if the package cost is zero: the Customer must approve providing the package to the user.

This method can also be used to create a new user. If no user with such an MSISDN exists in Cloudike, the user will be created upon successful approval of the request.

To subscribe the user, set command to "subscribe". To stop a subscription, send "unsubscribe": auto-renewal stops, and the subscription ends when the current prepaid period expires. A subscription with a zero-length period ends immediately.

idempotency_key parameter should be unique for each call. It should be HEX of a randomly generated UUID version 7 value - 32 chars without hyphens in lower-case, for example e50e8400e29b41d4a7164266a544b301. Any other random 32-character string can also be used.

POST https://payg-provisioner.cloudike.com/provisioning-api/1/tenants/<tenant_name>/payg/subscription_change_requests/

HTTP Headers​

  • Authorization: Bearer JWT
  • Content-Type: application/json

Request Parameters​

ParameterTypeRequiredDescription
msisdnnumberno1User's phone number (MSISDN).
emailstringno1User's email.
package_idstringno2Unique package ID in Cloudike system.
customer_product_idstringno2Customer's side package ID
commandstringyes"subscribe" (subscribe to package) or "unsubscribe" (unsubscribe from package).
promo_codestringnoA promo code the user entered when subscribing. Cloudike passes it to the Customer's billing, for example to apply a discount.
idempotency_keystringyesUnique transaction ID. It should be HEX of randomly generated UUID version 7 value - 32 chars without hyphens in lower-case. Example: 'e50e8400e29b41d4a7164266a544b301'. Any other random 32-character string can also be used.

Response Codes​

HTTP CodeDescription
200 OKRequest was successfully accepted and will be processed.
201 CreatedRequest was successfully accepted and will be processed.
400 Bad RequestIncorrect format of request. No retries required.
401 UnauthorizedInvalid secret was sent. No retries required.
422 Unprocessable EntityInvalid msisdn, package_id, or other parameters. No retries required.
429 Too Many RequestsToo many requests sent. The sender can retry later.
5xx Server ErrorsWeb service is temporarily broken. The sender can retry later.

Confirm Delayed Request of Initial Subscribe or Renew​

Customer's billing should notify Cloudike of the result of a delayed purchasing process (previously initiated by the https://customer.com/purchase_package_approve method). The trx_id parameter must be exactly the same as in the initial /purchase_package_approve request.

In case of sending action='approved' parameter, Cloudike will

  • create subscription of the required package;
  • create new user account, if required;
  • send an SMS or email notification about the new subscription (depending on whether msisdn or email was used in the initial request).

In case of sending action='declined' parameter, Cloudike will do nothing.

POST https://payg-provisioner.cloudike.com/provisioning-api/1/tenants/<tenant_name>/payg/purchase_package_callbacks

HTTP Headers​

  • Authorization: Bearer JWT
  • Content-Type: application/json

Request Parameters​

ParameterTypeRequiredDescription
msisdnnumberno1User's phone number (MSISDN).
emailstringno1User's email.
package_idstringyesUnique package ID in Cloudike system.
customer_product_idstringnoUnique package ID on Customer's side.
actionstringyesOne of: "approved" or "declined"
trx_idstringyesUnique transaction ID (must match the one used in the original request)

Response Codes​

HTTP CodeDescription
200 OKRequest was successfully accepted.
401 UnauthorizedInvalid secret was sent. No retries required.
403 ForbiddenThe request was sent with an authentication token of another tenant.
422 Unprocessable EntityInvalid msisdn, package_id, or other mandatory parameters. No retries required.

If the callback is sent again with the same trx_id and the same parameters, Cloudike returns the same response as for the first request (200 OK).

Port-out Notification for the User​

The Customer's System should inform Cloudike immediately if the user has performed a port-out action or contract cancellation.

POST https://payg-provisioner.cloudike.com/provisioning-api/1/tenants/<tenant_name>/payg/port_out_requests

HTTP Headers​

  • Authorization: Bearer JWT
  • Content-Type: application/json

Request Parameters​

ParameterTypeDescription
msisdnnumberUser's phone number (MSISDN).
idempotency_keystringUnique transaction ID. It should be HEX of randomly generated UUID version 7 value - 32 chars without hyphens in lower-case. Example: 'e50e8400e29b41d4a7164266a544b301'. Any other random 32-character string can also be used.

Response Codes​

HTTP CodeDescription
200 OKRequest was successfully accepted and will be processed.
201 CreatedRequest was successfully accepted and will be processed.
400 Bad RequestIncorrect format of request. No retries required.
401 UnauthorizedInvalid tenant_name / secret pair sent. No retries required.
422 Unprocessable EntityInvalid msisdn or other parameters. No retries required.
429 Too Many RequestsToo many requests sent. The sender can retry later.
5xx Server ErrorsWeb service is temporarily broken. The sender can retry later.

MSISDN Change Notification​

The Customer's System should inform Cloudike immediately when a user changes their MSISDN. The user's active subscription will be automatically transferred to the new MSISDN without requiring re-creation or additional actions.

POST https://payg.cloudike.com/api/3/tenants/<tenant_name>/payg/msisdn_change_requests

HTTP Headers​

  • Authorization: Bearer JWT
  • Content-Type: application/json

Request Parameters​

ParameterTypeDescription
msisdnnumberNew MSISDN value.
old_msisdnnumberPrevious (old) MSISDN value.
idempotency_keystringUnique transaction ID. It should be HEX of randomly generated UUID version 7 value - 32 chars without hyphens in lower-case. Example: 'e50e8400e29b41d4a7164266a544b301'. Any other random 32-character string can also be used.

Response Codes​

HTTP CodeDescription
200 OKRequest was successfully accepted and will be processed.
201 CreatedRequest was successfully accepted and will be processed.
400 Bad RequestIncorrect format of request. No retries required.
401 UnauthorizedInvalid tenant_name / secret pair sent. No retries required.
422 Unprocessable EntityInvalid msisdn/ old_msisdn or other parameters. No retries required.
429 Too Many RequestsToo many requests sent. The sender can retry later.
5xx Server ErrorsWeb service is temporarily broken. The sender can retry later.

Get JWT Token to Access a Private API​

The Customer's System should use a JWT token for authentication when making API requests to Cloudike services. A JWT token is generated using the following API request:

POST https://payg.cloudike.com/api/3/applications/<app_id>/tokens/

HTTP Headers​

  • Content-Type: application/json

Request Parameters​

ParameterTypeDescription
access_keystringApplication's access key.
scope_namestringName of the scope (a list of functions the customer is allowed to call).

Response Body​

FieldTypeDescription
tokenstringThe generated JWT token.
expiresstringDate-time of token expiration.

Response Codes​

HTTP CodeDescription
201 CreatedRequest was successfully accepted, JWT token generated.
400 Bad RequestIncorrect format of request. No retries required.
422 Unprocessable EntityInvalid access_key or scope_name. No retries required.

User's Actions Notifications Sent to Customer's System​

Cloudike will notify the Customer's System of various events occurring with the users. Only one callback will be used for this notification.

POST https://customer.com/user_event_notify

HTTP Headers​

  • Authorization: Bearer JWT
  • Content-Type: application/json

Request Parameters​

ParameterTypeDescription
createdstringThe date and time of the event in ISO-8601 format (e.g., "2025-02-25T08:37:20+00:00").
eventstringThe name of the occurred event (see table below).
msisdnnumberThe user's MSISDN (mobile number). Omitted if the user account has no MSISDN.
emailstringThe user's email. Omitted if the user account has no email.
user_idnumberCloudike's user ID.
parametersstructureThe JSON structure with variable additional parameters depending on the event.

Events​

EventAdditional Parameters (JSON)Description
user_created{}The user account was created.
user_removed{}The user account with all its data was removed.
subscription_created{ "package_id": "9999", "customer_product_id": "CLOUD123" }The user was subscribed to a new subscription.
subscription_renewed{ "package_id": "9999", "customer_product_id": "CLOUD123" }The user's active subscription was successfully prolonged.
subscription_canceled{ "package_id": "9999", "customer_product_id": "CLOUD123" }The user's active subscription was canceled.
user_quota_exceed_80{}The user's used storage has reached 80% of their available disk quota.
user_quota_exceed_90{}The user's used storage has reached 90% of their available disk quota.
user_quota_exceed_95{}The user's used storage has reached 95% of their available disk quota.
user_quota_exceed_100{}The user's used storage has reached 100% of their available disk quota.
user_quota_zero{}The user's disk quota has reached zero, meaning their account is planned to be removed after 7 days.

Response Codes​

HTTP CodeDescription
200 OKEvent was accepted by the Customer's System.
400 Bad RequestIncorrect format of request. The platform will not retry the message.
401 UnauthorizedInvalid secret sent. Request was not accepted, no retries required.
422 Unprocessable EntityInvalid msisdn number or other parameters. The platform will not retry the message.
429 Too Many RequestsToo many requests sent. The platform will retry the message.
5xx Server ErrorsWeb service is temporarily broken. The platform will retry the message.

The response body can be empty: Cloudike ignores it.

Appendix: Sequence Diagrams​

User Orders a New Subscription in the App​

Sequence diagram: user orders a new subscription in the app

MO Request to Subscribe a User to a Package​

Sequence diagram: MO request to subscribe a user to a package

Footnotes​

  1. msisdn and email parameters - one of them is required. ↩ ↩2 ↩3 ↩4 ↩5 ↩6 ↩7 ↩8

  2. package_id and customer_product_id parameters - one of them is required. ↩ ↩2 ↩3 ↩4 ↩5 ↩6