Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- openapi: 3.0.1
- info:
- title: Avalon PMS API
- description: This is the API that salesforce exposes as PMS role
- termsOfService: 'http://swagger.io/terms/'
- contact:
- email: apiteam@swagger.io
- license:
- name: Apache 2.0
- url: 'http://www.apache.org/licenses/LICENSE-2.0.html'
- version: 1.0.0
- externalDocs:
- description: Find out more about Swagger
- url: 'http://swagger.io'
- servers:
- - url: 'https://avalonproperties--dev.my.salesforce.com/services/apexrest/WSAPIsForSFRecords'
- description: Salesforce DEV
- - url: 'https://stoplight.io/mocks/makingscience/avalon-web/43413384'
- description: StoplightIO
- tags:
- - name: promotion
- - name: appointments
- description: 'Services related with customers that want to visit the properties or the promotions. Although appointments are managed externally, they must be notified to SalesForce, and this is the purpose of these endpoints'
- - name: inventory
- - name: document
- - name: customer
- - name: opportunity
- description: Everything about your Pets
- externalDocs:
- description: Find out more
- url: 'http://swagger.io'
- - name: user
- description: Operations about user
- externalDocs:
- description: Find out more about our store
- url: 'http://swagger.io'
- - name: rent
- description: All the rents for a given customer
- paths:
- /customer:
- get:
- tags:
- - customer
- description: Get all the customers
- operationId: getCustomer
- parameters:
- - name: email
- in: query
- description: email
- schema:
- type: string
- responses:
- '200':
- description: The customer's profile
- content:
- application/json:
- schema:
- $ref: '#/components/schemas/Customer'
- put:
- tags:
- - customer
- summary: Update an existing customer
- description: Update an existing customer
- operationId: updateCustomer
- requestBody:
- description: The customer to update
- content:
- application/json:
- schema:
- $ref: '#/components/schemas/Customer'
- application/xml:
- schema:
- $ref: '#/components/schemas/Customer'
- required: true
- responses:
- '200':
- description: OK
- content:
- application/xml:
- schema:
- $ref: '#/components/schemas/Customer'
- application/json:
- schema:
- $ref: '#/components/schemas/Customer'
- x-codegen-request-body-name: body
- post:
- tags:
- - customer
- summary: Add a new registered customer
- description: Add a new registered customer
- operationId: addCustomer
- requestBody:
- description: Customer Info
- content:
- application/json:
- schema:
- $ref: '#/components/schemas/Customer'
- examples:
- example-1:
- value:
- name: John
- surname: Doe
- email: [email protected]
- phone: '+34637284533'
- legal_role: persona_fisica
- id: string
- id_doc_type: DNI
- id_doc: 26929560X
- company: WebClient
- required: true
- responses:
- '200':
- description: OK
- content:
- application/json:
- schema:
- $ref: '#/components/schemas/Customer'
- '201':
- description: Created
- content:
- application/json:
- schema:
- $ref: '#/components/schemas/Customer'
- examples:
- example-1:
- value:
- name: string
- surname: string
- email: string
- phone: string
- legal_role: persona_fisica
- id: string
- id_doc_type: DNI
- id_doc: string
- security: []
- x-codegen-request-body-name: body
- /promotions:
- get:
- tags:
- - promotion
- summary: Get all the promotions
- description: Retrieve all the promotions
- operationId: get_promotions
- parameters: []
- responses:
- '200':
- description: The list of all the promotions available
- content:
- application/json:
- schema:
- type: array
- items:
- $ref: '#/components/schemas/Promotion'
- examples:
- example-1:
- value:
- - id: 00Q3O000004VMQqUAO
- name: Promoción Torre Oscura II
- typologies:
- - id: string
- short_description: Apartamentos de 2 dormitorios extra large
- price_tag: 800
- price_tag_currency: EUR
- features:
- - id: string
- key: BEDROOM_COUNT
- value: 3
- availability:
- availability_count: 0
- occupied_count: 0
- next_count: 0
- features:
- - id: string
- key: BEDROOM_COUNT
- value: 3
- address:
- id: string
- street: C/Del Pez
- number: '34'
- block: Bloque 1
- portal: IV
- stair: derecha
- floor: '3'
- letter: D
- city: Alcalá de Henares
- country: España
- postal_code: '28806'
- state: Madrid
- latitude: '1.2345'
- longitude: '9.8765'
- adress_extra: Antiguo Camino del Sueño
- example-1:
- example:
- - promotion:
- id: sf_abcdef01234
- description: Promoción Torre Oscura II
- - promotion:
- id: sf_abcdef01235
- description: Promoción New Madrid I
- parameters: []
- '/document/{id}':
- get:
- tags:
- - document
- description: Retrieve a document from SF given its id
- operationId: get_document_by_id
- parameters:
- - name: id
- in: path
- description: Additional data to pass to server
- required: true
- schema:
- type: string
- format: salesforce_id
- responses:
- '200':
- description: dummy
- content: {}
- /document:
- post:
- summary: Upload a new document
- tags:
- - document
- operationId: post-document
- responses:
- '200':
- description: OK
- requestBody:
- content:
- application/json:
- schema:
- $ref: '#/components/schemas/Filedocument'
- description: Post a new document to the PMS
- parameters: []
- '/appointments/{appointmentId}':
- delete:
- tags:
- - appointments
- description: Delete and cancel an appointment
- operationId: cancel_appointment
- parameters:
- - name: appointmentId
- in: path
- description: The customer id to retrieve appointments for
- required: true
- schema:
- type: string
- format: salesforce_id
- responses:
- '200':
- description: successful operation
- content:
- application/json:
- schema:
- $ref: '#/components/schemas/ApiResponse'
- /appointments:
- get:
- tags:
- - appointments
- description: Get the appointments of a customer
- operationId: get_appointments_by_customer_id
- parameters:
- - name: customer
- in: query
- description: The customer id to retrieve appointments for
- required: true
- schema:
- type: string
- format: salesforce_id
- responses:
- '200':
- description: The appointments history of the customer
- content:
- application/json:
- schema:
- type: array
- items:
- $ref: '#/components/schemas/Appointment'
- post:
- tags:
- - appointments
- description: Notify salesforce of a new appoinments
- operationId: post-appointments
- responses:
- '200':
- description: OK
- content:
- application/json:
- schema:
- $ref: '#/components/schemas/Appointment'
- examples:
- example-1:
- value:
- id: 00Q3O000004VMQqUB0
- start_datetime: string
- provider:
- firstname: John
- lastname: Doe
- email: [email protected]
- promotion:
- id: 00Q3O000004VMQqUAO
- description: Promoción Torre Oscura II
- typologies:
- - id: string
- short_description: Apartamentos de 2 dormitorios extra large
- price_tag: 800
- price_tag_currency: EUR
- features:
- - id: string
- key: BEDROOM_COUNT
- value: 3
- availability:
- availability_count: 0
- occupied_count: 0
- next_count: 0
- name: string
- features:
- - id: string
- key: BEDROOM_COUNT
- value: 3
- address:
- id: string
- street: C/Del Pez
- city: Alcalá de Henares
- country: España
- postal_code: '28806'
- state: Madrid
- latitude: '1.2345'
- longitude: '9.8765'
- street_location: '3ºB Puerta II, Escalera 5, Bloque 3'
- street_extra: Anotaciones extra sobre la dirección
- typology:
- id: string
- short_description: Apartamentos de 2 dormitorios extra large
- price_tag: 800
- price_tag_currency: EUR
- features:
- - id: string
- key: BEDROOM_COUNT
- value: 3
- availability:
- availability_count: 0
- occupied_count: 0
- next_count: 0
- example-1:
- example:
- id: string
- start_datetime: string
- provider:
- firstname: John
- lastname: Doe
- email: [email protected]
- promotion:
- id: TORRE2
- description: Promoción Torre Oscura II
- typologies:
- - id: string
- short_description: Apartamentos de 2 dormitorios extra large
- price_tag: 800
- price_tag_currency: EUR
- features:
- - id: string
- key: BEDROOM_COUNT
- value: 3
- availability:
- availability_count: 0
- occupied_count: 0
- next_count: 0
- typology:
- id: string
- short_description: Apartamentos de 2 dormitorios extra large
- price_tag: 800
- price_tag_currency: EUR
- features:
- - id: string
- key: BEDROOM_COUNT
- value: 3
- availability:
- availability_count: 0
- occupied_count: 0
- next_count: 0
- /lead:
- post:
- tags:
- - customer
- summary: Create a lead
- description: Create a new lead from contact forms and similar
- operationId: createUser
- requestBody:
- description: Lead object definition
- content:
- application/json:
- schema:
- $ref: '#/components/schemas/Lead'
- examples:
- example-1:
- value:
- lead:
- name: John
- surname: Doe
- email: [email protected]
- phone: '+34637284533'
- legal_role: persona_fisica
- id_doc_type: DNI
- id_doc: 26929560X
- company: WebClient
- promotion_id: a013O000004Wd81QAC
- typology_id: a023O000007dTkpQAE
- Solo promo:
- value:
- lead:
- name: John
- surname: Doe
- email: [email protected]
- phone: '+34637284533'
- legal_role: persona_fisica
- id: string
- id_doc_type: DNI
- id_doc: 26929560X
- company: WebClient
- promotion_id: a013O000004Wd81QAC
- Simple Lead:
- value:
- lead:
- name: John
- surname: Doe
- email: [email protected]
- company: WebClient
- application/xml:
- schema:
- type: object
- properties: {}
- multipart/form-data:
- schema:
- type: object
- properties: {}
- required: true
- responses:
- '200':
- description: 'The answer is the same json document, but with an `id` for the newly created lead'
- content:
- application/json:
- schema:
- $ref: '#/components/schemas/Lead'
- examples:
- example-1:
- value:
- lead:
- name: John
- surname: Doe
- email: [email protected]
- phone: '+34637284533'
- legal_role: persona_fisica
- id: string
- id_doc_type: DNI
- id_doc: 26929560X
- company: WebClient
- promotion_id: a013O000004Wd81QAC
- typology_id: a023O000007dTkpQAE
- id: 00Q3O000004Vj8MUAS
- application/xml:
- schema:
- type: object
- properties: {}
- '201':
- description: successful operation
- content: {}
- security:
- - BearerToken: []
- parameters: []
- /opportunities:
- get:
- tags:
- - opportunity
- summary: Get all the opportunities
- description: Get all the opportunities filtering by customer id
- operationId: get_opportunities
- parameters:
- - name: customer
- in: query
- description: The customer id
- schema:
- type: string
- responses:
- '200':
- description: OK
- content:
- application/json:
- schema:
- type: array
- items:
- type: object
- properties:
- opportunity_id:
- type: string
- status:
- type: string
- examples:
- example-1:
- value:
- - opportunity_id: string
- example-1:
- example:
- id: string
- customer:
- id: 0
- username: string
- firstName: string
- lastName: string
- email: string
- password: string
- phone: string
- userStatus: 0
- promotion:
- id: TORRE2
- description: Promoción Torre Oscura II
- typologies:
- - id: string
- short_description: Apartamentos de 2 dormitorios extra large
- price_tag: 800
- price_tag_currency: EUR
- features:
- - id: string
- key: BEDROOM_COUNT
- value: 3
- availability:
- availability_count: 0
- occupied_count: 0
- next_count: 0
- typology:
- id: string
- short_description: Apartamentos de 2 dormitorios extra large
- price_tag: 800
- price_tag_currency: EUR
- features:
- - id: string
- key: BEDROOM_COUNT
- value: 3
- availability:
- availability_count: 0
- occupied_count: 0
- next_count: 0
- status: string
- requisites:
- - id: string
- document_id: sf123qwe
- sample_document_id: sf123123qweqwe
- history:
- - timestamp: '2022-02-02T18:00:00'
- approval_status: Rejected
- comment: Missing owner signature. Expiration date due
- title: Identification Document
- description: 'Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. '
- label: DNI
- post:
- tags:
- - opportunity
- summary: Create a new opportunity
- description: Create a new opportunity for a customer
- operationId: post-opportunity
- requestBody:
- content:
- application/json:
- schema:
- required:
- - customer_id
- - promotion_id
- type: object
- properties:
- customer_id:
- type: string
- example: sf_customer_id
- promotion_id:
- type: string
- example: sf_promotion_id
- typology_id:
- type: string
- example: sf_typology_id
- required: false
- responses:
- '200':
- description: OK
- content:
- application/json:
- schema:
- type: object
- x-codegen-request-body-name: body
- '/opportunities/{opportunity_id}':
- get:
- tags:
- - opportunity
- summary: Get an opportunity
- description: Get a given opportunity
- operationId: get_opportunity_by_ud
- parameters: []
- responses:
- '200':
- description: OK
- content:
- application/json:
- schema:
- $ref: '#/components/schemas/Opportunity'
- examples:
- example-1:
- value:
- - opportunity_id: 00Q3O000004VMQqUb1
- example-1:
- example:
- id: string
- customer:
- id: 0
- username: string
- firstName: string
- lastName: string
- email: string
- password: string
- phone: string
- userStatus: 0
- promotion:
- id: TORRE2
- description: Promoción Torre Oscura II
- typologies:
- - id: string
- short_description: Apartamentos de 2 dormitorios extra large
- price_tag: 800
- price_tag_currency: EUR
- features:
- - id: string
- key: BEDROOM_COUNT
- value: 3
- availability:
- availability_count: 0
- occupied_count: 0
- next_count: 0
- typology:
- id: string
- short_description: Apartamentos de 2 dormitorios extra large
- price_tag: 800
- price_tag_currency: EUR
- features:
- - id: string
- key: BEDROOM_COUNT
- value: 3
- availability:
- availability_count: 0
- occupied_count: 0
- next_count: 0
- status: string
- requisites:
- - id: string
- document_id: sf123qwe
- sample_document_id: sf123123qweqwe
- history:
- - timestamp: '2022-02-02T18:00:00'
- approval_status: Rejected
- comment: Missing owner signature. Expiration date due
- title: Identification Document
- description: 'Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. '
- label: DNI
- parameters:
- - schema:
- type: string
- name: opportunity_id
- in: path
- required: true
- '/requisite/{requisite_id}':
- patch:
- tags:
- - opportunity
- summary: Submit a requisite
- description: 'This method is used to add a new document to this requirement. For this, a `document_id` is necessary and it is the one obtained when the document itself was posted with the `/document` POST endpoint.'
- operationId: patch-requisite-requisite_id
- parameters:
- - name: requisite_id
- in: path
- required: true
- schema:
- type: string
- requestBody:
- content:
- application/json:
- schema:
- required:
- - document_id
- type: object
- properties:
- document_id:
- minLength: 1
- type: string
- description: ''
- x-examples:
- example-1:
- document_id: sd_doc_id_123abc
- required: false
- responses:
- '200':
- description: OK
- content:
- application/json:
- schema:
- $ref: '#/components/schemas/Requisite'
- x-codegen-request-body-name: body
- components:
- schemas:
- Appointment:
- type: object
- properties:
- id:
- type: string
- format: salesforceId
- start_datetime:
- type: string
- format: ISOFORMAT
- provider:
- type: object
- properties:
- firstname:
- type: string
- example: John
- lastname:
- type: string
- example: Doe
- email:
- type: string
- format: email
- example: [email protected]
- promotion:
- $ref: '#/components/schemas/Promotion'
- typology:
- $ref: '#/components/schemas/Typology'
- customer_id:
- type: string
- Filedocument:
- type: object
- properties:
- id:
- type: string
- format: salesforce_id
- example: sf_023123abc
- b64content:
- type: string
- format: base64
- example: JVBERi0xLjIgCjkgMCBvYmoKPDwKPj4Kc3RyZWFtCkJULyA5IFRmKFRlc3QpJyBFVAplbmRzdHJlYW0KZW5kb2JqCjQgMCBvYmoKPDwKL1R5cGUgL1BhZ2UKL1BhcmVudCA1IDAgUgovQ29udGVudHMgOSAwIFIKPj4KZW5kb2JqCjUgMCBvYmoKPDwKL0tpZHMgWzQgMCBSIF0KL0NvdW50IDEKL1R5cGUgL1BhZ2VzCi9NZWRpYUJveCBbIDAgMCA5OSA5IF0KPj4KZW5kb2JqCjMgMCBvYmoKPDwKL1BhZ2VzIDUgMCBSCi9UeXBlIC9DYXRhbG9nCj4+CmVuZG9iagp0cmFpbGVyCjw8Ci9Sb290IDMgMCBSCj4+CiUlRU9G
- mimetype:
- type: string
- example: application/pdf
- filename:
- type: string
- example: dni.pdf
- description: ''
- User:
- type: object
- properties:
- id:
- type: integer
- format: int64
- username:
- type: string
- firstName:
- type: string
- lastName:
- type: string
- email:
- type: string
- password:
- type: string
- phone:
- type: string
- userStatus:
- type: integer
- description: User Status
- format: int32
- xml:
- name: User
- Promotion:
- type: object
- x-examples:
- example-1:
- id: 00Q3O000004VMQqUAO
- name: Promoción Torre Oscura II
- typologies:
- - id: string
- short_description: Apartamentos de 2 dormitorios extra large
- price_tag: 800
- price_tag_currency: EUR
- features:
- - id: string
- key: BEDROOM_COUNT
- value: 3
- availability:
- availability_count: 0
- occupied_count: 0
- next_count: 0
- features:
- - id: string
- key: BEDROOM_COUNT
- value: 3
- address:
- id: string
- street: C/Del Pez
- number: '34'
- block: Bloque 1
- portal: IV
- stair: derecha
- floor: '3'
- letter: D
- city: Alcalá de Henares
- country: España
- postal_code: '28806'
- state: Madrid
- latitude: '1.2345'
- longitude: '9.8765'
- adress_extra: Antiguo Camino del Sueño
- properties:
- id:
- type: string
- format: salesforce_id
- example: 00Q3O000004VMQqUAO
- name:
- type: string
- example: Promoción Torre Oscura II
- typologies:
- type: array
- items:
- $ref: '#/components/schemas/Typology'
- features:
- type: array
- items:
- $ref: '#/components/schemas/Feature'
- address:
- $ref: '#/components/schemas/Address'
- parameters:
- type:
- - string
- - object
- properties:
- min_surface:
- type: string
- max_surface:
- type: string
- min_bedroom_count:
- type: string
- max_bedroom_count:
- type: string
- min_price:
- type: string
- max_price:
- type: string
- min_bath_count:
- type: string
- max_bath_count:
- type: string
- TypologyAvailability:
- type: object
- properties:
- availability_count:
- type: number
- occupied_count:
- type: number
- next_count:
- type: number
- description: Units that will be available soon
- Typology:
- type: object
- description: ''
- x-examples:
- example-1:
- id: string
- short_description: Apartamentos de 2 dormitorios extra large
- price_tag: 800
- price_tag_currency: EUR
- features:
- - id: sf_idxxxxx
- key: BEDROOM_COUNT
- value: 2
- - id: sf_idxxxxy
- key: IS_AVALON_UX
- value: true
- availability:
- availability_count: 0
- occupied_count: 0
- next_count: 0
- properties:
- id:
- type: string
- short_description:
- type: string
- example: Piso de 2 habitaciones
- price_tag:
- type: number
- description: The price of the category
- format: money
- example: 800
- price_tag_currency:
- type: string
- description: The currency for the `price_tag`
- format: currency
- example: EUR
- features:
- type: array
- items:
- $ref: '#/components/schemas/Feature'
- availability:
- $ref: '#/components/schemas/TypologyAvailability'
- is_visible:
- type: boolean
- description: Show or not this typology in the web
- Feature:
- type: object
- properties:
- id:
- type: string
- key:
- type: string
- example: BEDROOM_COUNT
- value:
- type: number
- example: 3
- title: ''
- Opportunity:
- title: Opportunity
- required:
- - customer
- type: object
- properties:
- id:
- type: string
- customer:
- $ref: '#/components/schemas/User'
- promotion:
- $ref: '#/components/schemas/Promotion'
- typology:
- $ref: '#/components/schemas/Typology'
- status:
- type: string
- requisites:
- type: array
- items:
- $ref: '#/components/schemas/Requisite'
- description: 'This models an opportunity that starts in the interest of the customer in a promotion, or even in a typology of a promotion, and finishes with the rent of a particular asset. '
- x-tags:
- - opportunity
- x-examples: {}
- ApiResponse:
- type: object
- properties:
- code:
- type: integer
- format: int32
- type:
- type: string
- message:
- type: string
- Customer:
- type: object
- description: ''
- x-examples:
- example-1:
- name: John
- surname: Doe
- email: [email protected]
- phone: '+34637284533'
- legal_role: persona_fisica
- id_doc_type: DNI
- id_doc: 26929560X
- company: WebClient
- title: ''
- properties:
- name:
- type: string
- minLength: 1
- example: John
- surname:
- type: string
- minLength: 1
- example: Doe
- email:
- type: string
- minLength: 1
- example: [email protected]
- phone:
- type: string
- minLength: 1
- example: '+34637284533'
- legal_role:
- type: string
- example: persona_fisica
- enum:
- - persona_fisica
- - persona_juridica
- id:
- type: string
- format: salesforce id
- readOnly: true
- id_doc_type:
- type: string
- enum:
- - DNI
- - NIE
- - NIF
- id_doc:
- type: string
- example: 26929560X
- required:
- - name
- - surname
- - email
- Lead:
- title: Lead
- type: object
- properties:
- lead:
- $ref: '#/components/schemas/Customer'
- promotion_id:
- type: string
- typology_id:
- type: string
- id:
- type: string
- Requisite:
- title: Requisite
- type: object
- properties:
- id:
- type: string
- document_id:
- type: string
- description: This is the ID of the document uploaded by the customer. This ID is obtained by posting the document with the `/document` endpooint.
- format: salesforce_id
- example: sf123qwe
- sample_document_id:
- type: string
- example: sf123123qweqwe
- history:
- type: array
- description: The history this approval has gone through
- readOnly: true
- items:
- type: object
- properties:
- timestamp:
- type: string
- format: date-time
- approval_status:
- type: string
- example: Rejected
- enum:
- - Approved
- - Rejected
- - Pending
- comment:
- type: string
- example: Missing owner signature. Expiration date due
- readOnly: true
- title:
- type: string
- readOnly: true
- example: Identification Document
- description:
- type: string
- readOnly: true
- example: 'Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. '
- label:
- type: string
- description: This label will help the frontend to determine where to show or request this requisite
- readOnly: true
- example: DNI
- description: 'This models a document that has to be uploaded by the customer, and then approved or rejected by an external operator.'
- x-tags:
- - opportunity
- - requisite
- x-internal: false
- x-examples:
- example-1:
- id: string
- document_id: sf123qwe
- sample_document_id: sf123123qweqwe
- history:
- - timestamp: '2022-02-02T18:00:00'
- approval_status: Approved
- comment: Missing owner signature. Expiration date due
- document_title: Identification Document
- document_description: 'Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. '
- label: DNI
- Address:
- title: Address
- type: object
- x-tags:
- - promotion
- x-examples:
- example-1:
- id: string
- street: C/Del pez
- city: Alcalá de Henares
- country: España
- postal_code: '28806'
- state: Madrid
- latitude: '3.34'
- longitude: '234.34'
- street_location: '3ºB Puerta II, Escalera 7, Torre 5'
- street_extra: string
- properties:
- id:
- type: string
- street:
- type: string
- example: C/Del Pez
- number:
- type: string
- example: '34'
- block:
- type: string
- example: Bloque 1
- portal:
- type: string
- example: IV
- stair:
- type: string
- example: derecha
- floor:
- type: string
- example: '3'
- letter:
- type: string
- example: D
- city:
- type: string
- example: Alcalá de Henares
- country:
- type: string
- example: España
- postal_code:
- type: string
- example: '28806'
- state:
- type: string
- example: Madrid
- latitude:
- type: string
- example: '1.2345'
- longitude:
- type: string
- example: '9.8765'
- adress_extra:
- type: string
- example: Antiguo Camino del Sueño
- securitySchemes:
- BearerToken:
- name: Authorization
- type: apiKey
- in: header
- description: ''
- SFOauth:
- type: oauth2
- flows:
- password:
- tokenUrl: ''
- refreshUrl: ''
- scopes: {}
- security:
- - SFOauth: []
Add Comment
Please, Sign In to add comment