Purplebricks Communications API

Outbound and inbound communication service covering the contact-us surface, customer emails and TPS (Telephone Preference Service) screening — the UK direct-marketing suppression check that any regulated outbound calling programme has to run.

OpenAPI Specification

purplebricks-communications-v1-openapi.yml Raw ↑
openapi: 3.0.1
info:
  title: Purplebricks.Communications.Api 1.0 - Core Team
  description: '### Displays customer''s email history records

    ### [Purplebricks.Communications.Api Git Repository](https://dev.azure.com/purplebricks/BackEnd/_git/communications-api)'
  version: '1.0'
servers:
- url: https://api.purplebricks.co.uk/communications-api
paths:
  /v1/contactus:
    post:
      tags:
      - ContactUs
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/Purplebricks.Communications.Api.Models.InputModels.ContactUsInputModel'
          text/json:
            schema:
              $ref: '#/components/schemas/Purplebricks.Communications.Api.Models.InputModels.ContactUsInputModel'
          application/*+json:
            schema:
              $ref: '#/components/schemas/Purplebricks.Communications.Api.Models.InputModels.ContactUsInputModel'
      responses:
        '204':
          description: Success
        '404':
          description: Not Found
          content:
            text/plain:
              schema:
                $ref: '#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails'
            application/json:
              schema:
                $ref: '#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails'
            text/json:
              schema:
                $ref: '#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails'
        '500':
          description: Server Error
  /v1/customeremails/getemails/{userId}:
    get:
      tags:
      - CustomerEmails
      parameters:
      - name: userId
        in: path
        required: true
        schema:
          type: integer
          format: int32
      responses:
        '200':
          description: Success
          content:
            text/plain:
              schema:
                type: array
                items:
                  $ref: '#/components/schemas/Purplebricks.Communications.Api.Models.EmailViewModel'
            application/json:
              schema:
                type: array
                items:
                  $ref: '#/components/schemas/Purplebricks.Communications.Api.Models.EmailViewModel'
            text/json:
              schema:
                type: array
                items:
                  $ref: '#/components/schemas/Purplebricks.Communications.Api.Models.EmailViewModel'
        '404':
          description: Not Found
          content:
            text/plain:
              schema:
                $ref: '#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails'
            application/json:
              schema:
                $ref: '#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails'
            text/json:
              schema:
                $ref: '#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails'
        '401':
          description: Unauthorized
          content:
            text/plain:
              schema:
                $ref: '#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails'
            application/json:
              schema:
                $ref: '#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails'
            text/json:
              schema:
                $ref: '#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails'
  /v1/customeremails/getemailbody/{emailId}:
    get:
      tags:
      - CustomerEmails
      parameters:
      - name: emailId
        in: path
        required: true
        schema:
          type: string
          format: uuid
      responses:
        '200':
          description: Success
          content:
            text/plain:
              schema:
                $ref: '#/components/schemas/Purplebricks.Communications.Api.Models.EmailViewModel'
            application/json:
              schema:
                $ref: '#/components/schemas/Purplebricks.Communications.Api.Models.EmailViewModel'
            text/json:
              schema:
                $ref: '#/components/schemas/Purplebricks.Communications.Api.Models.EmailViewModel'
        '404':
          description: Not Found
          content:
            text/plain:
              schema:
                $ref: '#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails'
            application/json:
              schema:
                $ref: '#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails'
            text/json:
              schema:
                $ref: '#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails'
        '401':
          description: Unauthorized
          content:
            text/plain:
              schema:
                $ref: '#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails'
            application/json:
              schema:
                $ref: '#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails'
            text/json:
              schema:
                $ref: '#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails'
  /v1/tps/tpsstatus:
    get:
      tags:
      - Tps
      parameters:
      - name: publicUserId
        in: query
        schema:
          type: string
          format: uuid
      - name: userId
        in: query
        schema:
          type: integer
          format: int32
      responses:
        '200':
          description: Success
          content:
            text/plain:
              schema:
                $ref: '#/components/schemas/Purplebricks.Communications.Api.Models.ViewModels.CustomerTpsStatus'
            application/json:
              schema:
                $ref: '#/components/schemas/Purplebricks.Communications.Api.Models.ViewModels.CustomerTpsStatus'
            text/json:
              schema:
                $ref: '#/components/schemas/Purplebricks.Communications.Api.Models.ViewModels.CustomerTpsStatus'
        '401':
          description: Unauthorized
          content:
            text/plain:
              schema:
                $ref: '#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails'
            application/json:
              schema:
                $ref: '#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails'
            text/json:
              schema:
                $ref: '#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails'
        '400':
          description: Bad Request
          content:
            text/plain:
              schema:
                $ref: '#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails'
            application/json:
              schema:
                $ref: '#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails'
            text/json:
              schema:
                $ref: '#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails'
        '404':
          description: Not Found
          content:
            text/plain:
              schema:
                $ref: '#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails'
            application/json:
              schema:
                $ref: '#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails'
            text/json:
              schema:
                $ref: '#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails'
        '500':
          description: Server Error
components:
  schemas:
    Microsoft.AspNetCore.Mvc.ProblemDetails:
      type: object
      properties:
        type:
          type: string
          nullable: true
        title:
          type: string
          nullable: true
        status:
          type: integer
          format: int32
          nullable: true
        detail:
          type: string
          nullable: true
        instance:
          type: string
          nullable: true
      additionalProperties: {}
    Purplebricks.Communications.Api.Models.Emails.EmailLogLinkClickedDto:
      type: object
      properties:
        id:
          type: integer
          format: int32
        emailId:
          type: string
          format: uuid
        linkReference:
          type: string
          nullable: true
        userId:
          type: integer
          format: int32
          nullable: true
        dateClicked:
          type: string
          format: date-time
      additionalProperties: false
    Purplebricks.Communications.Api.Models.Emails.EmailLogOpenedDto:
      type: object
      properties:
        id:
          type: integer
          format: int32
        emailId:
          type: string
          format: uuid
        dateViewed:
          type: string
          format: date-time
      additionalProperties: false
    Purplebricks.Communications.Api.Models.EmailViewModel:
      type: object
      properties:
        id:
          type: integer
          format: int32
        recipientUserId:
          type: integer
          format: int32
          nullable: true
        recipientAddress:
          type: string
          nullable: true
        emailId:
          type: string
          format: uuid
        subject:
          type: string
          nullable: true
        errorMessage:
          type: string
          nullable: true
        bodyUrl:
          maxLength: 2048
          minLength: 0
          type: string
          nullable: true
        dateSent:
          type: string
          format: date-time
        opens:
          type: array
          items:
            $ref: '#/components/schemas/Purplebricks.Communications.Api.Models.Emails.EmailLogOpenedDto'
          nullable: true
        clicks:
          type: array
          items:
            $ref: '#/components/schemas/Purplebricks.Communications.Api.Models.Emails.EmailLogLinkClickedDto'
          nullable: true
      additionalProperties: false
    Purplebricks.Communications.Api.Models.InputModels.ContactUsAddress:
      type: object
      properties:
        propertyNumberOrName:
          type: string
          nullable: true
        street:
          type: string
          nullable: true
        city:
          type: string
          nullable: true
        postcode:
          type: string
          nullable: true
      additionalProperties: false
    Purplebricks.Communications.Api.Models.InputModels.ContactUsInputModel:
      type: object
      properties:
        firstName:
          type: string
          nullable: true
        lastName:
          type: string
          nullable: true
        subject:
          type: string
          nullable: true
        phoneNumber:
          type: string
          nullable: true
        emailAddress:
          type: string
          nullable: true
        reason:
          type: string
          nullable: true
        comments:
          type: string
          nullable: true
        address:
          $ref: '#/components/schemas/Purplebricks.Communications.Api.Models.InputModels.ContactUsAddress'
        salesOrLettings:
          type: string
          nullable: true
      additionalProperties: false
    Purplebricks.Communications.Api.Models.ViewModels.CustomerTpsStatus:
      type: object
      properties:
        registered:
          type: boolean
      additionalProperties: false
  securitySchemes:
    Bearer:
      type: apiKey
      description: Authorization header using Bearer scheme
      name: Authorization
      in: header
security:
- Bearer: []