Skip to content

Instantly share code, notes, and snippets.

@okmit
Last active November 24, 2019 13:18
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save okmit/d357e062144f3ac3432a34a5459bb413 to your computer and use it in GitHub Desktop.
Save okmit/d357e062144f3ac3432a34a5459bb413 to your computer and use it in GitHub Desktop.

HR Claims List

  • URL

    /v1/hr/claims

  • Method:

    GET

  • HEADERS

    Authorization=bearer ACCESS_TOKEN

  • URL Params

    Required:

    none

    Optional:

    per_page=[integer]
    page=[integer]
    q[date_eq]=[text]

    ...

  • Data Params

    none

  • Success Response:

    • Code: 200 OK
      Content: {"data":{
      "claims":[
      {"id":1,"date":"DATE","complaint":"TEXT"},

      {"id":2,"date":"DATE","complaint":"TEXT"}
      ],
      "pagination":{"page":1,"per_page":2,"total":10,"pages":5}}}
  • Error Response:

    • Code: 401 UNAUTHORIZED
      Content: { "error": "Invalid access token" }

    OR

    • Code: 401 UNAUTHORIZED
      Content { "error": "You don't have permission" }
  • Sample Call:

  • Notes:

in search query

*_eq - equal
*_cont Contains value

HR Employee Claim Create

  • URL

    /v1/employees/:employee_id/claims

  • Method:

    POST

  • HEADERS

    Authorization=bearer ACCESS_TOKEN

URL Params

Required:

employee_id=[integer]

  • Data Params

    hr_employee_claim[date]=[date]
    hr_employee_claim[complaint]=[text]

  • Success Response:

    • Code: 201 CREATED
      Content: {"data":
      {"vacation":{
      "id":1,
      "date":"DATE",
      "complaint":"TEXT",
      }}}
  • Error Response:

    • Code: 401 UNAUTHORIZED
      Content: { "error": "Invalid access token" }

    OR

    • Code: 401 UNAUTHORIZED
      Content { "error": "You don't have permission" }

    OR

    • Code: 422 UNPROCESSABLE ENTITY
      Content: {"errors":{
      "date":["can't be blank"],
      "complaint":["can't be blank"]
      }}
  • Sample Call:

  • Notes:

HR Employee Claim Delete

  • URL

    /v1/employees/:employee_id/claims/:id

  • Method:

    DELETE

  • HEADERS

    Authorization=bearer ACCESS_TOKEN

  • URL Params

    Required:

    id=[integer]
    employee_id=[integer]

  • Data Params

  • Success Response:

    • Code: 200 OK
      Content:
  • Error Response:

    • Code: 401 UNAUTHORIZED
      Content: { "error": "Invalid access token" }

    OR

    • Code: 401 UNAUTHORIZED
      Content { "error": "You don't have permission" }

    OR

    • Code 404 NOT FOUND
      Content: { "error": "Not Found" }

    OR

    • Code: 404 UNPROCESSABLE ENTITY
      Content:
  • Sample Call:

  • Notes:

HR Employee Claim Update

  • URL

    /v1/employees/:employee_id/claims/:id

  • Method:

    PUT | PATCH

  • HEADERS

    Authorization=bearer ACCESS_TOKEN

  • URL Params

    Required:

    id=[integer]
    employee_id=[integer]

  • Data Params

    hr_employee_claim[date]=[date]
    hr_employee_claim[complaint]=[text]

  • Success Response:

    • Code: 200 OK
      Content: {"data":
      {"claim":{
      "id":28,
      "date":"DATE",
      "complaint":"TEXT"
      }}}
  • Error Response:

    • Code: 401 UNAUTHORIZED
      Content: { "error": "Invalid access token" }

    OR

    • Code: 401 UNAUTHORIZED
      Content { "error": "You don't have permission" }

    OR

    • Code 404 NOT FOUND
      Content: { "error": "Not Found" }

    OR

    • Code: 404 UNPROCESSABLE ENTITY
      Content: { "errors":{"date":["can't be blank"]}}
  • Sample Call:

  • Notes:

HR Employee Claims List

  • URL

    /v1/employees/:employee_id/claims

  • Method:

    GET

  • HEADERS

    Authorization=bearer ACCESS_TOKEN

  • URL Params

    Required:

    none

    Optional:

    per_page=[integer]
    page=[integer]
    q[date_eq]=[text]
    ...

  • Data Params

    none

  • Success Response:

    • Code: 200 OK
      Content: {"data":{
      "claims":[
      {"id":1,"date":"DATE","complaint":"TEXT"},

      {"id":2,"date":"DATE","complaint":"TEXT"},

      ],
      "pagination":{"page":1,"per_page":2,"total":10,"pages":5}}}
  • Error Response:

    • Code: 401 UNAUTHORIZED
      Content: { "error": "Invalid access token" }

    OR

    • Code: 401 UNAUTHORIZED
      Content { "error": "You don't have permission" }
  • Sample Call:

  • Notes:

in search query

*_eq - equal
*_cont Contains value

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment