Quick Start Mars Api Documentation

Last updated: Jan 25th, 2016

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
CURL Request:
curl -X POST -H "Cache-Control: no-cache"
             -H "Postman-Token: 6232a935-0607-242c-4f7c-4ed0e71969c7"
             -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
CURL Request:
curl -X GET -H "Authorization: Bearer  YTliN2I2M2Q2NTFhNWI4MjJlYWY4OWI0OTlmOGE4NGRiNjdiOTgzMWU3ZGQwYTRkZmNhNjc3MjczNzFjNjkyZQ"
            -H "Cache-Control: no-cache"
            -H "Postman-Token: 587551e2-a89d-1217-8505-75860bd76324"
               "https://www.marstranslation.com/api/v2/user/logout?access_token=NzMyMzlmYTU3MTJmZjJmNjBlYTM3MWY2MDQxNTc0NmNkNDBhOGU4NjlhNzdlNDI1YWFkMjllNDYzOGI4MTMwNA"
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.

Parameters :
# Name Required Description
1 client_id true {{PUT CLIENT KEY HERE}}
2 client_secret true {{PUT CLIENT SECRET HERE}}
CURL Request:
curl -X GET -H "Cache-Control: no-cache"
            -H "Postman-Token: 791c9b64-21b0-ac36-9d17-7c99c619d683"
               "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.

Parameters :
# Name Required Description
1 language_code false iso639-3 Language code obtained in source language call.
2 client_id true {{PUT CLIENT KEY HERE}}
3 client_secret true {{PUT CLIENT SECRET HERE}}
CURL Request:
curl -X POST -H "Cache-Control: no-cache"
             -H "Postman-Token: 1eafd6fa-8134-3a14-b466-f339fb5c4a2d"
             -H "Content-Type: multipart/form-data; boundary=----WebKitFormBoundary7MA4YWxkTrZu0gW"
             -F "language_code=ara"
                "https://www.marstranslation.com/api/v2/public/language/list"
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.

Parameters :
# Name Required Description
1 client_id true {{PUT CLIENT KEY HERE}}
2 client_secret true {{PUT CLIENT SECRET HERE}}
CURL Request:
curl -X GET -H "Cache-Control: no-cache"
            -H "Postman-Token: 30331122-8874-8dc6-9d19-f16ef35faa85"
               "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.
CURL Request:
curl -X POST -H "Cache-Control: no-cache"
             -H "Postman-Token: bfdaff70-ea91-c1c6-a5cc-512721d7d3cd"
             -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=N2E3YWJmMWEwNjc1ZTM5NjY4YzFmOGRkMDVjMjQxOGE2MWM2MDBhMDYxZDg0ZDU2NjI0M2QzYTUyZTY4OWYwMA"
JSON Response:
{
  "task_id": [
    {
      "id": "610"
    }
  ],
  "order_id": 648
}

Cancel a Project

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

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
CURL Request:
curl -X DELETE -H "Cache-Control: no-cache"
               -H "Postman-Token: 97a3e474-7a59-aae5-7a92-87d1f35c78f0"
               -H "Content-Type: application/x-www-form-urlencoded"
               -d 'order_id=653'
                  "https://www.marstranslation.com/api/v2/projects/order/cancel?access_token=MmJmZWVkNDdiOGVmZDU5M2ZjOTE2MmFkYzYwNzlmOTY4YjRlZDIzMTdiZWIxZjZhNmYxOTg4MzVmMDc4ZWU1OA"
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
CURL Request:
curl -X GET -H "Cache-Control: no-cache"
            -H "Postman-Token: 78703b2c-3224-19d7-215f-371af4e53124"
               "https://www.marstranslation.com/api/v2/projects/list?access_token=NGQwMmMwMjk3MTNmYTAxZDZjMzJjNDk3MzNmMTVjMjg4NjNjNzllMTZjYWUzZDAxOGJlZmEzZGI1OWU4MGFjNA&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
CURL Request:
curl -X GET -H "Cache-Control: no-cache"
            -H "Postman-Token: 7614d648-7a6f-a06f-94f9-8d6a64e44f1c"
               "https://www.marstranslation.com/api/task?access_token=NGQwMmMwMjk3MTNmYTAxZDZjMzJjNDk3MzNmMTVjMjg4NjNjNzllMTZjYWUzZDAxOGJlZmEzZGI1OWU4MGFjNA&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
CURL Request:
curl -X POST -H "Cache-Control: no-cache"
             -H "Postman-Token: bfdaff70-ea91-c1c6-a5cc-512721d7d3cd"
             -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=N2E3YWJmMWEwNjc1ZTM5NjY4YzFmOGRkMDVjMjQxOGE2MWM2MDBhMDYxZDg0ZDU2NjI0M2QzYTUyZTY4OWYwMA"
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
CURL Request:
curl -X PUT -H "Cache-Control: no-cache"
            -H "Postman-Token: 548300f0-fe48-6149-4d0c-e2ae470ba62a"
            -H "Content-Type: application/x-www-form-urlencoded"
            -d 'orderid=600'
               "https://www.marstranslation.com/app_dev.php/api/confirm_orders?access_token=MmJmZWVkNDdiOGVmZDU5M2ZjOTE2MmFkYzYwNzlmOTY4YjRlZDIzMTdiZWIxZjZhNmYxOTg4MzVmMDc4ZWU1OA"
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
CURL Request:
curl -X GET -H "Cache-Control: no-cache"
            -H "Postman-Token: f43f31a0-db45-88f6-b773-658b51723fe1"
               "https://www.marstranslation.com/api/v2/projects/order/details?access_token=MmJmZWVkNDdiOGVmZDU5M2ZjOTE2MmFkYzYwNzlmOTY4YjRlZDIzMTdiZWIxZjZhNmYxOTg4MzVmMDc4ZWU1OA&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/texts3

Method : POST

Explanation :


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

Parameters :
# Name Type Required Description
1 text string true text for word counts
2 client_id string true {{PUT CLIENT KEY HERE}}
3 client_secret string true {{PUT CLIENT SECRET HERE}}
CURL Request:
curl -X POST -H "Cache-Control: no-cache"
             -H "Postman-Token: 99337a5c-3881-71be-a3fd-a812699872ee"
             -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.

Parameters :
# Name Type Required Description
1 file file true Upload a file
2 client_id string true {{PUT CLIENT KEY HERE}}
3 client_secret string true {{PUT CLIENT SECRET HERE}}
CURL Request:
curl -X POST -H "Cache-Control: no-cache"
             -H "Postman-Token: 89d3a4fb-a52e-1a4d-9264-8c17b1f82a71"
             -H "Content-Type: multipart/form-data; boundary=----WebKitFormBoundary7MA4YWxkTrZu0gW"
             -F "file=@"
                "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?access_token={{PUT ACCESS-TOKEN HERE}}

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" }]
CURL Request:
curl -X POST -H "Cache-Control: no-cache"
             -H "Postman-Token: d308b6f1-6ec6-0edf-f846-9f46112d929d"
             -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={{PUT ACCESS-TOKEN HERE}}"
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
CURL Request:
curl -X GET -H "Cache-Control: no-cache"
            -H "Postman-Token: 2dac00bc-dbeb-4627-0416-51f8bacbdc8b"
               "https://www.marstranslation.com/api/v2/ratings/details?access_token=NjhlMGJjN2E5YWUwNjMxYWFkMDc1YTRmYWE1NmRjNmJlNjFiNTMwZmU2MzE0ZjA3MGQ2ZDUwYTY1YWM5NTQ5Yg&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
CURL Request:
curl -X POST -H "Cache-Control: no-cache"
             -H "Postman-Token: 34440c8f-870e-eb0c-8ec6-1c89a220f0c2"
             -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=OWJlZjUwMjFhZjliNWFhZWFmNjY1OWJlY2EyNTY4ODE2NDNlZDc2NTQ2MTViMjQ0Y2JkMmFlOWEyMTMxODJlZA"
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
CURL Request:
curl -X POST -H "Cache-Control: no-cache"
             -H "Postman-Token: c517c722-f055-012c-7b99-e9332f902fca"
             -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=OWJlZjUwMjFhZjliNWFhZWFmNjY1OWJlY2EyNTY4ODE2NDNlZDc2NTQ2MTViMjQ0Y2JkMmFlOWEyMTMxODJlZA"
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
Parameters :
# Name Required Description
1 task_id true Project Task Id
CURL Request:
curl -X GET -H "Cache-Control: no-cache"
            -H "Postman-Token: aa4e24a9-cfb2-bf24-add3-0ffd158ee3b2"
               "https://www.marstranslation.com/api/v2/messages/discussions?access_token=NGMzY2FjNzg0MjYzN2Q3Zjk0MTc3YWJjODg1NGNmYjUwNDMyMTAzYTk2MmU5ZGQzMTQ0YWNiZGU2MjM0NTI5MQ&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
CURL Request:
curl -X POST -H "Cache-Control: no-cache"
             -H "Postman-Token: fa9a1068-dc56-cea4-1a59-97ac0e1b6998"
             -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

Sign Up / Register

URL : https://www.marstranslation.com/api/v2/public/users/registers

Method : POST

Explanation :


This method is used for registering a client user.

Parameters :
# Name Required Description
1 first_name true First Name
2 last_name true Last Name
3 password true Password
4 email true Email Address
5 phone false Phone Number
6 coupon false Coupon Number
7 user_type true Valid user_type value is "client"
CURL Request:
curl -X POST -H "Cache-Control: no-cache"
             -H "Postman-Token: 6ea0979d-572d-a9f7-9978-5908e96ed536"
             -H "Content-Type: multipart/form-data; boundary=----WebKitFormBoundary7MA4YWxkTrZu0gW"
             -F "firstName=user"
             -F "lastName=user"
             -F "pass=123456"
             -F "email=example@gmail.com" -F "phone=123456789" -F "coupon=987654321"
             -F "usertype=client"
                "https://www.marstranslation.com/api/v2/public/users/registers"
JSON Response:
{
  "user_id": 120,
  "first_name": "user",
  "last_name": "user",
  "email": "example@gmail.com",
  "phone": "123456789",
  "picture": "default.png",
  "credit": "0.00",
  "is_translator": false,
  "industries": [],
  "language_pairs_detail": [],
  "certifications": [],
  "access_token": {
    "access_token": "ZDhjYzNiMDRjOTJhN2RlNmIyNDRhZDAzNTI1ZmM3OGM1ZDE5NjFlN2UxZDBkNjJlZjEyOTA4NDRkZTVlOTllYQ",
    "expires_in": 3600,
    "token_type": "bearer",
    "refresh_token": "MWI5OWUzZjE0NTk5M2ZlNDMyMDY1MTIwNzRlMTM5YjExMWQ3YzU4YmIwYTZkM2JhZTc3MTE5MWEyNjExNjM4YQ"
  }
}

Get User Details

URL : https://www.marstranslation.com/api/v2/user/details?access_token={{PUT ACCESS-TOKEN HERE}}&user_id=15

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.
CURL Request:
curl -X GET -H "Cache-Control: no-cache"
            -H "Postman-Token: fda03fac-06ec-2798-7549-59ac98e18f42"
               "http://www.marstranslation.com/api/v2/user/details?access_token=NzMyMzlmYTU3MTJmZjJmNjBlYTM3MWY2MDQxNTc0NmNkNDBhOGU4NjlhNzdlNDI1YWFkMjllNDYzOGI4MTMwNA&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?access_token={{PUT ACCESS-TOKEN HERE}}

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
CURL Request:
curl -X GET -H "Authorization: Bearer  YTliN2I2M2Q2NTFhNWI4MjJlYWY4OWI0OTlmOGE4NGRiNjdiOTgzMWU3ZGQwYTRkZmNhNjc3MjczNzFjNjkyZQ"
            -H "Cache-Control: no-cache"
            -H "Postman-Token: c23f9ccf-b956-e6bf-418c-8a13ac7a2ec7"
            "https://www.marstranslation.com/api/v2/user/credit/details?access_token=ZTE5N2Q4YzY5ZDI2ODcxOWY2Njg4Y2I0NjNiZTVhYWIxZDQ3ZTg5OGVhMzU2NGVlYTU5NDE3YjE2MWFlZGU2ZQ"
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
CURL Request:
curl -X GET -H "Cache-Control: no-cache"
            -H "Postman-Token: 31f4a334-fdf2-833d-9f1d-ec19b7ef3bed"
               "https://www.marstranslation.com/api/transaction?access_token=ODMwYTM2ZGFmYmZmODc1ZDY1MjAzYmMxNDljYjIzY2E0YjQ1NDBjMTkwODA5YzFlMGEzYjM2MzA3Y2I1ZTk1Ng&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
    }
  }
}
<<<<<<< HEAD

Promotions

Get Promotions

URL : httpshttps://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
CURL Request:
curl -X GET -H "Cache-Control: no-cache"
            -H "Postman-Token: 7bb87315-2e0d-a684-8fe3-618178bfc36e"
               "https://www.marstranslation.com/api/v2/promotions/list?access_token=ODMwYTM2ZGFmYmZmODc1ZDY1MjAzYmMxNDljYjIzY2E0YjQ1NDBjMTkwODA5YzFlMGEzYjM2MzA3Y2I1ZTk1Ng"
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/quote/price

Method : GET

Explanation :


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

Parameters :
# Name Required Description
1 client_id true Client Id
2 client_secret true Client Secret
3 source_language_code true ISO 939-3 Source Language code
4 target_language_code true ISO 939-3 Target Language code comma-seperated mulitiple values
5 industry_code true Industry code
6 number_of_words false If you not give this parameter then u have to give parameter "text".
7 text false If you not give this parameter then u have to give parameter "num_of_words".
CURL Request:
curl -X POST -H "Cache-Control: no-cache"
            -H "Postman-Token: e038477b-dda6-b997-a7c9-86e1e85a296d"
            -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=150"
               "https://www.marstranslation.com/api/v2/public/quote/price"
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 "
    }
  }
}