Update

PUT /api/announcements/{id}

Update an announcement

Path parameters

  • id string Required
application/json

Body Required

  • title string Required

    Minimum length is 4, maximum length is 100.

  • content string Required

    Maximum length is 20000.

  • description string | null Required

    Maximum length is 150.

  • isPublished boolean | null

    Default value is false.

Responses

  • 200 application/json

    Successful Response

    Hide response attributes Show response attributes object
    • title string Required

      Minimum length is 4, maximum length is 100.

    • content string Required

      Maximum length is 20000.

    • description string | null Required

      Maximum length is 150.

    • isPublished boolean | null

      Default value is false.

    • id string Required
    • contentSummary string Required
    • publishedAt string(date-time) | null
    • createdAt string(date-time) Required
    • updatedAt string(date-time) | null
  • 422 application/json

    Validation Error

    Hide response attribute Show response attribute object
    • detail array[object]
      Hide detail attributes Show detail attributes object
      • loc array[string | integer] Required
      • msg string Required
      • type string Required
PUT /api/announcements/{id}
curl \
 -X PUT https://metropolitanabogota.org/api/announcements/{id} \
 -H "Authorization: Bearer $ACCESS_TOKEN" \
 -H "Content-Type: application/json" \
 -d '{"title":"string","content":"string","description":"string","isPublished":false}'
Request example
{
  "title": "string",
  "content": "string",
  "description": "string",
  "isPublished": false
}
Response examples (200)
{
  "title": "string",
  "content": "string",
  "description": "string",
  "isPublished": false,
  "id": "string",
  "contentSummary": "string",
  "publishedAt": "2024-05-04T09:42:00+00:00",
  "createdAt": "2024-05-04T09:42:00+00:00",
  "updatedAt": "2024-05-04T09:42:00+00:00"
}
Response examples (422)
{
  "detail": [
    {
      "loc": [
        "string"
      ],
      "msg": "string",
      "type": "string"
    }
  ]
}