Documents

Create a profile document

POST create document(admin)

Endpoint

POST /api/v1/users/profile/documents

Parameters

Name Description
document[name] required Document name
document[file] required Document file

Request

Route

POST /api/v1/users/profile/documents

Headers

Accept: application/json
Content-Type: application/json
Authorization: Bearer eyJhbGciOiJIUzI1NiJ9.eyJzdWIiOiIxODc1Iiwic2NwIjoidXNlciIsImF1ZCI6bnVsbCwiaWF0IjoxNzQ4NTE2NTQwLCJleHAiOjE3NTExMDg1NDAsImp0aSI6IjNjNjdlMjcxLWIwY2YtNDcxZi1hNjdlLWI3ZGRkM2M1OWMzNyJ9.uAfpoedmGYpfrBTlutQwalcdoVNM_BcfD92IfUr7zNg
Host: example.org
Cookie: 

Body

{
  "document": {
    "file": "eyJfcmFpbHMiOnsiZGF0YSI6MzIsInB1ciI6ImJsb2JfaWQifX0=--b59537dc3d0aa992d0558d7186588f94b59ef352",
    "name": "asperiores",
    "profile_id": 705
  }
}

Response

Simulated Response

Status

200

Headers

x-frame-options: SAMEORIGIN
x-xss-protection: 0
x-content-type-options: nosniff
x-permitted-cross-domain-policies: none
referrer-policy: strict-origin-when-cross-origin
content-type: application/json; charset=utf-8
vary: Accept, Origin
etag: W/"0b2f010dfde3981a04c5df79b5738d77"
cache-control: max-age=0, private, must-revalidate
x-request-id: 76e89332-61c2-4fec-89b8-b99db094613e
x-runtime: 0.070769
content-length: 367

Body

{
  "document": {
    "id": 2,
    "file": {
      "id": 28,
      "signed_id": "eyJfcmFpbHMiOnsiZGF0YSI6MzIsInB1ciI6ImJsb2JfaWQifX0=--b59537dc3d0aa992d0558d7186588f94b59ef352",
      "byte_size": 596,
      "filename": "test",
      "url": "http://localhost:3000/rails/active_storage/blobs/redirect/eyJfcmFpbHMiOnsiZGF0YSI6MzIsInB1ciI6ImJsb2JfaWQifX0=--b59537dc3d0aa992d0558d7186588f94b59ef352/test"
    },
    "name": "asperiores"
  }
}