> ## Documentation Index
> Fetch the complete documentation index at: https://make.edicus.io/docs/llms.txt
> Use this file to discover all available pages before exploring further.

# 리소스 개수 조회

> 검색 조건에 맞는 리소스의 개수를 조회한다. 요청 형식은 리소스 검색과 같다.

응답은 `{ count: number }`다. 실제 코드는 개수만 반환한다.



## OpenAPI

````yaml /api-reference/openapi.json post /resapi/query/count
openapi: 3.1.0
info:
  title: Edicus Server API
  version: 1.1.5
  description: >-
    Edicus 편집기 연동에 필요한 서버 API입니다. 토큰 발급, 프로젝트 조회, 주문 처리, 폰트와 상품 정보, 템플릿 등록을
    다룹니다.


    ## 반드시 서버에서만 호출합니다


    모든 엔드포인트는 `edicus-api-key` 헤더를 요구합니다. 이 키는 고객사 서버에만 두고 브라우저 코드나 공개 저장소에 넣지
    않습니다. 브라우저에는 이 API로 발급받은 토큰만 내려보냅니다.


    ## 오류 응답


    `api.edicus.io`는 실패를 4xx와 5xx 상태 코드로 알리고, body는 언제나 `{"error": {"code",
    "message", "details", "request_id"}}` 모양입니다. `error.code`로 분기합니다. 같은
    `request_id`가 응답 헤더 `x-request-id`에도 실립니다.


    `resource-dot-edicusbase.appspot.com`은 방식이 다릅니다. 파라미터 누락은 `400`, 인증 실패는
    `401`, 그 밖의 모든 실패는 `500`이고, body에 `error` 객체가 없습니다.


    ## 응답 형식


    응답의 `content-type`은 `application/json`입니다.
  contact:
    name: 모션원
    url: https://edicus.io
servers:
  - url: https://api.edicus.io
    description: Server API 호스트
security:
  - edicusApiKey: []
tags:
  - name: Auth
    description: 토큰 발급
  - name: Projects
    description: 프로젝트 조회, 삭제, 복제
  - name: Orders
    description: 잠정 주문, 확정 주문, 취소
  - name: Fonts
    description: 폰트 그룹과 폰트 목록
  - name: Products
    description: 상품과 상품 카테고리 정보
  - name: Templates
    description: 리소스 토큰과 템플릿 패키지 등록
  - name: Resources
    description: 리소스 검색과 사용자 이미지
paths:
  /resapi/query/count:
    post:
      tags:
        - Resources
      summary: 리소스 개수 조회
      description: |-
        검색 조건에 맞는 리소스의 개수를 조회한다. 요청 형식은 리소스 검색과 같다.

        응답은 `{ count: number }`다. 실제 코드는 개수만 반환한다.
      operationId: countResources
      parameters: []
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              properties:
                option:
                  $ref: '#/components/schemas/ResourceQueryOption'
      responses:
        '200':
          description: 성공.
          content:
            application/json:
              schema:
                type: object
                properties:
                  count:
                    type: integer
              example:
                count: 42
        '400':
          description: |-
            필수 파라미터가 없습니다. **body가 객체가 아니라 JSON 문자열 하나입니다.** 예: `"no option"`

            이 엔드포인트가 내는 값: `no option`, `no type in option`
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ResourceBadRequest'
              example: no option
        '401':
          description: >-
            인증 실패입니다. `api.edicus.io`와 달리 `error` 객체로 감싸지 않고 `{"code": ...}`를
            그대로 내려줍니다. code는 `invalid-edicus-api-key`, `no-edicus-id-token`,
            `token-expired`, `invalid-role` 중 하나입니다.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ResourceAuthError'
              example:
                code: invalid-edicus-api-key
        '500':
          description: >-
            처리 중 오류입니다. 리소스 API는 인증 실패와 파라미터 누락을 뺀 **모든 실패를 500으로 내려줍니다.** body는
            던져진 오류 객체를 그대로 직렬화한 것이라, Error 인스턴스인 경우 빈 객체 `{}`가 됩니다.
          content:
            application/json:
              schema:
                type: object
              example: {}
      servers:
        - url: https://resource-dot-edicusbase.appspot.com
          description: 리소스 API 호스트
components:
  schemas:
    ResourceQueryOption:
      type: object
      properties:
        type:
          type: string
          enum:
            - template
            - layout
            - background
            - sticker
            - deco
            - mask
            - guide
            - token
          description: 리소스 타입
        visibilities:
          type: array
          items:
            type: string
            enum:
              - private
              - public
              - deleted
        order:
          type: string
          enum:
            - asc
            - desc
          default: asc
          description: 시간 정렬
        limit:
          type: integer
          default: 0
          description: 개수 제한. 0이면 무제한
        tags:
          type: array
          items:
            type: string
        psCodes:
          type: array
          items:
            type: string
    ResourceBadRequest:
      type: string
      description: 리소스 API의 파라미터 누락 응답입니다. 객체가 아니라 JSON 문자열 하나로 옵니다.
      examples:
        - no option
    ResourceAuthError:
      type: object
      description: 리소스 API의 인증 실패 응답입니다. Server API의 `ErrorBody`와 모양이 다릅니다.
      properties:
        code:
          type: string
  securitySchemes:
    edicusApiKey:
      type: apiKey
      in: header
      name: edicus-api-key
      description: 모션원에서 발급받는 API 키입니다. 외부에 유출되지 않도록 각별히 주의합니다.

````

This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.