openapi: 3.0.1 info: title: Review Generation Service description: "API for review generation, all endpoints require authentication" version: "1.1" paths: /api/identities: get: tags: - Email Identity summary: Find email Identities for given list of email addresses operationId: getIdentities parameters: - name: identity in: query description: Must be url encoded required: true schema: type: array items: type: string example: identity=user1%40uberall.com&identity=user2%40uberall.com - name: shouldUpdateStatus in: query description: "When true, we call the email provider to check for identity\ \ status" schema: type: boolean nullable: true example: "true" responses: "401": description: User does not have right permission to perform this action "400": description: Invalid identities "200": description: OK response content: application/json: schema: $ref: '#/components/schemas/GetIdentitiesResponse' post: tags: - Email Identity summary: Create a new email Identity description: Creates a new email Identity in AWS and sends a verification email operationId: createIdentity requestBody: content: application/json: schema: required: - emailAddress type: object properties: emailAddress: minLength: 1 type: string format: email required: true responses: "401": description: User does not have right permission to perform this action "400": description: Invalid email address "200": description: OK response content: application/json: schema: $ref: '#/components/schemas/IdentityResponse' /api/identities/resend-verification: post: tags: - Email Identity summary: Resend verification email for given email address operationId: resendVerification parameters: - name: identity in: query description: Must be url encoded required: true schema: type: string example: identity=user1%40uberall.com responses: "401": description: User does not have right permission to perform this action "400": description: Invalid identity "200": description: OK response content: application/json: schema: $ref: '#/components/schemas/IdentityResponse' /api/review-template: get: tags: - Review Template summary: Find review templates for given location Ids operationId: getTemplates responses: "401": description: User does not have right permission to perform this action or does not have access to specified locations "200": description: OK response content: application/json: schema: type: array items: $ref: '#/components/schemas/ReviewTemplateResponse' post: tags: - Review Template summary: Create new review template for given location Ids operationId: saveTemplate requestBody: content: application/json: schema: required: - bodyText - locationIds - name - reviewLinks type: object properties: name: minLength: 1 type: string locationIds: minItems: 1 type: array items: type: integer format: int64 bodyText: minLength: 1 type: string senderName: maxLength: 11 minLength: 3 type: string nullable: true email: nullable: true allOf: - $ref: '#/components/schemas/EmailTemplateRequest' reviewLinks: minItems: 1 type: array items: $ref: '#/components/schemas/ReviewLinkRequest' required: true responses: "401": description: User does not have right permission to perform this action or does not have access to specified locations "200": description: OK response content: application/json: schema: $ref: '#/components/schemas/ReviewTemplateResponse' /api/review-template/job: post: tags: - Review generation job summary: Schedule a review generation job for given customer location Ids and review template Id operationId: scheduleReviewTemplateJob requestBody: content: application/json: schema: $ref: '#/components/schemas/ReviewTemplateJobRequest' required: true responses: "401": description: User does not have right permission to perform this action or does not have access to specified locations "400": description: Invalid ReviewTemplateJobRequest or Review template id does not exist "200": description: OK response content: application/json: schema: $ref: '#/components/schemas/ReviewTemplateJobsResponse' /api/review-template/jobs: get: tags: - Review generation job summary: Find review template jobs for given location Ids operationId: getReviewTemplateJobs responses: "401": description: User does not have right permission to perform this action or does not have access to specified locations "404": description: Review template jobs not found "200": description: OK response content: application/json: schema: type: array items: $ref: '#/components/schemas/ReviewTemplateJobResponse' /api/review-template/media/upload-url: get: tags: - Review Template media summary: Get review template media presigned S3 url operationId: getPresignedS3UrlForReviewTemplateMediaUpload parameters: - name: type in: query required: true schema: minLength: 1 pattern: ^LOGO_PHOTO$ type: string - name: contentType in: query required: true schema: minLength: 1 pattern: ^image/png|image/jpeg$ type: string - name: fileName in: query required: true schema: minLength: 1 type: string responses: "403": description: User does not have right permission to perform this action "200": description: OK response content: application/json: schema: $ref: '#/components/schemas/ReviewTemplateMediaResponse' /api/review-template/{id}: put: tags: - Review Template summary: Update an existing review template operationId: updateTemplate parameters: - name: id in: path required: true schema: type: integer format: int64 requestBody: content: application/json: schema: required: - bodyText - locationIds - name - reviewLinks type: object properties: name: minLength: 1 type: string locationIds: minItems: 1 type: array items: type: integer format: int64 bodyText: minLength: 1 type: string senderName: maxLength: 11 minLength: 3 type: string nullable: true email: nullable: true allOf: - $ref: '#/components/schemas/EmailTemplateRequest' reviewLinks: minItems: 1 type: array items: $ref: '#/components/schemas/ReviewLinkRequest' required: true responses: "401": description: User does not have right permission to perform this action or does not have access to specified locations "400": description: Invalid ReviewTemplateRequest "404": description: Review template not found "200": description: OK response content: application/json: schema: $ref: '#/components/schemas/ReviewTemplateResponse' /sender-id/create: post: operationId: createSenderId requestBody: content: application/json: schema: $ref: '#/components/schemas/CreateSenderIdRequest' required: true responses: "200": description: createSenderId 200 response content: application/json: schema: type: string /sender-id/delete: delete: operationId: deleteSenderId requestBody: content: application/json: schema: $ref: '#/components/schemas/DeleteSenderIdRequest' required: true responses: "200": description: deleteSenderId 200 response content: application/json: schema: type: string components: schemas: CreateSenderIdRequest: required: - countryCode - messageTypes - senderId type: object properties: countryCode: type: string senderId: type: string messageTypes: type: array items: type: string DeleteSenderIdRequest: required: - countryCode - senderId type: object properties: senderId: type: string countryCode: type: string EmailMetricsResponse: type: object properties: externalJobId: type: string nullable: true sent: type: integer format: int64 nullable: true opened: type: integer format: int64 nullable: true clicked: type: integer format: int64 nullable: true EmailTemplateRequest: required: - actionButtonColor - footerText - privacyLink - senderEmailId - subject type: object properties: senderEmailId: minLength: 1 type: string format: email footerText: minLength: 1 type: string subject: minLength: 1 type: string actionButtonColor: minLength: 1 pattern: "^#([A-Fa-f0-9]{6}|[A-Fa-f0-9]{3})$" type: string privacyLink: minLength: 1 pattern: "^(https?)://[-a-zA-Z0-9+&@#/%?=~_|!:,.;]*[-a-zA-Z0-9+&@#/%=~_|]$" type: string mediaIds: type: array nullable: true items: type: integer format: int64 EmailTemplateResponse: required: - actionButtonColor - footerText - senderEmailId - subject type: object properties: senderEmailId: type: string footerText: type: string subject: type: string actionButtonColor: type: string privacyLink: type: string nullable: true media: type: array nullable: true items: $ref: '#/components/schemas/ReviewTemplateMediaResponse' GetIdentitiesResponse: type: object properties: identities: type: array nullable: true items: $ref: '#/components/schemas/IdentityResponse' message: type: string nullable: true IdentityResponse: type: object properties: emailAddress: type: string nullable: true identityType: type: string nullable: true verificationStatus: type: string nullable: true message: type: string nullable: true ReviewLinkRequest: required: - url type: object properties: url: minLength: 1 pattern: "^(https?)://[-a-zA-Z0-9+&@#/%?=~_|!:,.;]*[-a-zA-Z0-9+&@#/%=~_|]$|^[a-zA-Z0-9-_]+$" type: string label: type: string nullable: true ReviewLinkResponse: required: - url type: object properties: url: type: string label: type: string nullable: true ReviewTemplate: required: - bodyText - createdAt - name - type - updatedAt type: object properties: name: minLength: 1 type: string bodyText: minLength: 1 type: string senderEmailId: type: string format: email nullable: true senderName: maxLength: 11 minLength: 3 type: string nullable: true type: minLength: 1 pattern: ^EMAIL|SMS$ type: string createdAt: type: string format: date-time updatedAt: type: string format: date-time id: type: integer format: int64 nullable: true version: type: integer format: int64 nullable: true ReviewTemplateJob: required: - batchId - createdAt - customerLocationId - scheduledDateTimeUtc - status type: object properties: batchId: type: integer format: int64 reviewTemplate: nullable: true allOf: - $ref: '#/components/schemas/ReviewTemplate' customerLocationId: type: integer format: int64 status: minLength: 1 pattern: ^CREATED|IN_PROGRESS|DONE|FAILED$ type: string createdAt: type: string format: date-time scheduledDateTimeUtc: type: string format: date-time id: type: integer format: int64 nullable: true version: type: integer format: int64 nullable: true ReviewTemplateJobRequest: required: - customerLocationIds - reviewTemplateId - scheduledDateTimeUtc type: object properties: customerLocationIds: minItems: 1 type: array items: type: integer format: int64 reviewTemplateId: type: integer format: int64 scheduledDateTimeUtc: type: string ReviewTemplateJobResponse: type: object properties: batchId: type: integer format: int64 nullable: true reviewTemplate: nullable: true allOf: - $ref: '#/components/schemas/ReviewTemplateResponse' metrics: nullable: true allOf: - $ref: '#/components/schemas/EmailMetricsResponse' scheduledDateUTC: type: string nullable: true message: type: string nullable: true ReviewTemplateJobsResponse: type: object properties: jobs: type: array nullable: true items: $ref: '#/components/schemas/ReviewTemplateJob' message: type: string nullable: true ReviewTemplateMediaResponse: type: object properties: mediaId: type: integer format: int64 nullable: true message: type: string nullable: true uploadUrl: type: string nullable: true ReviewTemplateResponse: type: object properties: id: type: integer format: int64 nullable: true type: type: string nullable: true name: type: string nullable: true locationIds: type: array nullable: true items: type: integer format: int64 bodyText: type: string nullable: true senderName: type: string nullable: true email: nullable: true allOf: - $ref: '#/components/schemas/EmailTemplateResponse' reviewLinks: type: array nullable: true items: $ref: '#/components/schemas/ReviewLinkResponse' createdAt: type: string nullable: true updatedAt: type: string nullable: true errors: type: array nullable: true items: type: string message: type: string nullable: true