Skip to main content
POST
/
anomalies
/
v2
/
mb
/
observations
Create an observation from mobile
curl --request POST \
  --url https://z52mnqg347.execute-api.eu-west-3.amazonaws.com/main/anomalies/v2/mb/observations \
  --header 'Authorization: Bearer <token>' \
  --header 'Content-Type: <content-type>' \
  --header 'X-Session-Token: <x-session-token>' \
  --data '
{
  "description": "Anomaly description",
  "images": [
    {
      "uploadId": "aszdz-edzdz-dzdzd-dzdzd",
      "name": "example.jpg",
      "mimeType": "image/jpeg",
      "size": 1024
    }
  ],
  "critic": true,
  "reporter": {
    "firstName": "John",
    "lastName": "Doe"
  },
  "location": {
    "floor": "1st Floor",
    "room": "1st Floor"
  },
  "dueAt": "2024-12-01T12:34:56.000Z"
}
'
{
  "data": {
    "id": 1,
    "type": 1,
    "status": 1,
    "title": "Anomaly title",
    "description": "Anomaly description",
    "risk": 1,
    "siteId": 1,
    "technicalInstallationId": 1,
    "equipmentId": 1,
    "reportedById": 1,
    "positionId": 1,
    "resolvedComment": "Anomaly resolved",
    "resolvedById": 1,
    "reporter": "John Doe",
    "alreadyReported": false,
    "sortOrder": 1,
    "anomalyNumber": "A-12345",
    "pageNumber": 12,
    "reportId": 1,
    "dueAt": "2024-12-01T12:34:56.000Z",
    "observedAt": "2024-12-01T12:34:56.000Z",
    "resolvedAt": "2024-12-01T12:34:56.000Z",
    "deletedAt": "2024-01-15T08:45:00.000Z",
    "archivedAt": "2024-01-15T08:45:00.000Z",
    "updatedAt": "2024-12-05T14:56:23.000Z",
    "createdAt": "2024-01-15T08:45:00.000Z",
    "ref": "E42-RI12-3",
    "metadata": {
      "location": {
        "floor": "1st floor",
        "room": "1st room"
      },
      "reporter": {
        "firstName": "John",
        "lastName": "Doe"
      },
      "resolvedComment": "Anomaly resolved"
    },
    "imgs": [
      "image1",
      "image2"
    ],
    "images": [
      {
        "file": "image1",
        "size": 1024
      },
      {
        "file": "image2",
        "size": 2048
      }
    ],
    "priority": 1
  },
  "upload": [
    {
      "uploadId": "1",
      "presignedUrl": "https://bucket.s3.amazonaws.com/1",
      "id": "1"
    }
  ]
}

Authorizations

Authorization
string
header
required

Bearer authentication header of the form Bearer <token>, where <token> is your auth token.

Headers

Content-Type
enum<string>
required

Content type, must be "application/json".

Available options:
application/json
X-Session-Token
string
required

Session token used for authenticating the request.

Example:

"eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ1c2VySWQiOiIxMjM0NTY3ODkwIiwic2Vzc2lvbklkIjoiYWJjZGVmMTIzNDU2IiwiaWF0IjoxNjA1MDk3ODk5LCJleHAiOjE2MDUxODQyOTl9.4XRQ1iXDyvEj5LgPZHbmTmzOZs98M3YPOzgf3MhxjaI"

Body

application/json

Details required to create an observation

description
string
required

Anomaly description.

Maximum string length: 2500
Example:

"Anomaly description"

images
object[]
required
Maximum array length: 10
critic
boolean
required

Anomaly urgency.

Example:

true

reporter
object
required

Reporter of the anomaly.

Example:
{ "firstName": "John", "lastName": "Doe" }
location
object

Location details of the anomaly.

Example:
{ "floor": "1st Floor", "room": "1st Floor" }
dueAt

Anomaly dueAt.

Example:

"2024-12-01T12:34:56.000Z"

Response

201 - application/json

The observation have been created

data
object
required
upload
object[]
required