Method: Plagscan::Documents.retrieve

Defined in:
lib/plagscan/documents.rb

.retrieve(access_token:, document_id:, mode:, user_id: nil) ⇒ Hash

Document retrieve REST API For more details, see api.plagscan.com/v3docs/#api-Document-RetrieveDocumentReport

Parameters:

  • access_token (String)

    Access token from Token.fetch

  • document_id (Integer)

    Document ID as returned from create action

  • mode (Integer)

    The retrieve mode of the report

  • user_id (Integer) (defaults to: nil)

    Identify the user who is accessing to the report (Only mandatory for mode 10). If not set it will get the user ID associated with the access token or the organization admin ID.

Returns:

  • (Hash)

    Various different values depending on the mode specified



73
74
75
76
77
78
79
80
81
# File 'lib/plagscan/documents.rb', line 73

def self.retrieve(access_token:, document_id:, mode:, user_id: nil)
  params = { mode: mode }
  params[:userID] = user_id if user_id

  Plagscan::Request.json_request(
    "documents/#{document_id}/retrieve",
    access_token: access_token, body: params
  )
end