Skip to content

Create upload ticket for file attachment

This method creates an upload ticket for a file attachment

POST /offer/v1.0/user/{username}/realestateproject/{realestateprojectid}/attachment/upload-ticket

Supported media types:
XML
JSON

Note

Designed only for file attachments: Pictures and PDFDocuments.
Upload ticket should be used to upload file directly to AWS S3.
Multipart message composed of file binary and received key/values should be POSTed to obtained url (for more info see: https://docs.aws.amazon.com/AmazonS3/latest/API/sigv4-post-example.html).
AttachmentId can be used later on to assign successfully uploaded file to real estate project.
Supported file content types: image/jpeg, image/gif, image/png, application/pdf.
Max file size: 50 MiB.
Ticket expiration: 25 minutes.

Request

Path Parameters

PARAMETER DESCRIPTION
username the username which the user uses for logging in to www.immobilienscout24.de

"me" can be used instead of the username, when the user is logged in by 3-legged OAuth 1.0
realestateprojectid the unique project ID, generated by IS24 when posting a real estate project

Payload

PARAMETER CONSTRAINTS
attachmentContentType enum: {image/jpeg, image/gif, image/png, application/pdf}

XML:

1
2
3
4
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<ns2:uploadTicketRequest xmlns:ns2="http://rest.immobilienscout24.de/schema/offer/realestateproject/1.0">
  <attachmentContentType>image/jpeg</attachmentContentType>
</ns2:uploadTicketRequest>

JSON:

1
2
3
4
5
{
  "realestateproject.uploadTicketRequest": {
    "attachmentContentType": "image/jpeg"
  }
}

Successful response

HTTP Code: 200

XML:

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<ns2:uploadTicket xmlns:ns2="http://rest.immobilienscout24.de/schema/offer/realestateproject/1.0">
  <url>https://s3-eu-west-1.amazonaws.com/bucket-name</url>
  <attachmentId>7cc1979e-ea6e-4f57-b177-a2287e5cc1db</attachmentId>
  <fields>
    <field key="key" value="12345/7a436fae-a0db-4b5f-af10-8e593d46d5ae.jpg"/>
    <field key="acl" value="public-read"/>
    <field key="content-type" value="image/jpeg"/>
    <field key="x-amz-server-side-encryption" value="AES256"/>
    <field key="x-amz-credential" value="AWS_ACCESS_KEY/20201109/eu-west-1/s3/aws4_request"/>
    <field key="x-amz-algorithm" value="AWS4-HMAC-SHA256"/>
    <field key="x-amz-date" value="20201109T000000Z"/>
    <field key="x-amz-signature" value="c8a0ffd7791608ac107893ba4fe96f3dbbe737d770f1f7eb0f24487b3235aeb2"/>
    <field key="policy" value="eyAiZXhwaX..."/>
    <field key="x-amz-security-token" value="FwoGZ..."/>
  </fields>
</ns2:uploadTicket>

JSON:

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
{
  "realestateproject.uploadTicket": {
    "url": "https:\/\/s3-eu-west-1.amazonaws.com\/bucket-name",
    "attachmentId": "7cc1979e-ea6e-4f57-b177-a2287e5cc1db",
    "fields": [
      {
        "field": [
          {
            "@key": "key",
            "@value": "12345\/7a436fae-a0db-4b5f-af10-8e593d46d5ae.jpg"
          },
          {
            "@key": "acl",
            "@value": "public-read"
          },
          {
            "@key": "content-type",
            "@value": "image\/jpeg"
          },
          {
            "@key": "x-amz-server-side-encryption",
            "@value": "AES256"
          },
          {
            "@key": "x-amz-credential",
            "@value": "AWS_ACCESS_KEY\/20201109\/eu-west-1\/s3\/aws4_request"
          },
          {
            "@key": "x-amz-algorithm",
            "@value": "AWS4-HMAC-SHA256"
          },
          {
            "@key": "x-amz-date",
            "@value": "20201109T000000Z"
          },
          {
            "@key": "x-amz-signature",
            "@value": "c8a0ffd7791608ac107893ba4fe96f3dbbe737d770f1f7eb0f24487b3235aeb2"
          },
          {
            "@key": "policy",
            "@value": "eyAiZXhwaX..."
          },
          {
            "@key": "x-amz-security-token",
            "@value": "FwoGZ..."
          }
        ]
      }
    ]
  }
}

Unsuccessful responses

Invalid or missing attachment content type

HTTP Code: 412

XML:

1
2
3
4
5
6
7
8
9
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<common:messages
    xmlns:common="http://rest.immobilienscout24.de/schema/common/1.0"
    xmlns:gis="http://rest.immobilienscout24.de/schema/platform/gis/1.0">
    <message>
        <messageCode>ERROR_RESOURCE_VALIDATION</messageCode>
        <message>Error while validating input for the resource. [MESSAGE: attachmentContentType : null : MANDATORY_FIELD_EMPTY]</message>
    </message>
</common:messages>

JSON:

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
{
    "common.messages": [
        {
            "message": {
                "messageCode": "ERROR_RESOURCE_VALIDATION",
                "message": "Error while validating input for the resource. [MESSAGE: attachmentContentType : null : MANDATORY_FIELD_EMPTY]"
            }
        }
    ]
}