GET Line Items - TextKing/textking-api GitHub Wiki

GET /project/{projectId}/line-items

Request: GET /project/{projectId}/line-items

Returns a collection of additional line items for a project. Additional line items will be included for a project, if TEXTKING is offering additional services, e.g. express delivery, for the project despite translation jobs. Currently you can not request additional services via the API, but projects created for you by the TEXTKING sales team will probably contain additional line items.

Query parameters

Parameter Description
per_page An integer value defining how many entries should be returned. Only values between 1 and 100 (both inclusive) are allowed. If not given, this defaults to 100.
page Return search results starting at a given page. Used for paging through more than one page of results.

Request headers

Header Description
Authorization oAuth 2 authentication header
Accept application/json or application/xml

Response status codes

HTTP status Description
200 Ok Successful request.
400 Bad Request The project ID is not a valid UUID.
404 Not Found The project with the given ID does not exist.

Example

Load the additional line items for the project with the ID 74114f98-49fd-488c-a244-701d2683bc6d:

GET /v1/project/74114f98-49fd-488c-a244-701d2683bc6d/line-items HTTP/1.1
Host: api.textking.com
Accept: application/json
Authorization: Bearer youraccesstoken

Response:

HTTP/1.1 200 Ok
Content-Type: application/json; charset=utf-8

{
    "page": 1,
    "per_page": 100,
    "total": 2,
    "items": [
        {
            "id": "179fdaf4-9902-4872-b884-5594f74c6312",
            "description": "Attestation",
            "currency": "EUR",
            "value": 45.59,
            "links": [
                {
                    "rel": "urn:textking:project",
                    "href": "https://api.textking.com/v1/project/74114f98-49fd-488c-a244-701d2683bc6d"
                }
            ]
        },
        {
            "id": "c985fc7e-4a0a-4a25-bda2-7e3e7f78a70b",
            "description": "Express delivery",
            "currency": "EUR",
            "value": 21.39,
            "links": [
                {
                    "rel": "urn:textking:project",
                    "href": "https://api.textking.com/v1/project/74114f98-49fd-488c-a244-701d2683bc6d"
                }
            ]
        }
    ],
    "links": [
        {
            "rel": "self",
            "href": "https://api.textking.com/v1/project/74114f98-49fd-488c-a244-701d2683bc6d/line-items?page=1&per_page=100"
        }
    ]
}
⚠️ **GitHub.com Fallback** ⚠️