openreplay/backend/cmd/http
Alexander 6830c8879f
web module refactoring (#2725)
* feat(server): moved an http server object into a pkg subdir to be reusable for http, spots, and integrations

* feat(web): isolated web module (server, router, middleware, utils) used in spots and new integrations

* feat(web): removed possible panic

* feat(web): split all handlers from http service into different packages for better management.

* feat(web): changed router's method signature

* feat(web): added missing handlers interface

* feat(web): added health middleware to remove unnecessary checks

* feat(web): customizable middleware set for web servers

* feat(web): simplified the handler's structure

* feat(web): created an unified server.Run method for all web services (http, spot, integrations)

* feat(web): fixed a json size limit issue

* feat(web): removed Keys and PG connection from router

* feat(web): simplified integration's main file

* feat(web): simplified spot's main file

* feat(web): simplified http's main file (builder)

* feat(web): refactored audit trail functionality

* feat(web): added ee version of audit trail

* feat(web): added ee version of conditions module

* feat(web): moved ee version of some web session structs

* feat(web): new format of web metrics

* feat(web): added new web metrics to all handlers

* feat(web): added justExpired feature to web ingest handler

* feat(web): added small integrations improvements
2024-11-21 17:48:04 +01:00
..
main.go web module refactoring (#2725) 2024-11-21 17:48:04 +01:00
README.md Chore(release): v1.7.0 (#578) 2022-07-07 18:44:43 +02:00

HTTP Endpoints

Start Mobile Session

POST /v1/ios/start

Request

application/json

* - required
{
	projectID*  			number  // Encoded ProjectID
	trackerVersion*   string  // Tracker version string
	revID             string  // Set by user
	userUUID          string  // User ID, should be derived from local storage connected to user
	userOSVersion     string 
	userDevice        string
	userDeviceType    number  //
	performance       // 
}

Response

200 application/json
{
	imagesHashList  // list of most friquently used image hash strings
	token           // Authorisation token to use in other requests (Bearer)
	userUUID        // Should be stored in local storage
}

Push message batch

POST /v1/ios/append

Request

application/octet-stream

<binary encoded messages>

Response

200 OK

OR

401 Unauthorised - token timed out. Start new session

Push late message batch (after app reload - crashes etc.)

POST /v1/ios/late

Request

application/octet-stream

<binary encoded messages>

Response

200 OK

Push images

POST /v1/ios/images

Request

multipart/form-data values: projectID [required] // Encoded ProjectID

Binary files with the hash-filename in the filename header each.

Response

200 OK