Text positions API

Introduction

Text positions can be used on the following resources: estimates, orders and invoices. The resource URL is built like this:

/%parent_resource%/%parent_id%/kb_position_text

If you have an invoice with ID 4 you should replace the placeholder %parent_resource% with kb_invoice and replace the placeholder %parent_id% with 4. Estimates will be used in the upcomming examples.

List text positions

GET /kb_offer/1/kb_position_text
Accept: application/json
Authorization: Bearer 677a1598d208d6c303fa5ca1c774709250e21749
Name Required Type Description
order_by optional string Sorting
limit optional integer Limit
offset optional integer Offset
callback optional string Javascript callback

The following sort parameters may be applied:

  • id

The following scopes are needed:

  • kb_invoice_edit
  • kb_offer_edit
  • kb_order_edit
  • kb_bill_edit
Status: 200 OK
X-Authenticated-User: apiextract_1
Content-Length: 289
Content-Type: application/json
[
  {
    "id": 1,
    "type": "KbPositionText",
    "text": "Geschnitten geliefert",
    "show_pos_nr": true,
    "pos": "4",
    "internal_pos": 4,
    "parent_id": null,
    "is_optional": false
  },
  {
    "id": 8,
    "type": "KbPositionText",
    "text": "Beispielstext",
    "show_pos_nr": false,
    "pos": null,
    "internal_pos": 8,
    "parent_id": null,
    "is_optional": false
  }
]

Search text positions

POST /kb_offer/1/kb_position_text/search
Accept: application/json
Authorization: Bearer 677a1598d208d6c303fa5ca1c774709250e21749
[
  {
    "field": "text",
    "value": "geliefert"
  }
]
Name Required Type Description
order_by optional string Sorting
limit optional integer Limit
offset optional integer Offset
callback optional string Javascript callback

The following sort parameters may be applied:

  • id
Name Required Type Description
text optional string
show_pos_nr optional string

The following scopes are needed:

  • kb_invoice_edit
  • kb_offer_edit
  • kb_order_edit
  • kb_bill_edit
Status: 200 OK
X-Authenticated-User: apiextract_1
Content-Length: 148
Content-Type: application/json
[
  {
    "id": 1,
    "type": "KbPositionText",
    "text": "Geschnitten geliefert",
    "show_pos_nr": true,
    "pos": "4",
    "internal_pos": 4,
    "parent_id": null,
    "is_optional": false
  }
]

Show text position

GET /kb_offer/1/kb_position_text/8
Accept: application/json
Authorization: Bearer 677a1598d208d6c303fa5ca1c774709250e21749
Name Required Type Description
callback optional string Javascript callback

The following scopes are needed:

  • kb_invoice_edit
  • kb_offer_edit
  • kb_order_edit
  • kb_bill_edit
Status: 200 OK
X-Authenticated-User: apiextract_1
Content-Length: 140
Content-Type: application/json
{
  "id": 8,
  "type": "KbPositionText",
  "text": "Beispielstext",
  "show_pos_nr": false,
  "pos": null,
  "internal_pos": 8,
  "parent_id": null,
  "is_optional": false
}

Create text position

POST /kb_offer/1/kb_position_text
Accept: application/json
Authorization: Bearer 677a1598d208d6c303fa5ca1c774709250e21749
{
  "text": "Beispielstext"
}
Name Required Type Description
callback optional string Javascript callback
Name Required Type Description
text required string (5000)
show_pos_nr optional boolean

The following scopes are needed:

  • kb_invoice_edit
  • kb_offer_edit
  • kb_order_edit
  • kb_bill_edit
Status: 201 Created
X-Authenticated-User: apiextract_1
Content-Length: 140
Content-Type: application/json
{
  "id": 8,
  "type": "KbPositionText",
  "text": "Beispielstext",
  "show_pos_nr": false,
  "pos": null,
  "internal_pos": 8,
  "parent_id": null,
  "is_optional": false
}

Overwrite text position

PUT /kb_offer/1/kb_position_text/8
Accept: application/json
Authorization: Bearer 677a1598d208d6c303fa5ca1c774709250e21749
{
  "text": "Beispielstext"
}
Name Required Type Description
callback optional string
Name Required Type Description
text required string (5000)
is_optional optional boolean
show_pos_nr optional boolean

The following scopes are needed:

  • kb_invoice_edit
  • kb_offer_edit
  • kb_order_edit
  • kb_bill_edit
Status: 200 OK
X-Authenticated-User: apiextract_1
Content-Length: 140
Content-Type: application/json
{
  "id": 8,
  "type": "KbPositionText",
  "text": "Beispielstext",
  "show_pos_nr": false,
  "pos": null,
  "internal_pos": 8,
  "parent_id": null,
  "is_optional": false
}

Edit text position

POST /kb_offer/1/kb_position_text/8
Accept: application/json
Authorization: Bearer 677a1598d208d6c303fa5ca1c774709250e21749
{
  "text": "Beispielskommentar"
}
Name Required Type Description
callback optional string Javascript callback
Name Required Type Description
is_optional optional boolean
show_pos_nr optional boolean
text optional string (5000)

The following scopes are needed:

  • kb_invoice_edit
  • kb_offer_edit
  • kb_order_edit
  • kb_bill_edit
Status: 200 OK
X-Authenticated-User: apiextract_1
Content-Length: 145
Content-Type: application/json
{
  "id": 8,
  "type": "KbPositionText",
  "text": "Beispielskommentar",
  "show_pos_nr": false,
  "pos": null,
  "internal_pos": 8,
  "parent_id": null,
  "is_optional": false
}

Delete text position

DELETE /kb_offer/1/kb_position_text/8
Accept: application/json
Authorization: Bearer 677a1598d208d6c303fa5ca1c774709250e21749
Name Required Type Description
callback optional string Javascript callback

The following scopes are needed:

  • kb_invoice_edit
  • kb_offer_edit
  • kb_order_edit
  • kb_bill_edit
Status: 200 OK
X-Authenticated-User: apiextract_1
Content-Length: 16
Content-Type: application/json
{
  "success": true
}