Skip to content
Xiaying Ji edited this page May 11, 2025 · 1 revision

WeGotThis API Overview

  • OpenAPI Version: 3.0.0
  • Title: WeGotThis API
  • API Version: 0.1
  • Servers:
    • http://localhost:8000/api

pahts

POST /v1/offer/create

Summary: Create a new offer
Security: Locale (header), ApiToken (header)
Request Body (application/json):

{
  "title": "Dog Walking Service",
  "description": "I can walk your dog for 30 minutes.",
  "location": "New York, NY",
  "priceModeId": 1,
  "price": 20,
  "availability": true,
  "typeId": 1,
  "categoryIds": [1],
  "startTime": 1743210637,
  "endTime": 1743214237
}

Responses:

  • 200 – Offer created successfully

PUT /v1/offer/edit/{offerId}

Summary: Edit an existing offer
Security: Locale, ApiToken
Path Parameters:

Name In Type Required Description
offerId path string yes ID of the offer to edit

Request Body (application/json):

{ /* same structure as CreateOfferRequest */ }

Responses:

  • 200 – Offer updated successfully

GET /v1/offer/get/{offerId}

Summary: Get details of a single offer
Security: Locale, ApiToken
Path Parameters:

Name In Type Required Description
offerId path string yes ID of the offer to retrieve

Responses:

  • 200 – Offer retrieved successfully

GET /v1/offer/getAll

Summary: Get a list of all offers
Security: Locale, ApiToken

Responses:

  • 200 – List of offers retrieved successfully

GET /v1/offer/getAll/user/{userId}

Summary: Get all offers for a specific user
Security: Locale, ApiToken
Path Parameters:

Name In Type Required Description
userId path string yes ID of the user

Responses:

  • 200 – List of offers retrieved successfully

DELETE /v1/offer/delete/{offerId}

Summary: Delete an offer
Security: Locale, ApiToken
Path Parameters:

Name In Type Required Description
offerId path string yes ID of the offer to delete

Responses:

  • 200 – Offer deleted successfully

GET /v1/offer/template

Summary: Get an offer template list
Security: Locale, ApiToken

Responses:

  • 200 – List of offers retrieved successfully

PUT /v1/offer/upload/images/{offerId}

Summary: Upload images for an offer
Security: Locale, ApiToken
Path Parameters:

Name In Type Required Description
offerId path string yes ID of the offer to upload

Request Body (multipart/form-data):

Field Type Format Description
image string binary Image file to upload

Responses:

  • 200 – Images uploaded successfully

GET /v1/offer/my/offers

Summary: Get a list of offers created by the current user
Security: Locale, ApiToken

Responses:

  • 200 – List of offers retrieved successfully

PUT /v1/offer/add/requests/{offerId}

Summary: Add a request to an offer
Security: Locale, ApiToken
Path Parameters:

Name In Type Required Description
offerId path string yes ID of the offer to add to

Responses:

  • 200 – Request added successfully

GET /v1/offer/getMyRequestsToOffer

Summary: Get requests made by the current user to offers
Security: Locale, ApiToken

Responses:

  • 200 – Requests retrieved successfully

GET /v1/offer/getRequestsOnMyOffers

Summary: Get requests on the current user’s offers
Security: Locale, ApiToken

Responses:

  • 200 – Requests retrieved successfully

GET /v1/offer/getAll/requests

Summary: Get all requests across all offers
Security: Locale, ApiToken

Responses:

  • 200 – Requests retrieved successfully

PUT /v1/offer/complete/{offerId}/{requestId}

Summary: Complete an offer request
Security: Locale, ApiToken
Path Parameters:

Name In Type Required Description
offerId path string yes ID of the offer
requestId path string yes ID of the request

Responses:

  • 200 – Request completed successfully

PUT /v1/offer/accept/{offerId}/{requestId}

Summary: Accept an offer request
Security: Locale, ApiToken
Path Parameters: same as above

Responses:

  • 200 – Request accepted successfully

PUT /v1/offer/reject/{offerId}/{requestId}

Summary: Reject an offer request
Security: Locale, ApiToken
Path Parameters: same as above

Responses:

  • 200 – Request rejected successfully

PUT /v1/offer/withdraw/{offerId}/{requestId}

Summary: Withdraw a previously made request
Security: Locale, ApiToken
Path Parameters: same as above

Responses:

  • 200 – Request withdrawn successfully

PUT /v1/offer/giveReview/{offerId}/{requestId}

Summary: Give a review on an offer request
Security: Locale, ApiToken
Path Parameters: same as above
Request Body (application/json):

{
  "text": "Good Service",
  "rating": 5
}  

Responses:

  • 200 – Review submitted successfully

Components

Security Schemes

Name Type In Header Name
ApiToken apiKey header x-auth-token
Locale apiKey header x-locale

Schemas

LoginRequest

Property Type Example
email string sheetab@technohaven.com
password string 123456
expire boolean true

RegistrationRequest

Property Type Example
email string sheetab@technohaven.com
password string 123456
firstName string Hafiz
lastName string Sheetab
expire boolean true

ForgotPasswordRequest

Property Type Example
email string sheetab@technohaven.com

ResetPasswordRequest

Property Type Example
password string 123456

CreateOfferRequest

Property Type Description Example
title string — Dog Walking Service
description string — I can walk your dog for 30 minutes.
location string — New York, NY
priceModeId number — 1
price number — 20
availability boolean defaults to true true
typeId number — 1
categoryIds array of number [1]
startTime number Estimated start timestamp 1743210637
endTime number Estimated end timestamp 1743214237

EditOfferRequest

Same structure as CreateOfferRequest.


GiveReviewRequest

Property Type Example
text string Good Service
rating number 5

ChangeSelfRequest

Property Type Example
firstName string Hafiz
lastName string Sheetab
expire boolean true
password string asdfghjk
phoneNumber string 41772654787
location string Zurich
categoryIds array of number
(e.g. [1])