TextMaster's Developer Documentation
HomeApp
  • Welcome!
  • Quick Start
    • Postman
    • OpenAPI
  • Overview
    • Resources in the REST API
    • Authentication
    • Troubleshooting
    • Filters
    • Workflow
    • File uploads
    • Loop
  • Guides
    • Integrator best practices
  • Apps
    • About OAuth Apps
    • Building OAuth Apps
      • Creating an OAuth App
      • Authorizing OAuth Apps
      • Scopes for OAuth Apps
    • Managing OAuth Apps
      • Modifying an OAuth App
      • Deleting an OAuth App
  • Webhooks & Events
    • Webhooks
      • Creating webhooks
      • Configuring your server for webhooks
      • Securing webhooks
      • Troubleshooting webhooks
    • Events
  • Integrations
    • Akeneo
      • Getting Started
      • Configuration
      • Usage
      • Monitoring
      • Troubleshooting
    • Salesforce Commerce Cloud
      • Getting Started
      • Configuration
      • Usage
      • Monitoring
      • Troubleshooting
  • Reference
    • Abilities
    • Authors
    • Documents
    • Categories
    • Countries
    • Expertises
    • Glossaries
    • Languages
    • Levels
    • Locales
    • Preferred Authors
    • Projects
    • Project Templates
    • Negotiated Contracts
    • Support Messages
    • Transactions
    • Uploads
    • Users
    • Work Templates
Powered by GitBook
On this page
  • Overview
  • Hello World
  • Authentication
  • Projects

Was this helpful?

Quick Start

Learn the foundations for using the REST API, starting with authentication and some endpoint examples.

PreviousWelcome!NextPostman

Last updated 3 years ago

Was this helpful?

Let's walk through core API concepts as we tackle some everyday use cases.

Overview

Most applications will use an existing wrapper library in the language of your choice, but it's important to familiarize yourself with the underlying API HTTP methods first.

There's no easier way to kick the tires than through .

Hello World

Let's start by testing our setup. Open up a command prompt and enter the following command:

$ curl https://api.textmaster.com/ping

> {"message":"Textmaster API at your service"}%

Authentication

To be honest, doing anything interesting with the TextMaster API requires .

Using a signature

The easiest way to authenticate with TextMaster API is by using the .

Warning: We strongly advise to use the signature strategy only for test purposes. Prefer using OAuth2 tokens for production use cases.

In the top-bar navigation of TextMaster's application, click on API & Loop

In the left panel, copy & paste your api key and secret.

Set the following shell variables:

export APIKEY=yourApikey
export APISECRET=yourApiSecret
export DATE=$(date -u +"%Y-%m-%d %H:%M:%S")
export SIGNATURE=$(echo -n $APISECRET$DATE | openssl sha1 | sed 's/.*= //')

Verify the validity of your signature by executing the following request:

$ curl "https://api.textmaster.com/test" \
  -H "Apikey: $APIKEY" \
  -H "Date: $DATE" \
  -H "Signature: $SIGNATURE"
  
> {"message":"You sent the following headers: { HTTP_APIKEY: yourApikey, HTTP_DATE: 2022-01-20 15:25:06, HTTP_SIGNATURE: dc5b5... }. Your api key is valid. Your date is well formatted. Your signature is valid."}%

Get your own user profile

When properly authenticated, you can take advantage of the permissions associated with your account on TextMaster. For example, try getting your own user profile:

curl "https://api.textmaster.com/v1/clients/users/me" \
  -H "Apikey: $APIKEY" \
  -H "Date: $DATE" \
  -H "Signature: $SIGNATURE"

Using OAuth tokens for apps

OAuth uses tokens. Tokens provide two big features:

  • Revokable access: users can revoke authorization to third party apps at any time

  • Limited access: users can review the specific access that a token will provide before authorizing a third party app

Treat OAuth tokens like passwords! Don't share them with other users or store them in insecure places. The tokens in these examples are fake and the names have been changed to protect the innocent.

Now that we've got the hang of making authenticated calls, let's move along to the Projects API.

Projects

curl "https://api.textmaster.com/v1/clients/projects/61698af48b81926d91c0f3d1" \
  -H "Apikey: $APIKEY" \
  -H "Date: $DATE" \
  -H "Signature: $SIGNATURE"

Or, we can list our projects:

curl "https://api.textmaster.com/v1/clients/projects" \
  -H "Apikey: $APIKEY" \
  -H "Date: $DATE" \
  -H "Signature: $SIGNATURE"
curl -Gg "https://api.textmaster.com/v1/clients/projects/filter" \
  --data-urlencode 'where={"total_word_count":{"$gt":1},"language_to_code":"en","language_from_code":"fr","level_name":"premium"}' \
  --data-urlencode 'order=level_name' \
  -H "Apikey: $APIKEY" \
  -H "Date: $DATE" \
  -H "Signature: $SIGNATURE"

For more informations on the different filters available, see:

Woot! Now you know the basics of the TextMaster API!

  • Signature & OAuth authentication

  • Fetching and filtering projects

Dive deeper and get more details about available resources:

Or, start learning about OAuth Apps:

Or, start exploring our API reference to get an idea of everything that's possible with the API:

Finally, don't forget to read about Webhooks to build or set up powerful integrations:

Apps that need to read or write private information using the API on behalf of another user should use .

Tokens should be created via a . An application sends users to TextMaster to log in. TextMaster then presents a dialog indicating the name of the app, as well as the level of access the app has once it's authorized by the user. After a user authorizes access, TextMaster redirects the user back to the application:

Almost any meaningful use of the TextMaster API will involve some level of Project information. We can in the same way we fetched user details earlier:

As the indicate, you can query a filter endpoint that can be used to filter projects returned based on various attributes:

OAuth
Filters
Resources in the REST API
About OAuth Apps
Reference
Webhooks & Events
web flow
cURL
authentication
GET project details
docs
signature authentication strategy