Developer API

Documentation and support for the The Content Authority API

Thank you for your interest in the API! This API is designed to allow developers to create their own tools and applications that can access the core functionality of this site and enable them to access their orders, create new orders, and check their account status.

With the API, a software developer can make REST queries to our server and receive responses in XML format. These responses can be used to create dynamic applications that require content from our writers.

This documentation’s core purpose is to describe the functionality of the API and its core functions.

If you have any bugs to report or any suggestions for the API, please email: support@thecontentauthority.com

API Requirements

  • To use the API, you need an API key (a publisher account is required to get a key).  To get an API key, you need to create an account at The Content Authority.  Log into your account and then go to the Manage Account page.  You will find your key under the Developer API heading.
  • Ability to make REST requests to the server

The Services Available

There are currently three services available to use. AccountServiceStandardOrderService, and LabelService

Getting Started

To get started, you must consider if you need the use of callbacks. When callbacks are turned on, when orders arrive at a critical stage that requires your interaction, our server will contact a specified web address with details of that order allowing your application to approve, post, or reject the order it receives.

Callbacks are handled by each individual label on the publisher account and can be specified through the LabelService.

The URL for services and requests are simple and easy to remember.

The Basic URL Syntax

http://thecontentauthority.com/api/TheService/TheRequest/

An Example Request

http://thecontentauthority.com/api/StandardOrderService/QualityList/

All requests require the API key (designated “key”) to specified in the POST data. Failure to submit the API key will result in an error.

A Example Request Made With CURL

$args = array(“key”=>”MY API KEY”,”order”=>$order,”notes”=>$notes,”format”=>”json”);

$url = “http://thecontentauthority.com/api/StandardOrderService/ReviseOrder/”;

$query = http_build_query($args, ”, ‘&’);

$ch = curl_init($url);
curl_setopt($ch, CURLOPT_POST ,1);
curl_setopt($ch, CURLOPT_POSTFIELDS ,$query);
curl_setopt($ch, CURLOPT_FOLLOWLOCATION ,1);
curl_setopt($ch, CURLOPT_HEADER ,0); // DO NOT RETURN HTTP HEADERS
curl_setopt($ch, CURLOPT_RETURNTRANSFER ,1); // RETURN THE CONTENTS OF THE CALL

$response = curl_exec($ch);
curl_close($ch);

$response = json_decode($response,true);
echo “<pre>”;
print_r($response);
echo “</pre>”;

Testing The API

When testing the API, use http://sandbox.thecontentauthority.com/

An Example Request Using the Sandbox

http://sandbox.thecontentauthority.com/api/StandardOrderService/QualityList/

The sandbox will give you dummy results and the data or API key that you will use will not affect those results.

Response Format

XML (default) or JSON

When creating a query for the API, you can specify format of the returned results by using the variable “format”. By default it is set as XML however you can use “json” to get the results in JSON format.

$args = array(“key”=>”MY API KEY”,”order”=>$order,”notes”=>$notes,“format”=>”json”);

The Services

AccountService

The purpose of the AccountService is to enable you to get vital information about your account. The only possible request you can make with AccountService is: AccountStatus

AccountStatus

Required parameters: $key

Response: Pub_ID, Credits

The purpose of AccountStatus is allow your application to see how many credits are left in the account.

StandardOrderService

The purpose of the StandardOrderService is to allow applications to view, create, and approve orders. The requests available are: QualityList,OrderListCreateOrderCancelOrderGetOrderInformationApproveOrderReviseOrder

QualityList

Required parameters: $key

Response: Tier, Name, Price

The purpose of QualityService is to enable you to see the available quality levels and their price per word.

OrderList

Required parameters: $key, $label = label_id

Response: Returns multiple items. Each item will have: Order_ID, Step, Writer_ID, Title, Keywords, Text

The purpose of OrderList is to allow your application to get all the orders of a given label.

CreateOrder

Required parameters: $key, $label = label_name, $tier, $words, $keywords, $instructions, $quantity

Response: Returns multiple items. Each item will have: Order_ID

The purpose of CreateOrder is to allow your application to create orders remotely.

CancelOrder

Required parameters: $key, $order

Response: Order_ID, Refunded_Amount

The purpose of CancelOrder is to allow your application to cancel orders remotely. The only orders that can be canceled are ones that haven’t been accepted or written by a writer (all orders on step 1 and some orders on step 2)

GetOrderInformation

Required parameters: $key, $order

Response: Order_ID, Step, Writer_ID, Title, Keywords, Instructions, Text, Approved

The purpose of GetOrderInformation is to get specific information about a requested order. You can check to see if the order is approved or not as well as where it is in the order process.

ApproveOrder

Required parameters: $key, $order, $rating = integer(1-3)

Response: The status and message about the approval (status = 200 means the order has been approved successfully)

The purpose of ApproveOrder is to allow your application to remotely approve and rate orders. Ratings: 1 = Satisfactory, 2 = Above Expectations, 3 = Excellent above-and-beyond work

ReviseOrder

Required parameters: $key, $order, $notes

Response: The status and message about the revision (status = 200 means the request for revision has gone through)

The purpose of ReviseOrder is to allow your application to remotely ask for revisions for orders.

LabelService

The purpose of the LabelService is allow applications to view available labels and set the callback for each label. Available requests: LabelList,SetCallback

LabelList

Required parameters: $key

Response: Multiple items. Each item will contain: Label_ID, Name

The purpose of LabelList is to return a list of labels and their IDs for your application to use.

SetCallback

Required parameters: $key, $label = label_id, $callback = url

Response: Status of request.

The purpose of SetCallback is to allow your application to set where you want messages from the server to go.

RewriteService

The purpose of the RewriteService is allow applications to view, create, and manage Rewrite Orders.

CreateRewrite

Required parameters: key, keywordswordslabeltextquantity

  • keywords – the keywords for the rewrite order, needs to be comma separated
  • words – the word count of the order
  • label – the label for the order
  • text – the complete article text for the order to be rewritten
  • quantity – the number of rewrites wanted for the rewrite order

Response: List of created rewrite orders

The purpose of CreateRewrite is to allow your application to create new Rewrite Orders

RewriteStatus

Required parameters: key, rewrite

  • rewrite – the rewrite order ID

Response: Will return “In Queue”, “Being Written”, “Complete”, “Being Redone”

The purpose of RewriteStatus is to allow your application to view the status of a rewrite order.

RewriteRevision

Required parameters: key, rewritenotes

  • rewrite – the rewrite order ID
  • notes – the reason why you’re requesting a revision

Response: Will return success message or error

The purpose of RewriteRevision is to allow your application request a revision for a rewrite

CancelRewrite

Required parameters: key, rewrite

  • rewrite – the rewrite order ID

Response: Will return success message or error. Rewrites cannot be canceled if they have been completed or are being worked on

The purpose of CancelRewrite is to allow your application to cancel Rewrites that you do not need.

QueueRewrites

Required parameters: key, order, words, keywords, quantity

  • order – the order ID you want to make rewrites of
  • words – the word count of the rewrite you want (cannot be greater than the standard order)
  • keywords – the keywords for the rewrite article
  • quantity – the number of rewrite articles you want

Response: Will return error or Response: Success, Orders: [list of order ids of generated Rewrites], Cost: [the cost]

The purpose of QueueRewrites is to allow your application to create rewrites from Standard Orders. The Standard Order does not need to be complete in order to queue rewrites for it. The system will automatically create the rewrites when the order is complete. The label used will be the same as the specified Standard Order.

RewriteLabel

Required parameters: key, label

  • label – the name of the label you want information from

Response: A list of rewrite orders under the specified label

The purpose of RewriteLabel is to allow your application to view the rewrites IDs under the specified label. This is particularly useful when using QueueRewrites function.

RewriteDetailsById

Required parameters: key, rewrite

  • rewrite – the order ID of the rewrite you want the details of

Response: Either “That order is not completed yet” or details of the completed rewrite

The purpose of RewriteDetailsById is to allow your application to view a specific rewrite that has been completed so that you can use its text in your application.

OrderList

Required parameters: $key, $label = label_id

Response: Returns multiple items. Each item will have: Order_ID, Step, Writer_ID, Title, Keywords, Text

The purpose of OrderList is to allow your application to get all the orders of a given label.

Callbacks

The callback allows our server to communicate with your application when critical steps occur that require your approval. Our server will send a HTTP POST request via CURL to a URL designated with SetCallback the following parameters: $status, $order = order_id

Possible Values for Status:

  1. Complete
  2. Revision

Using the designated status, you can make appropriate decisions with your application including requesting a revision or approving the completed order.