Official PHP SDK. Grammar checking API for PHP. Also includes: style improvements, terminology checking, and plagiarism checking API.
Switch branches/tags
Nothing to show
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
docs
lib
test
.php_cs
.travis.yml
README.md
autoload.php
composer.json
git_push.sh
phpunit.xml.dist

README.md

ProWritingAid.API

Official PHP prowritingaid.com API.

  • API version: v2

Requirements

PHP 5.5 and later

Installation & Usage

Composer

To install the bindings via Composer, add the following to composer.json:

{
  "minimum-stability": "dev",
  "repositories": [
    {
      "type": "git",
      "url": "https://github.com/prowriting/prowritingaid.php.git"
    }
  ],
  "require": {
    "prowriting/prowritingaid.php": "*"
  }
}

Then run composer install

Manual Installation

Download the files and include autoload.php:

    require_once('/path/to/SwaggerClient-php/autoload.php');

Getting Started

Please follow the installation procedure and then run the following:

<?php
require_once(__DIR__ . '/vendor/autoload.php');

$configuration = new ProWritingAidSDK\Configuration();
$configuration->setHost('https://api.prowritingaid.com');
$configuration->setApiKey('licenseCode', 'YOUR_LICENSE_CODE');
$api_instance = new ProWritingAidSDK\Api\ContextualThesaurusApi(null, $configuration);

$data['context'] = 'This is a sample text in English to test the sdk thesaurus. This is a second paragraph in the document. This  is a new line.';
$data['context_start'] = 17;
$data['context_end'] = 20;
$request = new \ProWritingAidSDK\Model\ContextualThesaurusRequest($data);

try {
    $result = $api_instance->post($request);
    echo $result;
} catch (Exception $e) {
    echo 'Exception when calling AsyncContextualThesaurusApi->asyncContextualThesaurusPost: ', $e->getMessage(), PHP_EOL;
}

?>

Documentation for API Endpoints

All URIs are relative to https://api.prowritingaid.com

Class Method HTTP request Description
ContextualThesaurusApi get GET /api/async/contextualthesaurus/result/{taskId} Tries to get the result of a request using the task id of the request
ContextualThesaurusApi post POST /api/async/contextualthesaurus Analyses text and returns contextual thesaurus entries
HtmlApi get GET /api/async/html/result/{taskId} Tries to get the result of a request using the task id of the request
HtmlApi post POST /api/async/html Analyses HTML and adds suggestion tags to it
SummaryApi get GET /api/async/summary/result/{taskId} Tries to get the result of a request using the task id of the request
SummaryApi post POST /api/async/summary Gets the summary analysis of a document
TextApi get GET /api/async/text/result/{taskId} Tries to get the result of a request using the task id of the request
TextApi post POST /api/async/text Analyses text and returns tags for it
ThesaurusApi post POST /api/thesaurus Returns the thesaurus entries for a specific word
WordCloudApi get GET /api/async/wordcloud/result/{taskId} Tries to get the result of a request using the task id of the request
WordCloudApi post POST /api/async/wordcloud Analyses text and returns a word cloud (as an image)

Documentation For Models

Documentation For Authorization

licenseCode

  • Type: API key
  • API key parameter name: licenseCode
  • Location: HTTP header