Contact addresses API

Einleitung

Additional addresses can be used for the resource contact. The resource url is built like this:

/contact/%contact_id%/additional_address

Please replace the placeholder %contact_id% with the ID of the contact.

List additional addresses

GET /contact/1/additional_address
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
  • name
  • postcode
  • country_id

The following scopes are needed:

  • contact_show
Status: 200 OK
X-Authenticated-User: apiextract_1
Content-Length: 310
Content-Type: application/json
[
  {
    "id": 1,
    "name": "Meine Firma",
    "address": "Alternativadresse 12",
    "postcode": "8004",
    "city": "Zürich",
    "country_id": 1,
    "subject": "Zusatzadresse",
    "description": "Beschreibung"
  },
  {
    "id": 2,
    "name": "My address 1",
    "address": "Street 12",
    "postcode": "1234",
    "city": "City 101",
    "country_id": null,
    "subject": "",
    "description": ""
  }
]

Search additional addresses

POST /contact/1/additional_address/search
Accept: application/json
Authorization: Bearer 677a1598d208d6c303fa5ca1c774709250e21749
[
  {
    "field": "address",
    "value": "Alternativadresse"
  }
]
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:

  • country_id
  • id
  • name
  • postcode
Name Required Type Description
name optional string
address optional string
postcode optional string
city optional string
country_id optional string
subject optional string
email optional string

The following scopes are needed:

  • contact_show
Status: 200 OK
X-Authenticated-User: apiextract_1
Content-Length: 173
Content-Type: application/json
[
  {
    "id": 1,
    "name": "Meine Firma",
    "address": "Alternativadresse 12",
    "postcode": "8004",
    "city": "Zürich",
    "country_id": 1,
    "subject": "Zusatzadresse",
    "description": "Beschreibung"
  }
]

Show additional address

GET /contact/1/additional_address/2
Accept: application/json
Authorization: Bearer 677a1598d208d6c303fa5ca1c774709250e21749
Name Required Type Description
callback optional string Javascript callback

The following scopes are needed:

  • contact_show
Status: 200 OK
X-Authenticated-User: apiextract_1
Content-Length: 136
Content-Type: application/json
{
  "id": 2,
  "name": "My address 1",
  "address": "Street 12",
  "postcode": "1234",
  "city": "City 101",
  "country_id": null,
  "subject": "",
  "description": ""
}

Create additional address

POST /contact/1/additional_address
Accept: application/json
Authorization: Bearer 677a1598d208d6c303fa5ca1c774709250e21749
{
  "name": "My address 1",
  "address": "Street 12",
  "postcode": "1234",
  "city": "City 101",
  "default_bill_address": false,
  "default_correspondence_address": false
}
Name Required Type Description
callback optional string Javascript callback
Name Required Type Description
address required string (255)
city required string (50)
postcode required string (30)
country_id optional Resource country
default_bill_address optional boolean This value sets the default billing address
default_correspondence_address optional boolean This values sets the default correspondence address
description optional string
email optional string (255)
name optional string (80)
subject optional string (80)

The following scopes are needed:

  • contact_edit
Status: 201 Created
X-Authenticated-User: apiextract_1
Content-Length: 136
Content-Type: application/json
{
  "id": 2,
  "name": "My address 1",
  "address": "Street 12",
  "postcode": "1234",
  "city": "City 101",
  "country_id": null,
  "subject": "",
  "description": ""
}

Overwrite additional address

PUT /contact/1/additional_address/2
Accept: application/json
Authorization: Bearer 677a1598d208d6c303fa5ca1c774709250e21749
{
  "name": "My address 1",
  "address": "Street 12",
  "postcode": "1234",
  "city": "City 101",
  "default_bill_address": false,
  "default_correspondence_address": false
}
Name Required Type Description
callback optional string
Name Required Type Description
address required string (255)
city required string (50)
postcode required string (30)
country_id optional Resource country
default_bill_address optional boolean This value sets the default billing address
default_correspondence_address optional boolean This values sets the default correspondence address
description optional string
email optional string (255)
name optional string (80)
subject optional string (80)

The following scopes are needed:

  • contact_edit
Status: 200 OK
X-Authenticated-User: apiextract_1
Content-Length: 136
Content-Type: application/json
{
  "id": 2,
  "name": "My address 1",
  "address": "Street 12",
  "postcode": "1234",
  "city": "City 101",
  "country_id": null,
  "subject": "",
  "description": ""
}

Edit additional address

POST /contact/1/additional_address/2
Accept: application/json
Authorization: Bearer 677a1598d208d6c303fa5ca1c774709250e21749
{
  "name": "My address 2"
}
Name Required Type Description
callback optional string Javascript callback
Name Required Type Description
address optional string (255)
city optional string (50)
country_id optional Resource country
default_bill_address optional boolean This value sets the default billing address
default_correspondence_address optional boolean This values sets the default correspondence address
description optional string
email optional string (255)
name optional string (80)
postcode optional string (30)
subject optional string (80)

The following scopes are needed:

  • contact_edit
Status: 200 OK
X-Authenticated-User: apiextract_1
Content-Length: 136
Content-Type: application/json
{
  "id": 2,
  "name": "My address 2",
  "address": "Street 12",
  "postcode": "1234",
  "city": "City 101",
  "country_id": null,
  "subject": "",
  "description": ""
}

Delete additional address

DELETE /contact/1/additional_address/2
Accept: application/json
Authorization: Bearer 677a1598d208d6c303fa5ca1c774709250e21749
Name Required Type Description
callback optional string Javascript callback

The following scopes are needed:

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