PHPackages                             ocolin/tarana-tsp - 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. [HTTP &amp; Networking](/categories/http)
4. /
5. ocolin/tarana-tsp

ActiveLibrary[HTTP &amp; Networking](/categories/http)

ocolin/tarana-tsp
=================

REST Client for Tarana Wireless TSP services.

v1.0.0(3mo ago)01MITPHP

Since Apr 3Pushed 3mo agoCompare

[ Source](https://github.com/ocolin/TaranaTSP)[ Packagist](https://packagist.org/packages/ocolin/tarana-tsp)[ RSS](/packages/ocolin-tarana-tsp/feed)WikiDiscussions main Synced today

READMEChangelogDependencies (5)Versions (2)Used By (0)

Tarana TSP
==========

[](#tarana-tsp)

What is it?
-----------

[](#what-is-it)

This is a simple PHP REST client for Tarana's TSP API services.

---

Table of Contents
-----------------

[](#table-of-contents)

- [What is it?](#what-is-it)
- [Requirements](#requirements)
- [Installation](#installation)
- [Configuration](#configuration)
    - [Using Environment Variables](#using-environment)
    - [Constructor Arguments](#constructor-arguments)
    - [Options](#options)
- [Response](#response)
- [Path Parameter Interpolation](#path-parameter-interpolation)
- [Core Functions](#core-functions)
    - [request](#request)
    - [requestForm](#requestform)
    - [requestMultipart](#requestmultipart)
- [Endpoint Functions](#endpoint-functions)
    - [checkApiKey](#checkapikey)
    - [findBnsWithIssues](#findbsnwithissues)
    - [predictReport](#predictreport)
    - [predictMultiSector](#predictmultisector)
    - [submitMultiSector](#submitmultisector)
    - [getStatus](#getstatus)
    - [getResult](#getresult)
    - [predictMultiSectorCsv](#predictmultisectorcsv)
    - [submitMultiSectorCsv](#submitmultisectorcsv)
- [Async Workflow](#async-workflow)

---

Requirements
------------

[](#requirements)

- PHP ^8.3
- guzzlehttp/guzzle ^7.10
- ocolin/global-type ^ 2.0

---

Installation
------------

[](#installation)

```
composer require ocolin/tarana-tsp

```

---

Configuration
-------------

[](#configuration)

The client can be configured using environment variables, constructor arguments, or a combination of both.

### Parameters

[](#parameters)

Environment nameConstructor ArgumentTypeDescriptionTARANA\_TSP\_API\_HOST$hoststringHostname of Tarana API serverTARANA\_TSP\_API\_TOKEN$tokenstringAuthentication token issued by Tarana### Using environment

[](#using-environment)

```
// Manual creation for demonstration
$_ENV['TARANA_TSP_API_HOST'] = 'https://api.tsp.taranawireless.com/';
$_ENV['TARANA_TSP_API_TOKEN'] = 'abcdefg';
$tarana = new Ocolin\TaranaTSP\TaranaTSP();
```

### Constructor Arguments

[](#constructor-arguments)

```
$tarana = new Ocolin\TaranaTSP\TaranaTSP(
     host: 'https://api.tsp.taranawireless.com/',
    token: 'abcdefg'
);
```

### Options

[](#options)

The client has the ability to pass Guzzle HTTP options for things such as SSL verification, HTTP timeouts, etc.

```
// Manual creation for demonstration
$_ENV['TARANA_TSP_API_HOST'] = 'https://api.tsp.taranawireless.com/';
$_ENV['TARANA_TSP_API_TOKEN'] = 'abcdefg';
$tarana = new Ocolin\TaranaTSP\TaranaTSP(
    options: [ 'verify' => false, 'timeout' => 20 ]
);
```

---

Response
--------

[](#response)

The client will return an object with the following properties:

NameTypeDescriptionstatusintegerHTTP status codestatusMessagestringHTTP status messageheadersarrayHTTP response headersbodystring|arrayAPI response contentformatstringjson or csv format**NOTE:** When returning JSON, it will be in the form of an associative array.

---

Path Parameter Interpolation
----------------------------

[](#path-parameter-interpolation)

Any elements or properties of a $query argument that match variable tokens in the URI endpoint path will be replaced with the values for those elements in the $query array or object. Please see some of the method functions for examples.

---

Core Functions
--------------

[](#core-functions)

This client has 3 main functions for handling different types of data the API uses. One for JSON queries, one for form data queries, and one for multi-part queries.

### Request

[](#request)

The request method is for endpoints that send JSON data to the API server.

```
$output = $tarana->request(
    endpoint: '/v0/predict/multi-sector/status/{request_id}',
      method: 'GET',
       query: [ 'request_id' => 1234 ]
);
```

### requestForm

[](#requestform)

THis method is for API calls that require form data instead of JSON.

```
$output = $tarana->requestForm(
    endpoint: '/v0/find/bns/issue',
      method: 'POST',
       query: [ 'response_format' => 'csv' ],
        body: [ 'operator' => 'abcdefg' ]
);
```

### requestMultipart

[](#requestmultipart)

Some Tarana API calls require multi-part form submissions instead of JSON.

```
$output = $tarana->requestMultipart(
     endpoint: '/v0/predict/multi-sector/csv',
       method: 'POST',
    filePaths: [ 'height_csv_file.csv' => 'bn_csv_file.csv' ],
         body: [ 'operator' => 'abcdefg' ],
        query: [ 'bn_limit' => 5 ]
);
```

---

Endpoint Functions
------------------

[](#endpoint-functions)

### checkApiKey

[](#checkapikey)

Check that API Key is valid

```
$output = $tarana->checkApiKey();
```

### findBnsWithIssues

[](#findbnswithissues)

This endpoint retrieves a list of Base Nodes (BNs) for a given operator that have TCS data.

#### Arguments

[](#arguments)

NameTypeRequiredDefaultDescriptionformatstringNocsvSpecify output of JSON or CSVoperatorstringNonullSpecify operator ID```
$output = $tarana->findBnsWithIssues(
    format: 'csv',      // Output format json or csv
    operator: 'abcdefg' // Operator ID
);
```

### predictReport

[](#predictreport)

This endpoint reports on all predictions (single and multi-sector) made over the past number of days specified (default = 7 days). An aggregated CSV file, containing the CSV portion of all the predictions made, is returned, ordered newest to oldest.

NameTypeRequiredDefaultDescriptionoperatorstringNonullOptional operator namedaysintegerNonullOptional report timeframe in days (default=7)optionsstringNonullThe options for prediction resultsdownloadbooleanNofalseSet true for a download URL instead of a direct response```
$output = $tarana->predictReport( download: true );
```

### predictMultiSector

[](#predictmultisector)

This endpoint predicts the path loss and speed for multiple sectors, each consisting of one Base Node (BN) and one or more Remote Nodes (RNs). It takes the MultiSector object containing information about the BNs, RNs, and optional additional BNs as input and returns an output object containing the predicted path loss, speed, and other relevant information for each sector.

NameTypeRequiredDefaultDescriptionbodyarray|objectYesSee API docs for object structuresbnLimitintegerNonullThe limit on the number of BN predictions for each RNoptionsstringNonullOptions for prediction results (cdf\_graphs, path\_profiles, etc.)```
$output = $tarana->predictMultiSector(
    body: {...},
    bnLimit: 10
);
```

### submitMultiSector

[](#submitmultisector)

This endpoint submits a job to predict the path loss and speed for multiple sectors in the background. It returns immediately with the request ID that can be used to query the status of the prediction.

NameTypeRequiredDefaultDescriptionbodyarray|objectYesSee API docs for object structuresbnLimitintegerNonullThe limit on the number of BN predictions for each RNoptionsstringNonullOptions for prediction results (cdf\_graphs, path\_profiles, etc.)```
$output = $tarana->submitMultiSector(
    body: {...},
    bnLimit: 10
);
```

### getStatus

[](#getstatus)

This endpoint returns the prediction status, including the progress of prediction for Base Nodes (BNs) and Remote Nodes (RNs), as well as the overall progress for all devices combined.

NameTypeRequiredDefaultDescriptionrequestIdstringYesThe unique identifier for the prediction requestcsvbooleanNofalseCheck CSV job status```
$output = $tarana->getStatus( requestId: 'abcdefg' );
```

### getResult

[](#getresult)

This endpoint returns the prediction results, returning an output object containing the predicted path loss, speed, and other relevant information for each sector.

NameTypeRequiredDefaultDescriptionrequestIdstringYesThe unique identifier for the prediction requestcsvbooleanNofalseGet CSV resultformatstringNojsonbody is json or csvdownloadbooleanNofalsereturn download URL instead of returning data```
$output = $tarana->getResult( requestId: 'abcdefg' );
```

### predictMultiSectorCsv

[](#predictmultisectorcsv)

This endpoint predicts the path loss and speed for multiple sectors, each consisting of one Base Node (BN) and one or more Remote Nodes (RNs). It takes multiple CSV files containing information about the BNs, RNs, and optional additional BNs as input and returns an output object containing the predicted path loss, speed, and other relevant information for each sector.

NameTypeRequiredDefaultDescriptionrnCsvFilePathstringYesThe CSV file with information on the RNs (limit 100)heightCsvFilePathstringNonullThe CSV file with information on the heights of the RNsbnCsvFilePathstringNonullThe CSV file with information on additional BNs to usebnLimitintegerNonullThe limit on the number of BN predictions for each RNformatstringNojsonSpecify the response format: 'csv' (default) or 'json'optionsstringNonullThe options for prediction results (cdf\_graphs, path\_profiles, etc.)operatorstringNonullOptional operator nameemailstringNonullOptional email address of the requestor```
$output = $tarana->predictMultiSectorCsv( rnCsvFilePath: 'file.csv' );
```

### submitMultiSectorCsv

[](#submitmultisectorcsv)

This endpoint submits a job to predict the path loss and speed for multiple sectors in the background. It returns immediately with the request ID that can be used to query the status of the prediction.

NameTypeRequiredDefaultDescriptionrnCsvFilePathstringYesThe CSV file with information on the RNs (limit 100)heightCsvFilePathstringNonullThe CSV file with information on the heights of the RNsbnCsvFilePathstringNonullThe CSV file with information on additional BNs to usebnLimitintegerNonullThe limit on the number of BN predictions for each RNformatstringNojsonSpecify the response format: 'csv' (default) or 'json'optionsstringNonullThe options for prediction results (cdf\_graphs, path\_profiles, etc.)operatorstringNonullOptional operator nameemailstringNonullOptional email address of the requestor```
$output = $tarana->submitMultiSectorCsv( rnCsvFilePath: 'file.csv' );
```

Async Workflow
--------------

[](#async-workflow)

Some prediction jobs can take a long time to complete. The submit/status/result pattern allows you to submit a job and poll for completion rather than waiting for a synchronous response.

1. Submit a job with `submitMultiSector()` or `submitMultiSectorCsv()`
2. Store the `request_id` from the response body
3. Poll `getStatus()` until `prediction_state` is `completed`
4. Fetch results with `getResult()`

```
// 1. Submit
$job = $tarana->submitMultiSector( body: $data );
$requestId = $job->body['request_id'];

// 2. Poll until complete
do {
    sleep( 5 );
    $status = $tarana->getStatus( requestId: $requestId );
} while( $status->body['prediction_state'] !== 'completed' );

// 3. Fetch results
$result = $tarana->getResult( requestId: $requestId );
```

For CSV submissions use `submitMultiSectorCsv()` and pass `csv: true`to both `getStatus()` and `getResult()`.

###  Health Score

32

—

LowBetter than 69% of packages

Maintenance82

Actively maintained with recent releases

Popularity2

Limited adoption so far

Community2

Small or concentrated contributor base

Maturity34

Early-stage or recently created project

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

Unknown

Total

1

Last Release

92d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/e97ac0aa452b872ddc3f7f4c56c83852574a27bb74622f8c054d11ca20008fc9?d=identicon)[Ocolin](/maintainers/Ocolin)

---

Tags

apiclientrestpredictionispРФtspwirelesswisptaranapath-lossfixed-wireless

###  Code Quality

TestsPHPUnit

Static AnalysisPHPStan

Type Coverage Yes

### Embed Badge

![Health badge](/badges/ocolin-tarana-tsp/health.svg)

```
[![Health](https://phpackages.com/badges/ocolin-tarana-tsp/health.svg)](https://phpackages.com/packages/ocolin-tarana-tsp)
```

###  Alternatives

[xeroapi/xero-php-oauth2

Xero official PHP SDK for oAuth2 generated with OpenAPI spec 3

1054.7M18](/packages/xeroapi-xero-php-oauth2)[onesignal/onesignal-php-api

A powerful way to send personalized messages at scale and build effective customer engagement strategies. Learn more at onesignal.com

34216.9k2](/packages/onesignal-onesignal-php-api)[meteocontrol/vcom-api-client

HTTP Client for meteocontrol's VCOM API - The VCOM API enables you to directly access your data on the meteocontrol platform.

188.0k1](/packages/meteocontrol-vcom-api-client)[eslazarev/wildberries-sdk

Wildberries OpenAPI clients (generated).

273.0k](/packages/eslazarev-wildberries-sdk)[dreamfactory/df-core

DreamFactory(tm) Core Components

1652.1k38](/packages/dreamfactory-df-core)

PHPackages © 2026

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