Quick Start Mars Api Documentation

Last updated: Aug 16th, 2017

Instructions

Steps for get client id and secret

  1. Log in / Register Your account at https://www.marstranslation.com
  2. Go to My Profile Section
  3. Go to Api Settings Tab
  4. Retrieve Your client id and secret

Authentication

Log In

URL : https://www.marstranslation.com/oauth/v2/token

Method : POST

Explanation:

Login method would be used to login any registered user by providing Username and Password. access_token in the response will be to access all secure methods.

Parameters :
# Name Required Description
1 grant_type true Valid grant type is : 'password'
2 client_id true {{PUT CLIENT KEY HERE}}
3 client_secret true {{PUT CLIENT SECRET HERE}}
4 username true Username or email of user
5 password true Password of user
Copy CURl Code
CURL Request:
curl -X POST -H "Content-Type: multipart/form-data; boundary=----WebKitFormBoundary7MA4YWxkTrZu0gW"
             -F "grant_type=password"
             -F "client_id={{PUT CLIENT KEY HERE}}"
             -F "client_secret= {{PUT CLIENT SECRET HERE}}"
             -F "username=example@gmail.com"
             -F "password=123456"
                "https://www.marstranslation.com/oauth/v2/token"
JSON Response:
{
  "access_token": "NGMzY2FjNzg0MjYzN2Q3Zjk0MTc3YWJjODg1NGNmYjUwNDMyMTAzYTk2MmU5ZGQzMTQ0YWNiZGU2MjM0NTI5MQ",
  "expires_in": 3600,
  "token_type": "bearer",
  "scope": null,
  "refresh_token": "ZDI1MWJkNTNjNWM3NzdmZDE3M2Y1MTA5ZTBiYmM3YzJiMzFiZjdkYWExMTNiMjBhOGM4NmEyYzE2Y2M2MjQ1ZQ"
}

Log Out

URL :https://www.marstranslation.com/api/v2/user/logout

Method : GET

Explanation:

Logout method is used for invalidate a generated access_token and logout a logged in user.

Requirements :
# Name Required Description
1 access_token true Authentication (Access Token) required via login call
Copy CURl Code
CURL Request:
curl -X GET -H "Authorization: Bearer  YTliN2I2M2Q2NTFhNWI4MjJlYWY4OWI0OTlmOGE4NGRiNjdiOTgzMWU3ZGQwYTRkZmNhNjc3MjczNzFjNjkyZQ"
               "https://www.marstranslation.com/api/v2/user/logout?access_token={{ACCESS-TOKEN}}"
JSON Response:
{
  "message": "Logged Out successfully"
}

Languages

Get Source Languages

URL :https://www.marstranslation.com/api/v2/public/language/list

Method : GET

Explanation:

Get Source languages method will return all the supported source langugages. Code returned in response will be used a source language identifier for any future calls.

Headers :
# Name Required Description
1 clientId true {{PUT CLIENT KEY HERE}}
2 clientSecret true {{PUT CLIENT SECRET HERE}}
Copy CURl Code
CURL Request:
curl -X GET -H "clientId: {{PUT CLIENT KEY HERE}}"
            -H "clientSecret: {{PUT CLIENT SECRET HERE}}"
            "https://www.marstranslation.com/api/v2/public/language/list"
JSON Response:
{
  "source_languages": [
    {
      "id": 5,
      "name": "Arabic",
      "code": "ara",
      "flag": "https://s3.amazonaws.com/marstranslation.aws.bucket/flag/0001/01/baccb2309f8fcb793d0fc8edf0d72cda59aa7ab7.jpeg"
    },
    {
      "id": 15,
      "name": "Bulgarian",
      "code": "bul",
      "flag": "https://s3.amazonaws.com/marstranslation.aws.bucket/flag/0001/01/a5e2c2f126b711ec771aea0f036b7407900b4e18.jpeg"
    },
    {
      "id": 121,
      "name": "Burmese",
      "code": "mya",
      "flag": "https://s3.amazonaws.com/marstranslation.aws.bucket/default/0001/01/526489ff5f844065c9934ef3bad8d8c7765255a1.jpeg"
    },
    .
    .
    .

  ]
}

Get Target Languages

URL : https://www.marstranslation.com/api/v2/public/language/list

Method : GET

Explanation:

Allows user to get all target languages against source language iso639-3 code obtained in source language call.

Headers :
# Name Required Description
1 clientId true {{PUT CLIENT KEY HERE}}
2 clientSecret true {{PUT CLIENT SECRET HERE}}
Parameters :
# Name Required Description
1 language_code false iso639-3 Language code obtained in source language call.
Copy CURl Code
CURL Request:
curl -X GET -H "clientId: {{PUT CLIENT KEY HERE}}"
            -H "clientSecret: {{PUT CLIENT SECRET HERE}}"
            "https://www.marstranslation.com/api/v2/public/language/list?language_code=eng"
JSON Response:
{
  "target_languages": [
    {
      "id": 17,
      "name": "Chinese Simplified (Mandarin)",
      "code": "zho",
      "price": 0.05,
      "flag": "https://s3.amazonaws.com/marstranslation.aws.bucket/flag/0001/01/1981f1b425dbd0d3c09420eb521ab2415e09ecde.jpeg"
    },
    {
      "id": 18,
      "name": "Chinese Traditional",
      "code": "cmn",
      "price": 0.08,
      "flag": "https://s3.amazonaws.com/marstranslation.aws.bucket/flag/0001/01/cf8a39b18ffcb4bf30045064206d5b90372ebe94.jpeg"
    },
    {
      "id": 26,
      "name": "English",
      "code": "eng",
      "price": 0.08,
      "flag": "https://s3.amazonaws.com/marstranslation.aws.bucket/flag/0001/01/4f477d38f4a71a9eb7512a38488c4901b25ccf1e.jpeg"
    }
  ]
}

Industries

Get Industries

URL : https://www.marstranslation.com/api/v2/public/industries/list

Method : GET

Explanation :


Get industries provide list of all supported industries. code returned in the industry response will be used for any future reference for industries i.e. While creating new project.

Headers :
# Name Required Description
1 clientId true {{PUT CLIENT KEY HERE}}
2 clientSecret true {{PUT CLIENT SECRET HERE}}
Copy CURl Code
CURL Request:
curl -X GET -H "clientId: {{PUT CLIENT KEY HERE}}"
            -H "clientSecret: {{PUT CLIENT SECRET HERE}}"
               "https://www.marstranslation.com/api/v2/public/industries/list"
JSON Response:
{
  "industries": [
    {
      "id": 1,
      "name": "General",
      "code": "gn"
    },
    {
      "id": 2,
      "name": "Advertising / Marketing",
      "code": "adm"
    },
    {
      "id": 7,
      "name": "Automotive",
      "code": "am"
    },
    .
    .
    .
  ]
}

Projects

Create a Project

URL :https://www.marstranslation.com/api/v2/projects/orders/places

Method : POST

Explanation :


Create a project call is used for creating a new project.

Requirements :
# Name Required Description
1 access_token true Authentication (Access Token) required via login call
Parameters :
# Name Required Description
1 source_language_code true iso639-3 Language code
2 target_language_code true iso639-3 Language code
3 industry_id true Mars has list of active industries. This value should be the id of some Industry.
4 num_of_words true Total number of words of a project.
5 source_file true/false Comma separated source file absolute URL path obtained from get quote API.

Source file or text must be provided in order to create a new project.

6 text true/false Source translation text.
7 translation_type false Default value=2. Valid values 1=Document translation, 2=Instant translation and 3=Audio translation and 4=Website Translation
8 package_type false Default value is EP=Economy Package. It will be EP=Economy Package or PP=Professional Package
9 gross_price false It is required when translation type is equal to 4
10 show_task_details false if you give "yes" then it will return with task details.
Copy CURl Code
CURL Request:
curl -X POST -H "Content-Type: multipart/form-data; boundary=----WebKitFormBoundary7MA4YWxkTrZu0gW"
             -F "source_language_code=eng"
             -F "target_language_code=ara"
             -F "industry_id=2"
             -F "num_of_words=150"
             -F "text=source text"
             -F "package_type=EP"
             -F "translation_type=4"
             -F "gross_price=100"
                "https://www.marstranslation.com/api/v2/projects/orders/places?access_token={{ACCESS-TOKEN}}"
JSON Response:
{
  "task_id": [
    {
      "id": "610"
    }
  ],
  "order_id": 648
}

Cancel a Project

URL : https://www.marstranslation.com/api/v2/projects/orders/cancel

Method : DELETE

Explanation :


Allows User to cancel a project.

Requirements :
# Name Required Description
1 access_token true Authentication (Access Token) required via login call
Parameters :
# Name Required Description
1 order_id true Project/Order Id
Copy CURl Code
CURL Request:
curl -X DELETE -H "Content-Type: application/x-www-form-urlencoded"
               -d 'order_id=653'
                  "https://www.marstranslation.com/api/v2/projects/order/cancel?access_token={{ACCESS-TOKEN}}"
JSON Response:
{
  "message": "Successfully cancelled"
}

Projects List

URL : https://www.marstranslation.com/api/v2/projects/list

Method : GET

Explanation :


Allows User to get all his created projects.

Requirements :
# Name Required Description
1 access_token true Authentication (Access Token) required via login call
Parameters :
# Name Required Description
1 translation_type false Comma separated values Default value=2,3. Valid values : 1=Document translation, 2=Instant translation and 3=Audio translation and 4=Website Translation
2 status false Valid values are pending, in_progress, completed
3 page false Page number for pagination.
4 records_per_page false default=10, number of pages record
Copy CURl Code
CURL Request:
curl -X GET "https://www.marstranslation.com/api/v2/projects/list?access_token={{ACCESS-TOKEN}}&translation_type=2,3"
JSON Response:
{
  "pending": {
    "0": {
      "client_id": 9,
      "translation_type": 3,
      "length": 150,
      "order_id": 336,
      "task_delivery_date": "2016-05-30T14:58:07+0800",
      "time_in_minutes": 50,
      "task_time_string": "50 Mins",
      "display_id": 331,
      "task_status": "Waiting for Translation",
      "status_id": 5,
      "task_id": 363,
      "type": 1,
      "source_language_code": "eng",
      "task_created_date": "2016-05-30T14:05:37+0800",
      "target_language_code": "ara",
      "industry": "Advertising / Marketing",
      "target_language": "Arabic",
      "source_language": "English",
      "package_type": "Economy Package",
      "package_type_code": "EP"
    },
    .
    .
    .
    "9": {
      "client_id": 9,
      "translation_type": 2,
      "length": 150,
      "order_id": 123,
      "task_delivery_date": "2016-04-21T20:13:53+0800",
      "time_in_minutes": 50,
      "task_time_string": "50 Mins",
      "display_id": 174,
      "task_status": "Waiting for Translation",
      "status_id": 5,
      "task_id": 183,
      "type": 1,
      "source_language_code": "eng",
      "task_created_date": "2016-04-19T16:01:51+0800",
      "target_language_code": "ara",
      "industry": "Advertising / Marketing",
      "target_language": "Arabic",
      "source_language": "English",
      "package_type": "Economy Package",
      "package_type_code": "EP"
    },
    "pages": {
      "current_page": 1,
      "next_page": 2,
      "previous_page": 0,
      "total_pages": 11,
      "records_per_page": 10
    }
  },

  "completed": {
    "0": {
      "client_id": 9,
      "translation_type": 2,
      "length": 150,
      "order_id": 360,
      "task_delivery_date": "2016-06-01T14:07:05+0800",
      "time_in_minutes": 75,
      "task_time_string": "1 Hr 15 Mins",
      "display_id": 353,
      "task_status": "Ready Proof Reading",
      "status_id": 9,
      "task_id": 396,
      "type": 1,
      "source_language_code": "eng",
      "task_created_date": "2016-06-01T13:14:04+0800",
      "target_language_code": "ara",
      "industry": "Advertising / Marketing",
      "target_language": "Arabic",
      "source_language": "English",
      "package_type": "Professional Package",
      "package_type_code": "PP"
    },
    .
    .
    .
    "9": {
      "client_id": 9,
      "translation_type": 3,
      "length": 150,
      "order_id": 340,
      "task_delivery_date": "2016-05-30T15:40:09+0800",
      "time_in_minutes": 50,
      "task_time_string": "50 Mins",
      "display_id": 335,
      "task_status": "Waiting for Client Approval",
      "status_id": 11,
      "task_id": 369,
      "type": 1,
      "source_language_code": "eng",
      "task_created_date": "2016-05-30T14:48:16+0800",
      "target_language_code": "ara",
      "industry": "Advertising / Marketing",
      "target_language": "Arabic",
      "source_language": "English",
      "package_type": "Economy Package",
      "package_type_code": "EP"
    },
    "pages": {
      "current_page": 1,
      "next_page": 2,
      "previous_page": 0,
      "total_pages": 2,
      "records_per_page": 10
    }
  }
}

Get Task Details

URL : https://www.marstranslation.com/api/v2/projects/task/details

Method : GET

Explanation :


Allows User to get Task details.

Requirements :
# Name Required Description
1 access_token true Authentication (Access Token) required via login call
Parameters :
# Name Required Description
1 task_id true Task Id
Copy CURl Code
CURL Request:
curl -X GET "https://www.marstranslation.com/api/v2/projects/task/detailsaccess_token={{ACCESS-TOKEN}}&task_id=396"
JSON Response:
{
  "length": 150,
  "client_id": "9",
  "translation_type": 2,
  "package_type": "Professional Package",
  "order_id": 360,
  "status_id": 9,
  "date_created": "2016-06-01T13:14:03+0800",
  "date_updated": "2016-06-01T13:17:05+0800",
  "time_in_minutes": 50,
  "total_time_in_minutes": 75,
  "task_delivery_date": "2016-06-01T14:07:05+0800",
  "source_flag": "https://s3.amazonaws.com/marstranslation.aws.bucket/flag/0001/01/baccb2309f8fcb793d0fc8edf0d72cda59aa7ab7.jpeg",
  "target_flag": "https://s3.amazonaws.com/marstranslation.aws.bucket/flag/0001/01/baccb2309f8fcb793d0fc8edf0d72cda59aa7ab7.jpeg",
  "task_type": 1,
  "task_status": "Ready Proof Reading",
  "invalid_translators": [],
  "user_id": "11",
  "task_id": 396,
  "display_id": 353,
  "source_language_code": "eng",
  "target_language_code": "ara",
  "industry": "Advertising / Marketing",
  "industry_id": "2",
  "target_language_id": 5,
  "source_language_id": 26,
  "client_price": 16.59,
  "target_language": "Arabic",
  "source_language": "English",
  "translator_name": "M faizan altaf",
  "translator_id": 11,
  "proofreader_rating": {
    "rate": 0,
    "comments": ""
  },
  "client_rating": {
    "rate": 0,
    "comments": ""
  },
  "file": {
    "source_file": [
      {
        "id": 967,
        "name": "Free Text.txt",
        "user_id": 9,
        "length": 150,
        "location": "https://s3.amazonaws.com/marstranslation.aws.bucket/flag/0001/01/baccb2309f8fcb793d0fc8edf0d72cda59aa7ab7.jpeg",
        "date_created": "2016-06-01T13:14:03+0800"
      }
    ],
    "translation_file": {
      "967": {
        "id": 969,
        "name": "895397384.txt",
        "user_id": 11,
        "length": 0,
        "location": "https://s3.amazonaws.com/marstranslation.aws.bucket/flag/0001/01/baccb2309f8fcb793d0fc8edf0d72cda59aa7ab7.jpeg",
        "date_created": "2016-06-01T13:17:26+0800"
      }
    }
  }
}

Create and save Project

URL : https://www.marstranslation.com/api/v2/projects/orders/saves

Method : POST

Explanation :


Allows User to create and save a project. After this call you need to call confirm and pay for this project.

Requirements :
# Name Required Description
1 access_token true Authentication (Access Token) required via login call
Parameters :
# Name Required Description
1 source_language_code true iso639-3 Language code
2 target_language_code true iso639-3 Language code
3 industry_id true Mars has list of active industries. This value should be the id of some Industry.
4 num_of_words true Total number of words of a project.
5 source_file false Comma separated source file path
6 text false Text of project for translation. You can also upload source file through above parameter.
7 translation_type false Default value=2. Valid values 1=Document translation, 2=Instant translation and 3=Audio translation and 4=Website Translation
8 package_type false Default value is EP=Economy Package. It will be EP=Economy Package or PP=Professional Package
9 gross_price true It is required when translation type is equal to 4
Copy CURl Code
CURL Request:
curl -X POST -H "Content-Type: multipart/form-data; boundary=----WebKitFormBoundary7MA4YWxkTrZu0gW"
             -F "source_language_code=eng"
             -F "target_language_code=ara"
             -F "industry_id=2"
             -F "num_of_words=150"
             -F "text=source text"
             -F "package_type=EP"
             -F "translation_type=4"
             -F "gross_price=100"
                "https://www.marstranslation.com/api/v2/projects/orders/saves?access_token={{ACCESS-TOKEN}}"
JSON Response:
{
  "order_id": 654,
  "num_of_words": 150,
  "price": 100
}

Confirm and Pay Project

URL : https://www.marstranslation.com/api/v2/project/order/confirm

Method : PUT

Explanation :


Allows User to confirm and pay for a project.

Requirements :
# Name Required Description
1 access_token true Authentication (Access Token) required via login call
Parameters :
# Name Required Description
1 orderId true Project/Order Id
Copy CURl Code
CURL Request:
curl -X PUT -H "Content-Type: application/x-www-form-urlencoded"
            -d 'orderId=600'
               "https://www.marstranslation.com/app_dev.php/api/v2/project/order/confirm?access_token={{ACCESS-TOKEN}}"&orderId=653
JSON Response:
{
  "order_id": 654,
  "num_of_words": 150,
  "price": 100
}

Get Project Details

URL : https://www.marstranslation.com/api/v2/projects/order/details

Method : GET

Explanation :


Allows User to get Project details.

Requirements :
# Name Required Description
1 access_token true Authentication (Access Token) required via login call
Parameters :
# Name Required Description
1 orderId true Project/Order Id
Copy CURl Code
CURL Request:
curl -X GET "https://www.marstranslation.com/api/v2/projects/order/details?access_token={{ACCESS-TOKEN}}&orderId=142"
JSON Response:
{
  "id": 142,
  "user_id": 9,
  "user_email": "example@gmail.com",
  "source_language": {
    "id": 26,
    "name": "English"
  },
  "target_language": [
    {
      "id": 5,
      "name": "Arabic"
    },
    {
      "id": 6,
      "name": "Armenian"
    }
  ],
  "task_detail_id": [],
  "industry": "General",
  "word_count": 160,
  "price": 34.88,
  "package_type": "EP",
  "delivery_type": "Normal Delivery",
  "is_paid": false,
  "service": true,
  "files": [
    {
      "id": 482,
      "name": "Free Text.txt",
      "user_id": 9,
      "length": 160,
      "language_name": "English",
      "location": "https://s3.amazonaws.com/marstranslation.aws.bucket/flag/0001/01/1981f1b425dbd0d3c09420eb521ab2415e09ecde.jpeg",
      "date_created": "2016-04-25T20:10:43+0800"
    },
    {
      "id": 483,
      "name": "Free Text_Arabic.txt",
      "user_id": 9,
      "length": 160,
      "language_name": "Arabic",
      "location": "https://s3.amazonaws.com/marstranslation.aws.bucket/flag/0001/01/1981f1b425dbd0d3c09420eb521ab2415e09ecde.jpeg",
      "date_created": "2016-04-25T20:10:43+0800"
    },
    {
      "id": 484,
      "name": "Free Text_Armenian.txt",
      "user_id": 9,
      "length": 160,
      "language_name": "Armenian",
      "location": "https://s3.amazonaws.com/marstranslation.aws.bucket/flag/0001/01/1981f1b425dbd0d3c09420eb521ab2415e09ecde.jpeg",
      "date_created": "2016-04-25T20:10:43+0800"
    }
  ],
  "date_created": "2016-04-25T20:10:43+0800"
}

Get word count of Text

URL : https://www.marstranslation.com/api/v2/public/projects/wordcounts/texts

Method : POST

Explanation :


This method is used for getting total word count of given text.

Headers :
# Name Required Description
1 clientId true {{PUT CLIENT KEY HERE}}
2 clientSecret true {{PUT CLIENT SECRET HERE}}
Parameters :
# Name Type Required Description
1 text string true text for word counts
Copy CURl Code
CURL Request:
curl -X POST -H "clientId: {{PUT CLIENT KEY HERE}}"
             -H "clientSecret: {{PUT CLIENT SECRET HERE}}"
             -H "Content-Type: multipart/form-data; boundary=----WebKitFormBoundary7MA4YWxkTrZu0gW"
             -F "text=Lorem ipsum dolor sit amet, consectetuer adipiscing elit."
                "https://www.marstranslation.com/api/v2/public/projects/wordcounts/texts"
JSON Response:
{
  "word_count": 8
}

Words Count of a File

URL : https://www.marstranslation.com/api/v2/public/projects/wordcounts/files

Method : POST

Explanation :


This call is used for getting word count of any file. "file_path" and "word_count" returned in the response will be used in "Create Project" call.

Headers :
# Name Required Description
1 clientId true {{PUT CLIENT KEY HERE}}
2 clientSecret true {{PUT CLIENT SECRET HERE}}
Parameters :
# Name Type Required Description
1 file file true Upload a file
Copy CURl Code
CURL Request:
curl -X POST -H "clientId: {{PUT CLIENT KEY HERE}}"
             -H "clientSecret: {{PUT CLIENT SECRET HERE}}"
             -H "Content-Type: multipart/form-data; boundary=----WebKitFormBoundary7MA4YWxkTrZu0gW"
             -F "file=@"
             -F "="
                "https://www.marstranslation.com/api/v2/public/projects/wordcounts/files"
JSON Response:
{
  "word_count": 941,
  "file_path": "https://s3.amazonaws.com/marstranslation.aws.bucket/default/0001/01/526489ff5f844065c9934ef3bad8d8c7765255a1.jpeg"
}

Get Status of Project

URL :https://www.marstranslation.com/api/v2/projects/tasks/statuses

Method : POST

Explanation :


Get Status of Project call is used for get current status of a project.

Requirements :
# Name Required Description
1 access_token true Authentication (Access Token) required via login call
Parameters :
# Name Required Description
1 task_statuses_ids true JSON Format Like this [{ "id": "2662", "status": "Waiting for Translation" }, { "id": "2663", "status": "Waiting for Translation" }, { "id": "2665", "status": "Waiting for Translation" }]
Copy CURl Code
CURL Request:
curl -X POST -H "Content-Type: multipart/form-data; boundary=----WebKitFormBoundary7MA4YWxkTrZu0gW"
             -F "task_statuses_ids=[{  \"id\": \"791\",  \"status\": \"working\" }, {  \"id\": \"793\",  \"status\": \"Waiting for Translation\" }, {  \"id\": \"793\",  \"status\": \"Waiting for Translation\" }]"
                "http://www.marstranslation.com/api/v2/projects/tasks/statuses?access_token={{ACCESS-TOKEN}}"
JSON Response:
[
  {
    "length": 150,
    "client_id": "9",
    "translation_type": 4,
    "package_type": "Professional Package",
    "order_id": 766,
    "status_id": 5,
    "date_created": "2016-10-24T15:04:30+0800",
    "date_updated": "2016-10-24T15:04:31+0800",
    "time_in_minutes": 50,
    "total_time_in_minutes": 75,
    "source_flag": "http://local.marstranslation.com/uploads/media/flag/0001/01/4f477d38f4a71a9eb7512a38488c4901b25ccf1e.jpeg",
    "target_flag": "http://local.marstranslation.com/uploads/media/flag/0001/01/1767e3c3c7b78528f5fe5cad74ae53085d63e35a.jpeg",
    "task_type": 1,
    "task_status": "Waiting for Translation",
    "invalid_translators": [],
    "task_id": 791,
    "display_id": 719,
    "source_language_code": "eng",
    "target_language_code": "ara",
    "industry": "Advertising / Marketing",
    "industry_id": "2",
    "target_language_id": 5,
    "source_language_id": 26,
    "client_price": 16.65,
    "target_language": "Arabic",
    "source_language": "English",
    "proofreader_rating": {
      "rate": 0,
      "comments": ""
    },
    "client_rating": {
      "rate": 0,
      "comments": ""
    },
    "file": {
      "source_file": [
        {
          "id": 2412,
          "name": "Free Text.txt",
          "user_id": 9,
          "length": 150,
          "location": "http://local.marstranslation.com/uploads/media/project_files/0001/05/be1e3e8b97b6e9fec02b092837cd479fcb8d5471.txt",
          "date_created": "2016-10-24T15:04:30+0800"
        }
      ]
    }
  }
]

Ratings

Get Rating Details

URL : https://www.marstranslation.com/api/v2/ratings/details

Method : GET

Explanation :


This call is used for getting rating details of a task.

Requirements :
# Name Required Description
1 access_token true Authentication (Access Token) required via login call
Copy CURl Code
CURL Request:
curl -X GET "https://www.marstranslation.com/api/v2/ratings/details?access_token={{ACCESS-TOKEN}}&task_id=14"
JSON Response:
{
  "proofreader_rating": {
    "rate": 4.5,
    "comments": "excellent work.",
    "rateType": 1,
    "user": "4",
    "task": "350"
  }
}

Rate a project task

URL : https://www.marstranslation.com/api/v2/ratings/rates

Method : POST

Explanation :


This call will be used to give rating to a task.

Requirements :
# Name Required Description
1 access_token true Authentication (Access Token) required via login call
Parameters :
# Name Required Description
1 task_id true Project Task Id
2 rating true rating out of 5
3 comments true Comments/Message
Copy CURl Code
CURL Request:
curl -X POST -H "Content-Type: multipart/form-data; boundary=----WebKitFormBoundary7MA4YWxkTrZu0gW"
             -F "task_id=21"
             -F "rating=4.5"
             -F "comments=excellent work"
                "https://www.marstranslation.com/api/v2/ratings/rates?access_token={{ACCESS-TOKEN}}"
JSON Response:
{
  "message": "Rated successfully"
}

Messages/Discussion

Send Message

URL : https://www.marstranslation.com/api/v2/messages/sends

Method : POST

Explanation :


This method will be used by user to send a discussion message for a task. Phone number, Emails and some restricted words as below will be filter/removed automatically if entered.
Restricted words: 'id', 'contact', 'email', 'num', 'emailaddress', 'phone', 'cell', 'phone#', 'phonenum', 'phonenumber', 'mobile', 'call', 'call me', 'skype', 'skypeaddress', 'address'

Requirements :
# Name Required Description
1 access_token true Authentication (Access Token) required via login call
Parameters :
# Name Required Description
1 task_id true Project Task Id
2 message true Comments/Message
Copy CURl Code
CURL Request:
curl -X POST -H "Content-Type: multipart/form-data; boundary=----WebKitFormBoundary7MA4YWxkTrZu0gW"
             -F "task_id=14"
             -F "message=Hello, Task discussion here"
                "https://www.marstranslation.com/api/v2/messages/sends?access_token={{ACCESS-TOKEN}}"
JSON Response:
{
  "message": "Successfully sent message"
}

Get Discussions

URL : https://www.marstranslation.com/api/v2/messages/discussions

Method : GET

Explanation :


This call will be used to get all discussion messages of a task.

Requirements :
# Name Required Description
1 access_token true Authentication (Access Token) required via login call
Headers :
# Name Required Description
1 task_id true Project Task Id
Copy CURl Code
CURL Request:
curl -X GET "https://www.marstranslation.com/api/v2/messages/discussions?access_token={{ACCESS-TOKEN}}&task_id=14"
JSON Response:
[
  {
    "user_id": 9,
    "first_name": "user",
    "last_name": "user",
    "message": "Hello, Task discussion here",
    "date_created": "2016-03-15T17:34:31+0800",
    "role": [
      "ROLE_CLIENT"
    ]
  },
  {
    "user_id": 9,
    "first_name": "user",
    "last_name": "user",
    "message": "Hello, Task discussion here",
    "date_created": "2016-03-15T17:34:43+0800",
    "role": [
      "ROLE_CLIENT"
    ]
  }
]

Notifications

Send Message

URL : https://www.marstranslation.com/api/v2/public/notifications/pushes

Method : POST

Explanation :


Allows user to push Notification on Mobile App.

Parameters :
# Name Required Description
1 email true Email of user where you want to push notification
2 pushMessage true Json Format Push message
Headers :
# Name Required Description
1 clientId true {{PUT CLIENT ID HERE}}
2 clientSecret true {{PUT CLIENT SECRET HERE}}
Copy CURl Code
CURL Request:
curl -X POST -H "Content-Type: multipart/form-data; boundary=----WebKitFormBoundary7MA4YWxkTrZu0gW"
             -F "email=example@gmail.com"
             -F "pushMessage={   \"message\": \"Successfully sent message\" }"
                "http://www.marstranslation.com/api/v2/public/notifications/pushes"
JSON Response:
{
  "response": true
}

Users

Get User Details

URL : https://www.marstranslation.com/api/v2/user/details

Method : POST

Explanation :


This method will be used to get detail of any user with access_token or user_id.

Requirements :
# Name Required Description
1 access_token true Authentication (Access Token) required via login call
Parameters :
# Name Required Description
1 user_id false User Id. If this id is null then this call will returns logged in user details otherwise it will return according to given user id.
Copy CURl Code
CURL Request:
curl -X GET "http://www.marstranslation.com/api/v2/user/details?access_token={{ACCESS-TOKEN}}&user_id=15"
JSON Response:
{
  "user_id": 9,
  "first_name": "user",
  "last_name": "user",
  "email": "example@gmail.com",
  "phone": "123456789",
  "picture": "default.png",
  "credit": "84446.98",
  "skype_id": "skypename",
  "twitter_id": "twitterid",
  "linkedIn_id": "linkedin",
  "is_translator": false,
  "industries": [],
  "language_pairs_detail": [],
  "certifications": []
}

Get User Credits

URL : https://www.marstranslation.com/api/v2/user/credit/details

Method : GET

Explanation :


This method will return available Mars credits.

Requirements :
# Name Required Description
1 access_token true Authentication (Access Token) required via login call
Copy CURl Code
CURL Request:
curl -X GET -H "Authorization: Bearer  YTliN2I2M2Q2NTFhNWI4MjJlYWY4OWI0OTlmOGE4NGRiNjdiOTgzMWU3ZGQwYTRkZmNhNjc3MjczNzFjNjkyZQ"
            "https://www.marstranslation.com/api/v2/user/credit/details?access_token={{ACCESS-TOKEN}}"
JSON Response:
{
  "credit": "84446.98"
}

Transactions

Get Transactions

URL : https://www.marstranslation.com/api/v2/transaction/list

Method : GET

Explanation :


Allows user to get all transactions.

Requirements :
# Name Required Description
1 access_token true Authentication (Access Token) required via login call
Parameters :
# Name Required Description
1 page false Page number for pagination
2 records_per_page false default=10, number of pages record
Copy CURl Code
CURL Request:
curl -X GET "https://www.marstranslation.com/api/v2/transaction/list?access_token={{ACCESS-TOKEN}}&page=2&records_per_page=15"
JSON Response:
{
  "history": {
    "0": {
      "order_id": 637,
      "user_id": 9,
      "type": "Place Order",
      "debit_or_credit": 2,
      "date_created": "2016-08-23T18:50:13+0800",
      "balance": 85346.98,
      "amount": 100,
      "description": "Order#637 placed through credits."
    },
    "1": {
      "order_id": 635,
      "user_id": 9,
      "type": "Place Order",
      "debit_or_credit": 2,
      "date_created": "2016-08-23T18:48:24+0800",
      "balance": 85546.98,
      "amount": 100,
      "description": "Order#635 placed through credits."
    },
    .
    .
    .
    "pages": {
      "current_page": "2",
      "next_page": 3,
      "previous_page": 1,
      "total_pages": 30,
      "records_per_page": 15
    }
  }
}

Promotions

Get Promotions

URL : https://www.marstranslation.com/api/v2/promotions/list

Method : GET

Explanation :


Allows user to get all promotions list.

Requirements :
# Name Required Description
1 access_token true Authentication (Access Token) required via login call
Copy CURl Code
CURL Request:
curl -X GET "https://www.marstranslation.com/api/v2/promotions/list?access_token={{ACCESS-TOKEN}}"
JSON Response:
[
  {
    "id": 2,
    "amount": 650,
    "credit": 4543.5
  },
  {
    "id": 4,
    "amount": 1100,
    "credit": 12089
  },
  {
    "id": 3,
    "amount": 3300,
    "credit": 102267
  },
  {
    "id": 7,
    "amount": 5500,
    "credit": 280445
  },
  {
    "id": 5,
    "amount": 9000,
    "credit": 728910
  }
]

Quotes

Get Quote Price

URL : https://www.marstranslation.com/api/v2/public/quotes/prices

Method : POST

Explanation :


This call is used getting quote for given source language, target language, industry(s), number of words.

Headers :
# Name Required Description
1 clientId true {{PUT CLIENT KEY HERE}}
2 clientSecret true {{PUT CLIENT SECRET HERE}}
Parameters :
# Name Required Description
1 source_language_code true ISO 939-3 Source Language code
2 target_language_code true ISO 939-3 Target Language code comma-seperated mulitiple values
3 industry_code true Industry code
4 number_of_words false If you not give this parameter then u have to give parameter "text".
5 text false If you not give this parameter then u have to give parameter "num_of_words".
Copy CURl Code
CURL Request:
curl -X POST -H "clientId: {{PUT CLIENT KEY HERE}}" -H "clientSecret: {{PUT CLIENT SECRET HERE}}" -H "Content-Type: multipart/form-data; boundary=----WebKitFormBoundary7MA4YWxkTrZu0gW" -F "source_language_code=eng" -F "target_language_code=ara" -F "industry_code=adm" -F "number_of_words=144" "https://www.marstranslation.com/api/v2/public/quotes/prices"
JSON Response:
{
  "economic_package": {
    "price": 11.85,
    "delivery_time_once_start": {
      "translation_time": "50 Mins ",
      "total_time": "50 Mins "
    }
  },
  "professional_package": {
    "price_with_proofreading": 16.65,
    "delivery_time_once_start": {
      "translation_time": "50 Mins ",
      "proofreading_time": "25 Mins ",
      "total_time": "1 Hr 15 Mins "
    }
  }
}