From 49bf8beddb17b9db033fe454edec05433ce189eb Mon Sep 17 00:00:00 2001 From: PRAJESH <47695045+Prajesh-Srivastava@users.noreply.github.com> Date: Mon, 6 Sep 2021 12:03:00 +0530 Subject: [PATCH] Added all the v2 apis --- source/index.html.md.erb | 448 +++++++++++++++++++++++++++++++++------ 1 file changed, 388 insertions(+), 60 deletions(-) diff --git a/source/index.html.md.erb b/source/index.html.md.erb index 0544f2e..1b527cb 100644 --- a/source/index.html.md.erb +++ b/source/index.html.md.erb @@ -849,104 +849,158 @@ When an admin requests declares a forgotten password, an email will be sent usin ## Register your company ```shell -curl --location --request POST 'https://api.us.springverify.com/company' \ + +curl --location --request POST 'https://api.us.springverify.com/v2-api/company' \ --header 'Authorization: Bearer JWT_TOKEN' \ --header 'Content-Type: application/json' \ --data-raw '{ - "name": "SmartBrains", - "address": "901, Downtown Manhattan", + "name": "Smaahebfjns", + "address": "901, Dowahsdown Manhattan", "city": "NY", "state": "NY", - "zipcode": "91319", - "tax_id_number":"1234567890" + "zipcode": "91329", + "tax_id_number":"1235567890" }' ``` ```javascript // FETCH -var fetch = require('node-fetch'); +var myHeaders = new Headers(); +myHeaders.append("Authorization", 'Bearer JWT_TOKEN'); +myHeaders.append("Content-Type", "application/json"); -fetch('https://api.us.springverify.com/company', { - method: 'POST', - headers: { - 'Authorization': 'Bearer JWT_TOKEN', - 'Content-Type': 'application/json' - }, - body: JSON.stringify({ "name": "SmartBrains", "address": "901, Downtown Manhattan", "city": "NY", "state": "NY", "zipcode": "91319", "tax_id_number":"1234567890" }) +var raw = JSON.stringify({ + "name": "Smaahebfjns", + "address": "901, Dowahsdown Manhattan", + "city": "NY", + "state": "NY", + "zipcode": "91329", + "tax_id_number": "1235567890" }); +var requestOptions = { + method: 'POST', + headers: myHeaders, + body: raw, + redirect: 'follow' +}; + +fetch("https://api.us.springverify.com/v2-api/company", requestOptions) + .then(response => response.text()) + .then(result => console.log(result)) + .catch(error => console.log('error', error)); + // REQUEST var request = require('request'); - -var headers = { +var options = { + 'method': 'POST', + 'url': 'https://api.us.springverify.com/v2-api/company', + 'headers': { 'Authorization': 'Bearer JWT_TOKEN', 'Content-Type': 'application/json' + }, + body: JSON.stringify({ + "name": "Smaahebfjns", + "address": "901, Dowahsdown Manhattan", + "city": "NY", + "state": "NY", + "zipcode": "91329", + "tax_id_number": "1235567890" + }) }; - -var dataString = '{ "name": "SmartBrains", "address": "901, Downtown Manhattan", "city": "NY", "state": "NY", "zipcode": "91319", "tax_id_number":"1234567890" }'; - -var options = { - url: 'https://api.us.springverify.com/company', - method: 'POST', - headers: headers, - body: dataString -}; - -function callback(error, response, body) { - if (!error && response.statusCode == 200) { - console.log(body); - } -} - -request(options, callback); +request(options, function (error, response) { + if (error) throw new Error(error); + console.log(response.body); +}); ``` ```php + 'Bearer JWT_TOKEN', - 'Content-Type' => 'application/json' -); -$data = '{ "name": "SmartBrains", "address": "901, Downtown Manhattan", "city": "NY", "state": "NY", "zipcode": "91319", "tax_id_number":"1234567890" }'; -$response = Requests::post('https://api.us.springverify.com/company', $headers, $data); +require_once 'HTTP/Request2.php'; +$request = new HTTP_Request2(); +$request->setUrl('https://api.us.springverify.com/v2-api/company'); +$request->setMethod(HTTP_Request2::METHOD_POST); +$request->setConfig(array( + 'follow_redirects' => TRUE +)); +$request->setHeader(array( + 'Authorization' => 'Bearer JWT_TOKEN', + 'Content-Type' => 'application/json' +)); +$request->setBody('{ +\n "name": "Smaahebfjns", +\n "address": "901, Dowahsdown Manhattan", +\n "city": "NY", +\n "state": "NY", +\n "zipcode": "91329", +\n "tax_id_number":"1235567890" +\n}'); +try { + $response = $request->send(); + if ($response->getStatus() == 200) { + echo $response->getBody(); + } + else { + echo 'Unexpected HTTP status: ' . $response->getStatus() . ' ' . + $response->getReasonPhrase(); + } +} +catch(HTTP_Request2_Exception $e) { + echo 'Error: ' . $e->getMessage(); +} ``` ```python + import requests +import json +url = "https://api.us.springverify.com/v2-api/company" + +payload = json.dumps({ + "name": "Smaahebfjns", + "address": "901, Dowahsdown Manhattan", + "city": "NY", + "state": "NY", + "zipcode": "91329", + "tax_id_number": "1235567890" +}) headers = { - 'Authorization': 'Bearer JWT_TOKEN', - 'Content-Type': 'application/json', + 'Authorization': 'Bearer JWT_TOKEN', + 'Content-Type': 'application/json' } -data = '{ "name": "SmartBrains", "address": "901, Downtown Manhattan", "city": "NY", "state": "NY", "zipcode": "91319", "tax_id_number":"1234567890" }' +response = requests.request("POST", url, headers=headers, data=payload) -response = requests.post('https://api.us.springverify.com/company', headers=headers, data=data) +print(response.text) ``` ```ruby -require 'net/http' -require 'uri' +require "uri" +require "json" +require "net/http" -uri = URI.parse("https://api.us.springverify.com/company") -request = Net::HTTP::Post.new(uri) -request.content_type = "application/json" -request["Authorization"] = "Bearer JWT_TOKEN" +url = URI("https://api.us.springverify.com/v2-api/company") -req_options = { - use_ssl: uri.scheme == "https", -} +http = Net::HTTP.new(url.host, url.port); +request = Net::HTTP::Post.new(url) +request["Authorization"] = "Bearer JWT_TOKEN" +request["Content-Type"] = "application/json" +request.body = JSON.dump({ + "name": "Smaahebfjns", + "address": "901, Dowahsdown Manhattan", + "city": "NY", + "state": "NY", + "zipcode": "91329", + "tax_id_number": "1235567890" +}) -response = Net::HTTP.start(uri.hostname, uri.port, req_options) do |http| - http.request(request) -end +response = http.request(request) +puts response.read_body -# response.code -# response.body ``` > Success Response: @@ -955,7 +1009,10 @@ end { "success": true, "data": { - "message": "Company updated successfully" + "status": 200, + "body": { + "message": "Company created successfully" + } } } ``` @@ -973,6 +1030,11 @@ A user with the role of an admin can create a company once their profile is [ver | zipcode | `string` | The ZIP code of the postal district in which the company is located | | tax_id_number | `string` | (Optional) Tax number of the company that is being registered | + + + ## Upload a logo ```shell @@ -2236,7 +2298,7 @@ puts response.read_body "links": [ { "email": "www@yopmail.com", - "link": "http://localhost:3000/candidate/personal-details?token=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJkYXRhIjoid3d3QHlvcG1haWwuY29tIiwiaWF0IjoxNjMwNjYzNTYyLCJleHAiOjE2MzQyNjM1NjJ9.mh1i6wApq14FDYAymRZ7lYMUnrcP2imUmX-UTkMBhO8", + "link": "https://api.us.springverify.com/candidate/personal-details?token=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJkYXRhIjoid3d3QHlvcG1haWwuY29tIiwiaWF0IjoxNjMwNjYzNTYyLCJleHAiOjE2MzQyNjM1NjJ9.mh1i6wApq14FDYAymRZ7lYMUnrcP2imUmX-UTkMBhO8", "id": "f75beef7-a8ee-44d4-a15d-0b5d4391c135" } ] @@ -5586,6 +5648,143 @@ A company can register a webhook for any overall status updates to the candidate | overall_status_update | Any status change in overall status of the candidate. Individual status of each check for the candidate is not included in this event. | +## Professional-reference by id + +```shell + +curl --location --request GET 'https://api.us.springverify.com/v2-api/company/employee/professional-reference/0448d469-a7c5-408f-8bd4-5bf7d93e9c82' \ +--header 'Content-Type: application/json' \ +--header 'Authorization: Bearer JWT_TOKEN' +``` + +```javascript +// FETCH + +var myHeaders = new Headers(); +myHeaders.append("Content-Type", "application/json"); +myHeaders.append("Authorization", "Bearer JWT_TOKEN"); + +var requestOptions = { + method: 'GET', + headers: myHeaders, + redirect: 'follow' +}; + +fetch("https://api.us.springverify.com/v2-api/company/employee/professional-reference/0448d469-a7c5-408f-8bd4-5bf7d93e9c82", requestOptions) + .then(response => response.text()) + .then(result => console.log(result)) + .catch(error => console.log('error', error)); + +// REQUEST + +var request = require('request'); +var options = { + 'method': 'GET', + 'url': 'https://api.us.springverify.com/v2-api/company/employee/professional-reference/0448d469-a7c5-408f-8bd4-5bf7d93e9c82', + 'headers': { + 'Content-Type': 'application/json', + 'Authorization': 'Bearer JWT_TOKEN' + } +}; +request(options, function (error, response) { + if (error) throw new Error(error); + console.log(response.body); +}); +``` + +```php +setUrl('https://api.us.springverify.com/v2-api/company/employee/professional-reference/0448d469-a7c5-408f-8bd4-5bf7d93e9c82'); +$request->setMethod(HTTP_Request2::METHOD_GET); +$request->setConfig(array( + 'follow_redirects' => TRUE +)); +$request->setHeader(array( + 'Content-Type' => 'application/json', + 'Authorization' => 'Bearer JWT_TOKEN' +)); +try { + $response = $request->send(); + if ($response->getStatus() == 200) { + echo $response->getBody(); + } + else { + echo 'Unexpected HTTP status: ' . $response->getStatus() . ' ' . + $response->getReasonPhrase(); + } +} +catch(HTTP_Request2_Exception $e) { + echo 'Error: ' . $e->getMessage(); +} +``` + +```python +import requests +import json + +url = "https://api.us.springverify.com/v2-api/company/employee/professional-reference/0448d469-a7c5-408f-8bd4-5bf7d93e9c82" + +payload={} +headers = { + 'Content-Type': 'application/json', + 'Authorization': 'Bearer JWT_TOKEN' +} + +response = requests.request("GET", url, headers=headers, data=payload) + +print(response.text) +``` + +```ruby +require "uri" +require "json" +require "net/http" + +url = URI("https://api.us.springverify.com/v2-api/company/employee/professional-reference/0448d469-a7c5-408f-8bd4-5bf7d93e9c82") + +http = Net::HTTP.new(url.host, url.port); +request = Net::HTTP::Get.new(url) +request["Content-Type"] = "application/json" +request["Authorization"] = "Bearer JWT_TOKEN" + +response = http.request(request) +puts response.read_body +``` + +> Success Response + +```json +{ + "success": true, + "data": { + "first_name": "Bella", + "middle_name": null, + "last_name": "Criston", + "check_type": "PROFESSIONAL_REFERENCE", + "status": "VERIFIED", + "details": { + "name": "Riya M Sharma", + "relationship": "Team Lead", + "employment_name": "Riya M Sharma", + "employment_start_date": "01-10-2008", + "employment_end_date": "01-01-2019", + "phone_number": "1-9879879990", + "email": "riya@yopmail.com" + }, + "qna": [ + { + "question": "Testing", + "response": "123" + } + ] + } +} +``` + +A company can check the check-type of candidate by their id. + ## Get Webhook ```shell @@ -10038,6 +10237,135 @@ The password should be hashed using SHA256 beforehand. All the old apis are documented here. + +## Register your company + +```shell +curl --location --request POST 'https://api.us.springverify.com/company' \ +--header 'Authorization: Bearer JWT_TOKEN' \ +--header 'Content-Type: application/json' \ +--data-raw '{ + "name": "SmartBrains", + "address": "901, Downtown Manhattan", + "city": "NY", + "state": "NY", + "zipcode": "91319", + "tax_id_number":"1234567890" +}' +``` + +```javascript +// FETCH + +var fetch = require('node-fetch'); + +fetch('https://api.us.springverify.com/company', { + method: 'POST', + headers: { + 'Authorization': 'Bearer JWT_TOKEN', + 'Content-Type': 'application/json' + }, + body: JSON.stringify({ "name": "SmartBrains", "address": "901, Downtown Manhattan", "city": "NY", "state": "NY", "zipcode": "91319", "tax_id_number":"1234567890" }) +}); + +// REQUEST + +var request = require('request'); + +var headers = { + 'Authorization': 'Bearer JWT_TOKEN', + 'Content-Type': 'application/json' +}; + +var dataString = '{ "name": "SmartBrains", "address": "901, Downtown Manhattan", "city": "NY", "state": "NY", "zipcode": "91319", "tax_id_number":"1234567890" }'; + +var options = { + url: 'https://api.us.springverify.com/company', + method: 'POST', + headers: headers, + body: dataString +}; + +function callback(error, response, body) { + if (!error && response.statusCode == 200) { + console.log(body); + } +} + +request(options, callback); +``` + +```php + 'Bearer JWT_TOKEN', + 'Content-Type' => 'application/json' +); +$data = '{ "name": "SmartBrains", "address": "901, Downtown Manhattan", "city": "NY", "state": "NY", "zipcode": "91319", "tax_id_number":"1234567890" }'; +$response = Requests::post('https://api.us.springverify.com/company', $headers, $data); +``` + +```python +import requests + +headers = { + 'Authorization': 'Bearer JWT_TOKEN', + 'Content-Type': 'application/json', +} + +data = '{ "name": "SmartBrains", "address": "901, Downtown Manhattan", "city": "NY", "state": "NY", "zipcode": "91319", "tax_id_number":"1234567890" }' + +response = requests.post('https://api.us.springverify.com/company', headers=headers, data=data) +``` + +```ruby +require 'net/http' +require 'uri' + +uri = URI.parse("https://api.us.springverify.com/company") +request = Net::HTTP::Post.new(uri) +request.content_type = "application/json" +request["Authorization"] = "Bearer JWT_TOKEN" + +req_options = { + use_ssl: uri.scheme == "https", +} + +response = Net::HTTP.start(uri.hostname, uri.port, req_options) do |http| + http.request(request) +end + +# response.code +# response.body +``` + +> Success Response: + +```json +{ + "success": true, + "data": { + "message": "Company updated successfully" + } +} +``` + +A user with the role of an admin can create a company once their profile is [verified](https://docs.us.springverify.com/#verify-company-admin-email). A valid JWT will be needed to authenticate the user in this API. + +**URL Parameters** + +| Parameter | Type | Description | +| --- | --- | --- | +| name | `string` | Name of the company being registered | +| address | `string` | Address of the company being registered | +| city | `string` | The city where the company being registered is located | +| state | `string` | The state where the company being registered is located | +| zipcode | `string` | The ZIP code of the postal district in which the company is located | +| tax_id_number | `string` | (Optional) Tax number of the company that is being registered | + + ## Get company profile ```shell