EverReal
  • Introduction
  • Authentication
    • API ClientID and ClientSecret
    • Authentication limitations
  • Rate limiting
  • Helpers
    • Errors
    • Pagination
    • Formatting
  • How to guide
    • EverReal Data Import Process
      • Connect an Integration
      • Import Mappers
      • Ideal CSV Structure
      • Debug Imports
      • FAQ
    • Data import via GraphQL
  • Endpoints
    • Account users / members
    • Owners
      • Owners Query
      • Owners Mutation
    • Property Groups
      • Property Groups Query
      • Property Group Mutation
    • Properties
      • Properties Query
      • Properties Mutation
    • Units
      • Units Query
      • Units Mutation
    • Listing
      • Listing Query
      • Listing Mutation
    • Candidates
      • Candidates Query
      • Candidate Mutation
    • Messages
    • Contact Activites
    • Tenants
      • Tenants Query
      • Tenant Mutation
    • Contract
      • Contract Query
      • Contract Mutation
    • Contacts
      • Contact Mutation
      • Contact Query
    • Document management
      • Document management
      • Simple file upload
    • Tasks
      • Tasks Query
    • Protocols
      • Protocol Query
  • Webhooks
    • Owner Events
      • OWNER_CREATED
      • OWNER_UPDATED
      • OWNER_DELETED
    • Property Events
      • PROPERTY_CREATED
      • PROPERTY_UPDATED
      • PROPERTY_DELETED
    • Unit Events
      • UNIT_CREATED
      • UNIT_UPDATED
      • UNIT_DELETED
    • Listing Events
      • LISTING_ACTIVATED
      • LISTING_ARCHIVED
      • LISTING_UPDATED
      • LISTING_DEACTIVATED
      • LISTING_CREATED
      • LISTING_PUBLISHED_TO_CHANNEL
      • LISTING_UNPUBLISHED_FROM_CHANNEL
    • Candidates Events
      • CANDIDATE_PARSED
      • LISTING_CANDIDATE_APPLIED
    • Listing Contracting Events
      • LISTING_CONTRACT_FLOW_SIGNED
      • LISTING_CONTRACT_FLOW_PARTIALLY_SIGNED
      • LISTING_CONTRACT_FLOW_WITHDRAWN
      • LISTING_CONTRACT_FLOW_STARTED
    • Listing Scheduling Events
      • LISTING_CANDIDATE_SCHEDULE_TIMESLOT_BOOKING_REMOVED_CANDIDATE
      • LISTING_CANDIDATE_SCHEDULE_TIMESLOT_BOOKING_REMOVED_ADMIN
      • LISTING_CANDIDATE_SCHEDULE_TIMESLOT_BOOKED_CANDIDATE
      • LISTING_CANDIDATE_SCHEDULE_TIMESLOT_BOOKED_ADMIN
      • LISTING_CANDIDATE_SCHEDULE_NEW_TIMESLOTS_REQUESTED
      • LISTING_CANDIDATE_SCHEDULE_INVITED_VIEWING
    • Protocol Events
      • PROTOCOL_COMPLETED
  • Change log
    • Releases
      • Introducing Mappers
      • Enhancements for GraphQL
      • Enhancements for Querying
      • Enhancements for Webhooks
    • Upcoming
      • Introduced Querying Protocol in GraphQL
Powered by GitBook
On this page
  • Introduction
  • Endpoints

Was this helpful?

  1. Endpoints
  2. Document management

Simple file upload

This page describes how to upload files, so you can use them later for other purposes.

Introduction

Please use this endpoint only if you don't want to automatically link the files to properties, units, tenants. For example this endpoint could be used for:

  • creating a listing via API (currently only possible with restricted access and not yet documented)

  • updating a user profile image via API

  • submit candidate / applicant information, with files via API (currently only possible with restricted access and not yet documented)

Endpoints

Upload a file

GET https://{custom_subdomain}.everreal.co/api/file-storage/company/files

Request Body

Name
Type
Description

file*

Form file

The file

resourcePath*

String

The virtual folder path

name

String

Override the display name of the file

Delete a file

DELETE https://{custom_subdomain}.everreal.co/api/file-storagecompany/files?resourcePath={uploadedResourcePath}

Example flow for creating a listing

  • upload image1.jpeg , image2.jpeg , floorPlan.pdf

  • pass the responses to the create listing payload

Step 1 - upload images

// Do this for every image
const myHeaders = new Headers();
myHeaders.append('Accept', 'application/json');
myHeaders.append(
  'Authorization',
  'Bearer eyJhbGciOiJSUzI1NiIsInR5cCI6IkpXVCJ9.eyJqdGkiOiIwZTY1Y2ViYi1lNDI4LTQ4YTktOTY4MS03NmRkYTM0ZDIyOTkiLCJzdWIiOiJkNWY4ZmI5My1kYTIxLTQwNTktYjhjOC0wN2M0MjE0OTczMTkiLCJleHAiOjE2ODUwMTAyMjEsImlhdCI6MTY4NTAwNjYyMX0.byF0tReLQOYRXwvgssQG1HFfrxWOPm1WdA4ZcLyJMX6LDxg586pjebiyBtE7cJvFAHhDxIdXGlp6LLDs-HaGmk10H-HMmRdLG4gHzs-QRz4goQIVgUv3kikG5YseXMgqmRCssXtBVbo-XjS_bHFSLkMV5zNESByliYLFJReXXpQTC_LP3PUdA7qvnL4PZAwbcoa6aPKyPtuur9gCXvcVDgvFdzQQ5WMnr9u0CiXMeqk3ybAMUTD9RdXYBpTDoJChemFDq0E1-GYDBbC-WuwOsw5sYPokCjuD-7ARsm6UaBxNExJWYUz5erpVhewNZHiGhOyUqARomV8QcbatiL-RNw',
);

const formdata = new FormData();
formdata.append('file', fileInput, { filename: 'Living Room', contentType: 'image/png' });
formdata.append('resourcePath', 'listings/117ff3a1-6f1b-4da8-a3da-208d2e6f5ac4/pictures');
formdata.append('name', 'Floor plans');

const requestOptions = {
  method: 'POST',
  headers: myHeaders,
  body: formdata,
  redirect: 'follow',
};

fetch('https://{subdomain}.everreal.co/api/file-storage/company/files', requestOptions)
  .then((response) => response.json())
  .then((result) => console.log(result))
  .catch((error) => console.log('error', error));

Response will be something like

{
    "name": "Floor plans",
    "resourcePath": "subdomain/116aeae1-615a-11e7-97db-257f422c12345/listings/117ff3a1-6f1b-4da8-a3da-208d2e6f5ac4/pictures",
    "size": 389417,
    "type": "image/png"
}

Step 2 - pass payload during create listing

const body = {
   /// other data
   pictures: [{
      ...responsePicture1,
      order: 0,
   }, {
      ...responsePicture2,
      order: 1,
   }],
   floorPlans: [{
      ...responseFloorPlanPdf,
      order: 0
   }]
};

const requestOptions = {
  method: 'POST',
  headers: {....},
  body
};

fetch('https://{subdomain}.everreal.co/api/create-listing-endpoint', requestOptions)
  .then((response) => response.json())
  .then((result) => console.log(result))
  .catch((error) => console.log('error', error));
PreviousDocument managementNextTasks

Last updated 1 year ago

Was this helpful?