---
title: "POST api-app-v1-release-cap-external-alerts-refresh-token"
url: "https://capalert-developer-portal.apiddpm.com/apis/national-cap-alerting-service-api-1/versions/9738bb43-d24d-4239-8917-928fe84376ca/paths/api-app-v1-release-cap-external-alerts-refresh-token/post"
---

> Full API specification: https://capalert-developer-portal.apiddpm.com/apis/national-cap-alerting-service-api-1/versions/9738bb43-d24d-4239-8917-928fe84376ca.md

# /api/app/v1/release/cap-external/alerts/refresh-token

`POST` `/api/app/v1/release/cap-external/alerts/refresh-token`

ใช้ Refresh Token เพื่อขอ Access Token ใหม่ เมื่อ Access Token หมดอายุ

## Request body

Content types: `application/json`, `text/json`, `application/*+json`

## Responses

- `200` - Success
- `400` - Bad Request
- `401` - Unauthorized
- `403` - Forbidden
- `404` - Not Found
- `500` - Server Error
- `501` - Server Error

## OpenAPI definition

```yaml
openapi: 3.0.1
info:
  title: National CAP Alerting Service API
  version: 1.0.0
servers:
  - url: https://capalert-api-developer.apiddpm.com
paths:
  /api/app/v1/release/cap-external/alerts/refresh-token:
    post:
      tags:
        - CapExternal-Auth
      description: ใช้ Refresh Token เพื่อขอ Access Token ใหม่ เมื่อ Access Token หมดอายุ
      requestBody:
        content:
          application/json:
            schema:
              $ref: "#/components/schemas/NDWC.Cap.CapExternalAuth.RefreshTokenDto"
          text/json:
            schema:
              $ref: "#/components/schemas/NDWC.Cap.CapExternalAuth.RefreshTokenDto"
          application/*+json:
            schema:
              $ref: "#/components/schemas/NDWC.Cap.CapExternalAuth.RefreshTokenDto"
      responses:
        "200":
          description: Success
          content:
            text/plain:
              schema:
                $ref: "#/components/schemas/NDWC.Cap.CapExternalAuth.CapExternalAuthDto"
            application/json:
              schema:
                $ref: "#/components/schemas/NDWC.Cap.CapExternalAuth.CapExternalAuthDto"
            text/json:
              schema:
                $ref: "#/components/schemas/NDWC.Cap.CapExternalAuth.CapExternalAuthDto"
        "400":
          description: Bad Request
          content:
            text/plain:
              schema:
                $ref: "#/components/schemas/Volo.Abp.Http.RemoteServiceErrorResponse"
            application/json:
              schema:
                $ref: "#/components/schemas/Volo.Abp.Http.RemoteServiceErrorResponse"
            text/json:
              schema:
                $ref: "#/components/schemas/Volo.Abp.Http.RemoteServiceErrorResponse"
        "401":
          description: Unauthorized
          content:
            text/plain:
              schema:
                $ref: "#/components/schemas/Volo.Abp.Http.RemoteServiceErrorResponse"
            application/json:
              schema:
                $ref: "#/components/schemas/Volo.Abp.Http.RemoteServiceErrorResponse"
            text/json:
              schema:
                $ref: "#/components/schemas/Volo.Abp.Http.RemoteServiceErrorResponse"
        "403":
          description: Forbidden
          content:
            text/plain:
              schema:
                $ref: "#/components/schemas/Volo.Abp.Http.RemoteServiceErrorResponse"
            application/json:
              schema:
                $ref: "#/components/schemas/Volo.Abp.Http.RemoteServiceErrorResponse"
            text/json:
              schema:
                $ref: "#/components/schemas/Volo.Abp.Http.RemoteServiceErrorResponse"
        "404":
          description: Not Found
          content:
            text/plain:
              schema:
                $ref: "#/components/schemas/Volo.Abp.Http.RemoteServiceErrorResponse"
            application/json:
              schema:
                $ref: "#/components/schemas/Volo.Abp.Http.RemoteServiceErrorResponse"
            text/json:
              schema:
                $ref: "#/components/schemas/Volo.Abp.Http.RemoteServiceErrorResponse"
        "500":
          description: Server Error
          content:
            text/plain:
              schema:
                $ref: "#/components/schemas/Volo.Abp.Http.RemoteServiceErrorResponse"
            application/json:
              schema:
                $ref: "#/components/schemas/Volo.Abp.Http.RemoteServiceErrorResponse"
            text/json:
              schema:
                $ref: "#/components/schemas/Volo.Abp.Http.RemoteServiceErrorResponse"
        "501":
          description: Server Error
          content:
            text/plain:
              schema:
                $ref: "#/components/schemas/Volo.Abp.Http.RemoteServiceErrorResponse"
            application/json:
              schema:
                $ref: "#/components/schemas/Volo.Abp.Http.RemoteServiceErrorResponse"
            text/json:
              schema:
                $ref: "#/components/schemas/Volo.Abp.Http.RemoteServiceErrorResponse"
components:
  schemas:
    NDWC.Cap.CapExternalAuth.RefreshTokenDto:
      type: object
      properties:
        refreshToken:
          type: string
          nullable: true
      additionalProperties: false
    NDWC.Cap.CapExternalAuth.CapExternalAuthDto:
      type: object
      properties:
        status:
          $ref: "#/components/schemas/NDWC.Cap.StatusInfo"
        accessToken:
          type: string
          nullable: true
        refreshToken:
          type: string
          nullable: true
        expiresAt:
          type: string
          nullable: true
      additionalProperties: false
    Volo.Abp.Http.RemoteServiceErrorResponse:
      type: object
      properties:
        error:
          $ref: "#/components/schemas/Volo.Abp.Http.RemoteServiceErrorInfo"
      additionalProperties: false
    NDWC.Cap.StatusInfo:
      type: object
      properties:
        code:
          type: integer
          format: int32
          nullable: true
        message:
          type: string
          nullable: true
        timestamp:
          type: string
          nullable: true
      additionalProperties: false
    Volo.Abp.Http.RemoteServiceErrorInfo:
      type: object
      properties:
        code:
          type: string
          nullable: true
        message:
          type: string
          nullable: true
        details:
          type: string
          nullable: true
        data:
          type: object
          additionalProperties:
            type: object
            additionalProperties: false
          nullable: true
        validationErrors:
          type: array
          items:
            $ref: "#/components/schemas/Volo.Abp.Http.RemoteServiceValidationErrorInfo"
          nullable: true
      additionalProperties: false
    Volo.Abp.Http.RemoteServiceValidationErrorInfo:
      type: object
      properties:
        message:
          type: string
          nullable: true
        members:
          type: array
          items:
            type: string
          nullable: true
      additionalProperties: false
```
