Skip to content
phw edited this page Oct 12, 2012 · 15 revisions

POST /projects

Request: POST /projects

Creates a new project with the state prepared and returns the result. When creating a new project you can set the following attributes:

  • name: The project name (required, can be any non-empty string).
  • due_date: The due date of your project.
  • coupon_name: Redeem a TEXTKING coupon.
  • affiliate_id: Set your TEXTKING Affiliate ID, if you have one.

Request headers

Header Description
Authorize oAuth 2 authentication header
Accept application/json or application/xml
Content-Type The content type of the posted data (application/json or application/xml)

Response status codes

HTTP status Description
201 Created The project was successfully created, the Location header contains the URI of the created project
400 Bad Request The input data was incomplete or contained errors.

Example

Create a new project with the name “My Translation Project” and the due date November 16th 2012:

POST /v1/projects HTTP/1.1
Host: api.textking.com
Accept: application/json
Content-Type: application/json
Authorize: Bearer youraccesstoken

{
    "name": "My Translation Project",
    "due_date": "2012-11-16"
}

Response:

Status code: 201 Created

Content-Type: application/json; charset=utf-8
Location: https://api.textking.com/v1/project/29163f4f-7c8f-4baf-adf3-753c1df429c2
Content-Location: https://api.textking.com/v1/project/29163f4f-7c8f-4baf-adf3-753c1df429c2

{
    "id": "29163f4f-7c8f-4baf-adf3-753c1df429c2",
    "number": null,
    "name": "My Translation Project",
    "due_date": "2012-11-16T00:00:00",
    "state": "prepared",
    "currency": "EUR",
    "net_price": null,
    "vat": null,
    "coupon_name": null,
    "coupon_value": null,
    "discount_customer": null,
    "discount_project": null,
    "affiliate_id": null,
    "billing_address": "9c6f23b6-167d-4b01-977f-4de799e3abf3",
    "links": [
        {
            "rel": "self",
            "href": "https://api.textking.com/v1/project/29163f4f-7c8f-4baf-adf3-753c1df429c2"
        },
        {
            "rel": "urn:textking:jobs",
            "href": "https://api.textking.com/v1/project/29163f4f-7c8f-4baf-adf3-753c1df429c2/jobs"
        },
        {
            "rel": "urn:textking:line_items",
            "href": "https://api.textking.com/v1/project/29163f4f-7c8f-4baf-adf3-753c1df429c2/line-items"
        },
        {
            "rel": "urn:textking:billing_address",
            "href": "https://api.textking.com/v1/account/address/9c6f23b6-167d-4b01-977f-4de799e3abf3"
        }
    ]
}
Clone this wiki locally