Skip to content

Latest commit

 

History

History
278 lines (221 loc) · 24.5 KB

File metadata and controls

278 lines (221 loc) · 24.5 KB

Screening

Overview

Available Operations

create_screening_order

Create Screening Order

Example Usage

require 'stackone_client'

Models = ::StackOne::Models
s = ::StackOne::StackOne.new(
  security: Models::Shared::Security.new(
    password: '',
    username: ''
  )
)
res = s.screening.create_screening_order(screening_create_order_request_dto: Models::Shared::ScreeningCreateOrderRequestDto.new(
  candidate: Models::Shared::ScreeningOrderCandidate.new(
    email: 'john.doe@example.com',
    first_name: 'John',
    last_name: 'Doe'
  ),
  package_id: '54321',
  passthrough: {
    'other_known_names' => 'John Doe',
  },
  unified_custom_fields: {
    'my_project_custom_field_1' => 'REF-1236',
    'my_project_custom_field_2' => 'some other value',
  }
), x_account_id: '<id>', prefer: 'heartbeat')

unless res.create_result.nil?
  # handle response
end

Parameters

Parameter Type Required Description Example
screening_create_order_request_dto Models::Shared::ScreeningCreateOrderRequestDto ✔️ N/A
x_account_id ::String ✔️ The account identifier
prefer T.nilable(::String) Set to "heartbeat" to enable keep-alive newline heartbeats during long-running requests. Response includes Preference-Applied: heartbeat header when honored. (RFC 7240) heartbeat

Response

T.nilable(Models::Operations::ScreeningCreateScreeningOrderResponse)

Errors

Error Type Status Code Content Type
Models::Errors::BadRequestResponse 400 application/json
Models::Errors::UnauthorizedResponse 401 application/json
Models::Errors::ForbiddenResponse 403 application/json
Models::Errors::NotFoundResponse 404 application/json
Models::Errors::RequestTimedOutResponse 408 application/json
Models::Errors::ConflictResponse 409 application/json
Models::Errors::PreconditionFailedResponse 412 application/json
Models::Errors::UnprocessableEntityResponse 422 application/json
Models::Errors::TooManyRequestsResponse 429 application/json
Models::Errors::InternalServerErrorResponse 500 application/json
Models::Errors::NotImplementedResponse 501 application/json
Models::Errors::BadGatewayResponse 502 application/json
Errors::APIError 4XX, 5XX */*

get_screening_package

Get Screening Package

Example Usage

require 'stackone_client'

Models = ::StackOne::Models
s = ::StackOne::StackOne.new(
  security: Models::Shared::Security.new(
    password: '',
    username: ''
  )
)

req = Models::Operations::ScreeningGetScreeningPackageRequest.new(
  prefer: 'heartbeat',
  fields_: 'id,remote_id,name,description,unified_custom_fields',
  id: '<id>',
  x_account_id: '<id>'
)
res = s.screening.get_screening_package(request: req)

unless res.screening_package_result.nil?
  # handle response
end

Parameters

Parameter Type Required Description
request Models::Operations::ScreeningGetScreeningPackageRequest ✔️ The request object to use for the request.

Response

T.nilable(Models::Operations::ScreeningGetScreeningPackageResponse)

Errors

Error Type Status Code Content Type
Models::Errors::BadRequestResponse 400 application/json
Models::Errors::UnauthorizedResponse 401 application/json
Models::Errors::ForbiddenResponse 403 application/json
Models::Errors::NotFoundResponse 404 application/json
Models::Errors::RequestTimedOutResponse 408 application/json
Models::Errors::ConflictResponse 409 application/json
Models::Errors::PreconditionFailedResponse 412 application/json
Models::Errors::UnprocessableEntityResponse 422 application/json
Models::Errors::TooManyRequestsResponse 429 application/json
Models::Errors::InternalServerErrorResponse 500 application/json
Models::Errors::NotImplementedResponse 501 application/json
Models::Errors::BadGatewayResponse 502 application/json
Errors::APIError 4XX, 5XX */*

list_screening_packages

List Screening Packages

Example Usage

require 'stackone_client'

Models = ::StackOne::Models
s = ::StackOne::StackOne.new(
  security: Models::Shared::Security.new(
    password: '',
    username: ''
  )
)

req = Models::Operations::ScreeningListScreeningPackagesRequest.new(
  prefer: 'heartbeat',
  fields_: 'id,remote_id,name,description,unified_custom_fields',
  filter: Models::Operations::ScreeningListScreeningPackagesQueryParamFilter.new(
    updated_after: DateTime.iso8601('2020-01-01T00:00:00.000Z')
  ),
  x_account_id: '<id>'
)
res = s.screening.list_screening_packages(request: req)

unless res.screening_packages_paginated.nil?
  # handle response
end

Parameters

Parameter Type Required Description
request Models::Operations::ScreeningListScreeningPackagesRequest ✔️ The request object to use for the request.

Response

T.nilable(Models::Operations::ScreeningListScreeningPackagesResponse)

Errors

Error Type Status Code Content Type
Models::Errors::BadRequestResponse 400 application/json
Models::Errors::UnauthorizedResponse 401 application/json
Models::Errors::ForbiddenResponse 403 application/json
Models::Errors::NotFoundResponse 404 application/json
Models::Errors::RequestTimedOutResponse 408 application/json
Models::Errors::ConflictResponse 409 application/json
Models::Errors::PreconditionFailedResponse 412 application/json
Models::Errors::UnprocessableEntityResponse 422 application/json
Models::Errors::TooManyRequestsResponse 429 application/json
Models::Errors::InternalServerErrorResponse 500 application/json
Models::Errors::NotImplementedResponse 501 application/json
Models::Errors::BadGatewayResponse 502 application/json
Errors::APIError 4XX, 5XX */*

webhook_screening_result

Webhook Screening Result

Example Usage

require 'stackone_client'

Models = ::StackOne::Models
s = ::StackOne::StackOne.new(
  security: Models::Shared::Security.new(
    password: '',
    username: ''
  )
)
res = s.screening.webhook_screening_result(screening_result_webhook: Models::Shared::ScreeningResultWebhook.new(
  data: Models::Shared::ScreeningResult.new(
    id: '8187e5da-dc77-475e-9949-af0f1fa4e4e3',
    order_id: '12345',
    remote_id: '8187e5da-dc77-475e-9949-af0f1fa4e4e3',
    result_url: 'https://example.com/results/12345',
    score: Models::Shared::ScreeningResultScore.new(
      label: 'Overall Risk',
      max: '100',
      min: '0',
      value: '75'
    ),
    start_date: DateTime.iso8601('2023-01-01T00:00:00Z'),
    status: Models::Shared::ScreeningResultStatus::COMPLETED,
    submission_date: DateTime.iso8601('2023-01-02T00:00:00Z'),
    summary: 'Background check completed successfully',
    unified_custom_fields: {
      'my_project_custom_field_1' => 'REF-1236',
      'my_project_custom_field_2' => 'some other value',
    }
  ),
  event: Models::Shared::Event::SCREENING_RESULTS_CANCELLED
), x_account_id: '<id>', prefer: 'heartbeat')

unless res.screening_result_webhook.nil?
  # handle response
end

Parameters

Parameter Type Required Description Example
screening_result_webhook Models::Shared::ScreeningResultWebhook ✔️ N/A
x_account_id ::String ✔️ The account identifier
prefer T.nilable(::String) Set to "heartbeat" to enable keep-alive newline heartbeats during long-running requests. Response includes Preference-Applied: heartbeat header when honored. (RFC 7240) heartbeat

Response

T.nilable(Models::Operations::ScreeningWebhookScreeningResultResponse)

Errors

Error Type Status Code Content Type
Models::Errors::BadRequestResponse 400 application/json
Models::Errors::UnauthorizedResponse 401 application/json
Models::Errors::ForbiddenResponse 403 application/json
Models::Errors::NotFoundResponse 404 application/json
Models::Errors::RequestTimedOutResponse 408 application/json
Models::Errors::ConflictResponse 409 application/json
Models::Errors::PreconditionFailedResponse 412 application/json
Models::Errors::UnprocessableEntityResponse 422 application/json
Models::Errors::TooManyRequestsResponse 429 application/json
Models::Errors::InternalServerErrorResponse 500 application/json
Models::Errors::NotImplementedResponse 501 application/json
Models::Errors::BadGatewayResponse 502 application/json
Errors::APIError 4XX, 5XX */*