Erply resource API

The resource API from Erply — 3 operation(s) for resource.

OpenAPI Specification

erply-resource-api-openapi.yml Raw ↑
swagger: '2.0'
info:
  description: "\n\n## Overview\n\n\n\nThis application offers an API for managing assignments and tasks.\n\n\n\nGraphQL endpoint for the same API is [also available](/graph)\n\n\n\n<details><summary>Authentication</summary>\n\n\n\n> \n\n> Authenticate using your Erply credentials and get a sessionKey. This sessionKey and your Erply clientCode must be provided in the HTTP headers of every request. You do not have to authenticate against this API - valid Erply sessionKey-s from other sources are also acceptable. To authenticate using this API, use the `POST /api/v1/auth` endpoint.\n\n>\n\n</details>\n\n"
  title: assignments Assortment resource API
  contact: {}
  version: 2.36.5
host: ''
basePath: ''
schemes: []
tags:
- name: resource
paths:
  /api/v1/resource:
    get:
      security:
      - ErplyClientCode: []
      - ErplySession: []
      - ErplyJWT: []
      - AccessToken: []
      consumes:
      - application/json
      produces:
      - application/json
      tags:
      - resource
      summary: Look up resources
      parameters:
      - type: array
        items:
          type: integer
        collectionFormat: csv
        description: Warehouse ID-s
        name: warehouseId
        in: query
      - type: boolean
        description: If total matching record count should be return in response header
        name: withTotalCount
        in: query
      - type: integer
        description: Result page size
        name: pageSize
        in: query
      - type: integer
        description: Result page number
        name: pageNr
        in: query
      - type: string
        description: 'Sorting order. Supported values are: `id`, `order`'
        name: sort
        in: query
      responses:
        '200':
          description: OK
          schema:
            type: array
            items:
              $ref: '#/definitions/ResourceResponse'
        '401':
          description: Forbidden
        '500':
          description: Internal Server Error
    post:
      security:
      - ErplyClientCode: []
      - ErplySession: []
      - ErplyJWT: []
      - AccessToken: []
      consumes:
      - application/json
      produces:
      - application/json
      tags:
      - resource
      summary: Add a new resource record
      parameters:
      - description: Resource record
        name: record
        in: body
        required: true
        schema:
          $ref: '#/definitions/ResourceRequest'
      responses:
        '201':
          description: Created
          schema:
            $ref: '#/definitions/ResourceResponse'
        '400':
          description: Bad Request
        '401':
          description: Forbidden
        '500':
          description: Internal Server Error
  /api/v1/resource/{resourceId}:
    delete:
      security:
      - ErplyClientCode: []
      - ErplySession: []
      - ErplyJWT: []
      - AccessToken: []
      description: Delete one resource record
      consumes:
      - application/json
      produces:
      - application/json
      tags:
      - resource
      summary: Delete one resource record
      parameters:
      - type: integer
        description: Record id
        name: resourceId
        in: path
        required: true
      responses:
        '200':
          description: OK
        '400':
          description: Bad Request
        '401':
          description: Forbidden
        '404':
          description: Not Found
        '500':
          description: Internal Server Error
    patch:
      security:
      - ErplyClientCode: []
      - ErplySession: []
      - ErplyJWT: []
      - AccessToken: []
      consumes:
      - application/json
      produces:
      - application/json
      tags:
      - resource
      summary: Update resource record
      parameters:
      - type: integer
        description: Record id
        name: resourceId
        in: path
        required: true
      - description: Resource record
        name: record
        in: body
        required: true
        schema:
          $ref: '#/definitions/ResourceRequest'
      responses:
        '200':
          description: OK
          schema:
            $ref: '#/definitions/ResourceResponse'
        '400':
          description: Bad Request
        '401':
          description: Forbidden
        '404':
          description: Not Found
        '500':
          description: Internal Server Error
  /api/v1/resource/{resourceId}/order:
    post:
      security:
      - ErplyClientCode: []
      - ErplySession: []
      - ErplyJWT: []
      - AccessToken: []
      description: Allows changing the order of resources. A single record can be moved either in front of any other resource in the same warehouse, or to the end of the resource list
      consumes:
      - application/json
      produces:
      - application/json
      tags:
      - resource
      summary: Change the order of one resource
      parameters:
      - type: integer
        description: Resource id that must be moved to new position
        name: resourceId
        in: path
        required: true
      - description: Reorder parameters. inFrontOfId defines the record in front of which the moved resource should be placed
        name: record
        in: body
        required: true
        schema:
          $ref: '#/definitions/ResourceOrderRequest'
      responses:
        '200':
          description: OK
        '400':
          description: Bad Request
        '401':
          description: Forbidden
        '404':
          description: Not Found
        '500':
          description: Internal Server Error
definitions:
  core.Translatable:
    type: object
    properties:
      ar:
        type: string
        example: ' '
      cs:
        type: string
        example: ' '
      da:
        type: string
        example: ' '
      de:
        type: string
        example: ' '
      default:
        type: string
        example: ' '
      el:
        type: string
        example: ' '
      en:
        type: string
        example: ' '
      es:
        type: string
        example: ' '
      et:
        type: string
        example: ' '
      fi:
        type: string
        example: ' '
      fo:
        type: string
        example: ' '
      fr:
        type: string
        example: ' '
      it:
        type: string
        example: ' '
      lt:
        type: string
        example: ' '
      lv:
        type: string
        example: ' '
      nl:
        type: string
        example: ' '
      'no':
        type: string
        example: ' '
      pl:
        type: string
        example: ' '
      ru:
        type: string
        example: ' '
      sv:
        type: string
        example: ' '
      th:
        type: string
        example: ' '
      tr:
        type: string
        example: ' '
      vi:
        type: string
        example: ' '
      zh_Hans:
        type: string
        example: ' '
      zh_Hant:
        type: string
        example: ' '
  ResourceOrderRequest:
    type: object
    properties:
      inFrontOfId:
        description: 'ID of the record in front of which the moved resource should be placed. Must belong to a record associated

          with the same warehouse. If left nil, the resource will be moved to the last place'
        type: integer
  ResourceResponse:
    type: object
    properties:
      code:
        type: string
      createdAt:
        type: string
      createdById:
        type: integer
      data:
        type: object
      defaultAssignedToId:
        type: integer
      id:
        type: integer
      name:
        $ref: '#/definitions/core.Translatable'
      order:
        type: integer
      updatedAt:
        type: string
      updatedById:
        type: integer
      warehouseId:
        type: integer
  ResourceRequest:
    type: object
    properties:
      code:
        type: string
      data:
        type: object
      defaultAssignedToId:
        type: integer
      id:
        type: integer
      name:
        $ref: '#/definitions/core.Translatable'
      warehouseId:
        type: integer
securityDefinitions:
  AccessToken:
    type: apiKey
    name: accessToken
    in: header
  ErplyClientCode:
    type: apiKey
    name: clientCode
    in: header
  ErplyJWT:
    type: apiKey
    name: jwt
    in: header
  ErplySession:
    type: apiKey
    name: sessionKey
    in: header
  RequestKey:
    type: apiKey
    name: requestKey
    in: header