PHPackages                             mafikes/cdn77api - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. mafikes/cdn77api

AbandonedArchivedLibrary

mafikes/cdn77api
================

API client for CDN77.com

2.0.3(4y ago)212MITPHPPHP &gt;=5.4.0

Since Jun 8Pushed 4y ago1 watchersCompare

[ Source](https://github.com/mafikes/cdn77api)[ Packagist](https://packagist.org/packages/mafikes/cdn77api)[ RSS](/packages/mafikes-cdn77api/feed)WikiDiscussions main Synced 5d ago

READMEChangelog (5)Dependencies (1)Versions (7)Used By (0)

PHP Library cdn77 api v3
------------------------

[](#php-library-cdn77-api-v3)

PHP Client for communication with v3 [cdn77.com](https://client.cdn77.com/support/api-docs/v3/introduction).

Install
-------

[](#install)

```
composer require mafikes/cdn77api

```

Example
-------

[](#example)

Examples could be found in examples folder.

#### Create client

[](#create-client)

```
use \Mafikes\Cdn77Api\Client;
$client = new Client('your_token_here');

// full example
use \Mafikes\Cdn77Api\Client;
$client = new Client('mySecretTokenBla12121212');
var_dump($client->cdnResource->getDetail(123139340032));
```

### How get data from API

[](#how-get-data-from-api)

Functions in client are similar to original functions from API CDN77. [Go to official documentation](https://client.cdn77.com/support/api-docs/v3/introduction).

### API structure

[](#api-structure)

- [CDN Resource](#cdn-resources)
- [Billing](#billing)
- [Jobs](#jobs)
- [Raw Logs](#raw-logs)
- [Statistics](#statistics) (All functions not implemented yet)
- [Storage Location](#storage-location)

### CDN Resources

[](#cdn-resources)

[Official documentation of cdn resources](https://client.cdn77.com/support/api-docs/v3/cdn-resources)

#### Get list of avalaible resources

[](#get-list-of-avalaible-resources)

```
$client->cdnResource->getList();
```

#### Get list of avalaible resources

[](#get-list-of-avalaible-resources-1)

```
$client->cdnResource->create([
    // All CNAMEs should be mapped via DNS to CDN URL. Otherwise it's not possible to generate SSL certificate. Maximum number of CNAMEs is "10". To add more, contact our support.
    'cnames' => [
        'cname.your-domain.com'
    ],
    // The label helps you to identify your CDN Resource.
    'label' => 'My cdn',
    // ID of attached Origin (content source for CDN Resource). More information in our Origin API documentation.
    'origin_id' => 'e56564d1-8d3e-4457-93a6-082b054bc736'
]);
```

#### Detail of CDN Resource

[](#detail-of-cdn-resource)

```
$client->cdnResource->getDetail('cdn_id');
```

#### Edit CDN Resource

[](#edit-cdn-resource)

This is only example, not all data must be included. More in [official documentation](https://client.cdn77.com/support/api-docs/v3/cdn-resources#edit-cdn-resource).

```
$client->cdnResource->edit('cdn_id', array(
    'cache' => [
        'max_age' => 1448,
        'requests_with_cookies_enabled' => true
    ],
    'cnames' => [
        "cname.your-domain.com"
    ],
    'geo_protection' => [
        'countries' => ['UK'],
        'type' => 'passlist'
    ],
    'headers' => [
        'cors_enabled' => true,
        'host_header_forwarding_enabled' => true
    ],
    'hotlink_protection' => [
        'domains' => ["some-domain.com"],
        'type' => 'passlist',
        'empty_referer_denied' => true
    ],
    'https_redirect' => [
        'code' => 301,
        'enabled' => true
    ],
    'instant_ssl' => [
        'enabled' => true
    ],
    'ip_protection' => [
        'ips' => ["8.8.8.8"],
        'type' => 'passlist'
    ],
    'label' => 'My cdn',
    'mp4_pseudo_streaming' => [
        'enabled' => true
    ],
    'origin_id' => 'e56564d1-8d3e-4457-93a6-082b054bc736',
    'query_string' => [
        'parameters' => ["utm"],
        'ignore_type' => 'all'
    ],
    'quic' => [
        'enabled' => true,
    ],
    'secure_token' => [
        'token' => 'T9WQQX4SV5',
        'type' => 'parameter'
    ],
    'waf' => [
        'enabled' => true
    ]
));
```

#### Delete CDN Resource

[](#delete-cdn-resource)

```
$client->cdnResource->delete('cdn_id');
```

#### List of CNAMEs

[](#list-of-cnames)

```
$client->cdnResource->getListCnames('cdn_id');
```

#### Add CNAME

[](#add-cname)

```
$client->cdnResource->createCname('cdn_id', [
    "cname" => "test.cname.com"
]);
```

#### Enable Datacenters

[](#enable-datacenters)

```
$client->cdnResource->enableDatacenters('cdn_id', array("65b63934-2278-40aa-affa-f4c0d1e7c029")); // [uuid] array of strings, format uuid
```

#### List of Datacenters

[](#list-of-datacenters)

```
$client->cdnResource->getListDatacenter('cdn_id');
```

### Billing

[](#billing)

[Official documentation of billing](https://client.cdn77.com/support/api-docs/v3/billing)

#### Credit balance

[](#credit-balance)

```
$client->billing->getDetails();
```

### Jobs

[](#jobs)

[Official documentation of jobs](https://client.cdn77.com/support/api-docs/v3/jobs)

#### List of jobs

[](#list-of-jobs)

Returns a filtered list of jobs for a given CDN Resource and type.

```
$client->job->getList('cdn_id', $client->job::JOB_TYPE_PREFETCH);

// All types of jobs
$client->job::JOB_TYPE_PURGE
$client->job::JOB_TYPE_PREFETCH
$client->job::JOB_TYPE_PURGE_ALL
```

#### Detail of job

[](#detail-of-job)

Returns detailed information regarding particular data manipulation API request.

```
$client->job->getDetail('cdn_id', 'job_id');
```

#### Prefetch

[](#prefetch)

Allows you to prepopulate certain files into CDN cache on all datacenters. Useful for reducing load on your origin server coming from a new content.

```
$client->job->prefetch('cdn_id', [
    // List of file paths, that are being processed in the job.
    'paths' => [
        'img/my-image.png',
        'img/second-image.jpg'
    ],
    // Use when host header forwarding is active on your CDN Resource.
    'upstream_host' => 'your-domain.com'
]);
```

#### Purge

[](#purge)

Allows you to rotate certain files out of the cache. Particularly useful to prevent stale response.

```
$client->job->purge('cdn_id', [
    'paths' => [
        'img/my-image.png',
        'img/background.jpg'
    ]
]);
```

#### Purge all

[](#purge-all)

Allows you to instantly remove all cached content from all datacenters.

```
$client->job->purgeAll('cdn_id');
```

### Origin

[](#origin)

[Official documentation of origin](https://client.cdn77.com/support/api-docs/v3/origin)

#### List of Origins

[](#list-of-origins)

```
$client->origin->getList();
```

#### Create Your Origin

[](#create-your-origin)

```
$client->origin->create([
    "base_dir" => "/pictures/images/",
    "label" => "My URL Origin",
    "port" => 8080,
    "scheme" => "https",
    "host" => "my-domain.com"
]);
```

#### Detail of Your Origin

[](#detail-of-your-origin)

```
$client->origin->getDetail('origin_id');
```

#### Edit Origin

[](#edit-origin)

Change of origin affects all your assigned CDN Resources.

```
$client->origin->edit('origin_id', [
    "aws_access_key_id" => "KLAMIDYDRAP8CJYC1DN",
    "aws_access_key_secret" => "3a1F8jM+xJyDkHdUQazbcq5mDI2gW0vFsFbLi6PW",
    "aws_region" => "us-east-1",
    "base_dir" => "/pictures/images/",
    "label" => "My AWS Origin",
    "scheme" => "https",
    "host" => "my.s3.amazonaws.com",
    "port" => "1000"
]);
```

#### Delete Origin

[](#delete-origin)

```
$client->origin->delete('origin_id');
```

#### Create AWS Origin

[](#create-aws-origin)

```
$client->origin->createAwsOrigin([
    "aws_access_key_id" => "KLAMIDYDRAP8CJYC1DN",
    "aws_access_key_secret" => "3a1F8jM+xJyDkHdUQazbcq5mDI2gW0vFsFbLi6PW",
    "aws_region" => "us-east-1",
    "base_dir" => "/pictures/images/",
    "label" => "My AWS Origin",
    "scheme" => "https",
    "host" => "my.s3.amazonaws.com",
    "port" => 1000
]);
```

### Raw Logs

[](#raw-logs)

[Official documentation of row logs](https://client.cdn77.com/support/api-docs/v3/raw-logs)

#### List of CDN Resource Raw Logs

[](#list-of-cdn-resource-raw-logs)

```
$client->rawLogs->getList();
```

#### Activate Raw Logs for CDN Resource

[](#activate-raw-logs-for-cdn-resource)

```
$client->rawLogs->activateRawLog('cdn_id');
```

#### Deactivate Raw Logs for CDN Resource

[](#deactivate-raw-logs-for-cdn-resource)

```
$client->rawLogs->deactivateRawLog('cdm_id');
```

#### Download Daily Raw Log files for CDN Resource

[](#download-daily-raw-log-files-for-cdn-resource)

```
$client->rawLogs->download('cdn_id', 'fileName');
```

### Statistics

[](#statistics)

[Official documentation of statistics](https://client.cdn77.com/support/api-docs/v3/statistics)

#### Get stats

[](#get-stats)

```
$dateFrom = new DateTime('2020-01-01');
$dateTo = new DateTime('2020-08-06');

//$client->stats->get($type, $dateFrom, $dateTo, $cdnIds = null, $locationIds = null, $aggregation = null)
$client->stats->get($client->stats::TYPE_BANDWIDTH, $dateFrom->getTimestamp(), $dateTo->getTimestamp());

// All Types
$client->stats::TYPE_BANDWIDTH
$client->stats::TYPE_COSTS
$client->stats::TYPE_HEADERS
$client->stats::TYPE_HEADERS_DETAIL
$client->stats::TYPE_HIT_MISS
$client->stats::TYPE_HIT_MISS_DETAIL
$client->stats::TYPE_TRAFFIC
$client->stats::TYPE_TRAFFIC_DETAIL
$client->stats::TYPE_TRAFFIC_MISS
```

### Storage Location

[](#storage-location)

[Official documentation of storage location](https://client.cdn77.com/support/api-docs/v3/storage-location)

#### List of Storage Locations

[](#list-of-storage-locations)

```
$client->storage->getList();
```

#### Detail of Storage Location

[](#detail-of-storage-location)

```
$client->storage->detail('storage_id');
```

---

I hope this package help you. You could donate me via [PayPal](https://www.paypal.com/donate/?hosted_button_id=D9DZ3LYZRH888).

###  Health Score

24

—

LowBetter than 32% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity8

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity51

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 100% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Every ~50 days

Recently: every ~3 days

Total

6

Last Release

1549d ago

Major Versions

1.0.0 → v3.x-dev2022-02-04

PHP version history (2 changes)1.0.0PHP &gt;=5.4.0

v3.x-devPHP &gt;=7.0

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/2887190?v=4)[Martin Antoš](/maintainers/mafikes)[@mafikes](https://github.com/mafikes)

---

Top Contributors

[![mafikes](https://avatars.githubusercontent.com/u/2887190?v=4)](https://github.com/mafikes "mafikes (10 commits)")

### Embed Badge

![Health badge](/badges/mafikes-cdn77api/health.svg)

```
[![Health](https://phpackages.com/badges/mafikes-cdn77api/health.svg)](https://phpackages.com/packages/mafikes-cdn77api)
```

###  Alternatives

[neuron-core/neuron-ai

The PHP Agentic Framework.

1.8k245.3k21](/packages/neuron-core-neuron-ai)[tencentcloud/tencentcloud-sdk-php

TencentCloudApi php sdk

3731.2M42](/packages/tencentcloud-tencentcloud-sdk-php)[aedart/athenaeum

Athenaeum is a mono repository; a collection of various PHP packages

245.2k](/packages/aedart-athenaeum)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
