Sample Codes

This topic gives resume summarization API plugin code samples to get you start quickly.

Sample Code - Java

OkHttpClient client = new OkHttpClient().newBuilder()
  .build();
MediaType mediaType = MediaType.parse("application/json");
RequestBody body = RequestBody.create(mediaType, "{\r\n  \"filedata\": \"{{base64data}}\",\r\n  \"filename\": \"{{filename}}\",\r\n  \"userkey\": \"{{userkey}}\",\r\n  \"version\": \"1.0.0\",\r\n  \"subuserid\": \"{{subuserid}}\",\r\n  \"jsondata\": \"\",\r\n   \"summarytype\": \"\"\r\n}");
Request request = new Request.Builder()
  .url("https://plugin.rchilli.com/RChilliPlugin/rchilli/resume/summary")
  .method("POST", body)
  .addHeader("Content-Type", "application/json")
  .build();
Response response = client.newCall(request).execute();

Sample Code - Python

import http.client
import json

conn = http.client.HTTPSConnection("plugin.rchilli.com")
payload = json.dumps({
  "filedata": "{{base64data}}",
  "filename": "{{filename}}",
  "userkey": "{{userkey}}",
  "version": "1.0.0",
  "subuserid": "{{subuserid}}",
  "jsondata": "",
  "summarytype": ""
})
headers = {
  'Content-Type': 'application/json'
}
conn.request("POST", "/RChilliPlugin/rchilli/resume/summary", payload, headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))

Sample Code - PHP

<?php

$curl = curl_init();

curl_setopt_array($curl, array(
  CURLOPT_URL => 'https://plugin.rchilli.com/RChilliPlugin/rchilli/resume/summary',
  CURLOPT_RETURNTRANSFER => true,
  CURLOPT_ENCODING => '',
  CURLOPT_MAXREDIRS => 10,
  CURLOPT_TIMEOUT => 0,
  CURLOPT_FOLLOWLOCATION => true,
  CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
  CURLOPT_CUSTOMREQUEST => 'POST',
  CURLOPT_POSTFIELDS =>'{
  "filedata": "{{base64data}}",
  "filename": "{{filename}}",
  "userkey": "{{userkey}}",
  "version": "1.0.0",
  "subuserid": "{{subuserid}}",
  "jsondata": "",
   "summarytype": ""
}',
  CURLOPT_HTTPHEADER => array(
    'Content-Type: application/json'
  ),
));

$response = curl_exec($curl);

curl_close($curl);
echo $response;

Sample Code - NodeJS

var https = require('follow-redirects').https;
var fs = require('fs');

var options = {
  'method': 'POST',
  'hostname': 'plugin.rchilli.com',
  'path': '/RChilliPlugin/rchilli/resume/summary',
  'headers': {
    'Content-Type': 'application/json'
  },
  'maxRedirects': 20
};

var req = https.request(options, function (res) {
  var chunks = [];

  res.on("data", function (chunk) {
    chunks.push(chunk);
  });

  res.on("end", function (chunk) {
    var body = Buffer.concat(chunks);
    console.log(body.toString());
  });

  res.on("error", function (error) {
    console.error(error);
  });
});

var postData = JSON.stringify({
  "filedata": "{{base64data}}",
  "filename": "{{filename}}",
  "userkey": "{{userkey}}",
  "version": "1.0.0",
  "subuserid": "{{subuserid}}",
  "jsondata": "",
  "summarytype": ""
});

req.write(postData);

req.end();

Sample Code - Ruby

require "uri"
require "json"
require "net/http"

url = URI("https://plugin.rchilli.com/RChilliPlugin/rchilli/resume/summary")

https = Net::HTTP.new(url.host, url.port)
https.use_ssl = true

request = Net::HTTP::Post.new(url)
request["Content-Type"] = "application/json"
request.body = JSON.dump({
  "filedata": "{{base64data}}",
  "filename": "{{filename}}",
  "userkey": "{{userkey}}",
  "version": "1.0.0",
  "subuserid": "{{subuserid}}",
  "jsondata": "",
  "summarytype": ""
})

response = https.request(request)
puts response.read_body

Sample Code - C#

var client = new HttpClient();
var request = new HttpRequestMessage(HttpMethod.Post, "https://plugin.rchilli.com/RChilliPlugin/rchilli/resume/summary");
var content = new StringContent("{\r\n  \"filedata\": \"{{base64data}}\",\r\n  \"filename\": \"{{filename}}\",\r\n  \"userkey\": \"{{userkey}}\",\r\n  \"version\": \"1.0.0\",\r\n  \"subuserid\": \"{{subuserid}}\",\r\n  \"jsondata\": \"\",\r\n   \"summarytype\": \"\"\r\n}", null, "application/json");
request.Content = content;
var response = await client.SendAsync(request);
response.EnsureSuccessStatusCode();
Console.WriteLine(await response.Content.ReadAsStringAsync());

Sample Code - cURL

curl --location 'https://plugin.rchilli.com/RChilliPlugin/rchilli/resume/summary' \
--header 'Content-Type: application/json' \
--data '{
  "filedata": "{{base64data}}",
  "filename": "{{filename}}",
  "userkey": "{{userkey}}",
  "version": "1.0.0",
  "subuserid": "{{subuserid}}",
  "jsondata": "",
   "summarytype": ""
}'