curl TypeScript Python Go
# Step 1: Extract candidate data from resume
curl - X POST https://api.iterationlayer.com/document-extraction/v1/extract \
- H " Authorization: Bearer YOUR_API_KEY " \
- H " Content-Type: application/json " \
- d ' {
"files": [
{
"type": "url",
"name": "resume.pdf",
"url": "https://example.com/resumes/candidate-resume.pdf"
}
],
"schema": {
"fields": [
{ "name": "name", "type": "TEXT", "description": "Candidate full name" },
{ "name": "current_role", "type": "TEXT", "description": "Current job title" },
{ "name": "email", "type": "EMAIL", "description": "Contact email address" },
{ "name": "skills", "type": "ARRAY", "description": "Top skills", "fields": [
{ "name": "skill", "type": "TEXT", "description": "Skill name" }
]}
]
}
} '
# The response JSON contains the candidate's name, role, email, and skills.
# Use these values to populate the candidate card in Step 2.
# Step 2: Generate a candidate summary card
curl - X POST https://api.iterationlayer.com/image-generation/v1/generate \
- H " Authorization: Bearer YOUR_API_KEY " \
- H " Content-Type: application/json " \
- d ' {
"dimensions": { "width": 600, "height": 400 },
"output_format": "png",
"layers": [
{
"index": 0,
"type": "solid-color-background",
"hex_color": "#F8FAFC"
},
{
"index": 1,
"type": "rectangle",
"hex_color": "#4F46E5",
"position": { "x": 0.0, "y": 0.0 },
"dimensions": { "width": 600, "height": 120 }
},
{
"index": 2,
"type": "text",
"text": "Jane Doe",
"font_name": "Inter",
"font_size_in_px": 32,
"text_color": "#FFFFFF",
"font_weight": "Bold",
"position": { "x": 40.0, "y": 25.0 },
"dimensions": { "width": 520, "height": 40 }
},
{
"index": 3,
"type": "text",
"text": "Senior Software Engineer",
"font_name": "Inter",
"font_size_in_px": 18,
"text_color": "#C7D2FE",
"position": { "x": 40.0, "y": 72.0 },
"dimensions": { "width": 520, "height": 30 }
},
{
"index": 4,
"type": "text",
"text": "Top Skills",
"font_name": "Inter",
"font_size_in_px": 16,
"text_color": "#6B7280",
"font_weight": "Bold",
"position": { "x": 40.0, "y": 150.0 },
"dimensions": { "width": 520, "height": 24 }
},
{
"index": 5,
"type": "text",
"text": "TypeScript · React · Node.js · PostgreSQL · AWS",
"font_name": "Inter",
"font_size_in_px": 16,
"text_color": "#374151",
"position": { "x": 40.0, "y": 185.0 },
"dimensions": { "width": 520, "height": 60 }
}
]
} ' import { IterationLayer } from " iterationlayer " ;
const client = new IterationLayer ( { apiKey : " YOUR_API_KEY " } ) ;
// Step 1: Extract candidate data from resume
const candidateResult = await client . extract ( {
files : [
{
type : " url " ,
name : " resume.pdf " ,
url : " https://example.com/resumes/candidate-resume.pdf " ,
} ,
] ,
schema : {
fields : [
{ name : " name " , type : " TEXT " , description : " Candidate full name " } ,
{ name : " current_role " , type : " TEXT " , description : " Current job title " } ,
{ name : " email " , type : " EMAIL " , description : " Contact email address " } ,
{ name : " skills " , type : " ARRAY " , description : " Top skills " , fields : [
{ name : " skill " , type : " TEXT " , description : " Skill name " } ,
] } ,
] ,
} ,
} ) ;
const candidate = candidateResult . results [ 0 ] ;
const skillsList = candidate . skills . map ( ( entry : { skill : string } ) => entry . skill ) . join ( " · " ) ;
// Step 2: Generate a candidate summary card
const cardResult = await client . generateImage ( {
dimensions : { width_in_px : 600 , height_in_px : 400 } ,
output_format : " png " ,
layers : [
{
index : 0 ,
type : " solid-color-background " ,
hex_color : " #F8FAFC " ,
} ,
{
index : 1 ,
type : " rectangle " ,
hex_color : " #4F46E5 " ,
position : { x_in_px : 0 , y_in_px : 0 } ,
dimensions : { width_in_px : 600 , height_in_px : 120 } ,
} ,
{
index : 2 ,
type : " text " ,
text : candidate . name ,
font_name : " Inter " ,
font_size_in_px : 32 ,
text_color : " #FFFFFF " ,
font_weight : " Bold " ,
position : { x_in_px : 40 , y_in_px : 25 } ,
dimensions : { width_in_px : 520 , height_in_px : 40 } ,
} ,
{
index : 3 ,
type : " text " ,
text : candidate . current_role ,
font_name : " Inter " ,
font_size_in_px : 18 ,
text_color : " #C7D2FE " ,
position : { x_in_px : 40 , y_in_px : 72 } ,
dimensions : { width_in_px : 520 , height_in_px : 30 } ,
} ,
{
index : 4 ,
type : " text " ,
text : " Top Skills " ,
font_name : " Inter " ,
font_size_in_px : 16 ,
text_color : " #6B7280 " ,
font_weight : " Bold " ,
position : { x_in_px : 40 , y_in_px : 150 } ,
dimensions : { width_in_px : 520 , height_in_px : 24 } ,
} ,
{
index : 5 ,
type : " text " ,
text : skillsList ,
font_name : " Inter " ,
font_size_in_px : 16 ,
text_color : " #374151 " ,
position : { x_in_px : 40 , y_in_px : 185 } ,
dimensions : { width_in_px : 520 , height_in_px : 60 } ,
} ,
] ,
} ) ;
const candidateCardBuffer = Buffer . from ( cardResult . data . buffer , " base64 " ) ; import base64
from iterationlayer import IterationLayer
client = IterationLayer ( api_key = " YOUR_API_KEY " )
# Step 1: Extract candidate data from resume
candidate_result = client . extract (
files = [
{
" type " : " url " ,
" name " : " resume.pdf " ,
" url " : " https://example.com/resumes/candidate-resume.pdf " ,
}
] ,
schema = {
" fields " : [
{ " name " : " name " , " type " : " TEXT " , " description " : " Candidate full name " } ,
{ " name " : " current_role " , " type " : " TEXT " , " description " : " Current job title " } ,
{ " name " : " email " , " type " : " EMAIL " , " description " : " Contact email address " } ,
{ " name " : " skills " , " type " : " ARRAY " , " description " : " Top skills " , " fields " : [
{ " name " : " skill " , " type " : " TEXT " , " description " : " Skill name " } ,
] } ,
]
} ,
)
candidate = candidate_result [ " results " ] [ 0 ]
skills_list = " · " . join ( entry [ " skill " ] for entry in candidate [ " skills " ] )
# Step 2: Generate a candidate summary card
card_result = client . generate_image (
dimensions = { " width_in_px " : 600 , " height_in_px " : 400 } ,
output_format = " png " ,
layers = [
{
" index " : 0 ,
" type " : " solid-color-background " ,
" hex_color " : " #F8FAFC " ,
} ,
{
" index " : 1 ,
" type " : " rectangle " ,
" hex_color " : " #4F46E5 " ,
" position " : { " x_in_px " : 0 , " y_in_px " : 0 } ,
" dimensions " : { " width_in_px " : 600 , " height_in_px " : 120 } ,
} ,
{
" index " : 2 ,
" type " : " text " ,
" text " : candidate [ " name " ] ,
" font_name " : " Inter " ,
" font_size_in_px " : 32 ,
" text_color " : " #FFFFFF " ,
" font_weight " : " Bold " ,
" position " : { " x_in_px " : 40 , " y_in_px " : 25 } ,
" dimensions " : { " width_in_px " : 520 , " height_in_px " : 40 } ,
} ,
{
" index " : 3 ,
" type " : " text " ,
" text " : candidate [ " current_role " ] ,
" font_name " : " Inter " ,
" font_size_in_px " : 18 ,
" text_color " : " #C7D2FE " ,
" position " : { " x_in_px " : 40 , " y_in_px " : 72 } ,
" dimensions " : { " width_in_px " : 520 , " height_in_px " : 30 } ,
} ,
{
" index " : 4 ,
" type " : " text " ,
" text " : " Top Skills " ,
" font_name " : " Inter " ,
" font_size_in_px " : 16 ,
" text_color " : " #6B7280 " ,
" font_weight " : " Bold " ,
" position " : { " x_in_px " : 40 , " y_in_px " : 150 } ,
" dimensions " : { " width_in_px " : 520 , " height_in_px " : 24 } ,
} ,
{
" index " : 5 ,
" type " : " text " ,
" text " : skills_list ,
" font_name " : " Inter " ,
" font_size_in_px " : 16 ,
" text_color " : " #374151 " ,
" position " : { " x_in_px " : 40 , " y_in_px " : 185 } ,
" dimensions " : { " width_in_px " : 520 , " height_in_px " : 60 } ,
} ,
] ,
)
with open ( " candidate-card.png " , " wb " ) as f :
f . write ( base64 . b64decode ( card_result [ " data " ] [ " buffer " ] ) ) package main
import il " github.com/iterationlayer/sdk-go "
client := il . NewClient ( " YOUR_API_KEY " )
// Step 1: Extract candidate data from resume
candidateResult , err := client . Extract ( il . ExtractRequest {
Files : [ ] il . FileInput {
il . NewFileFromURL ( " resume.pdf " , " https://example.com/resumes/candidate-resume.pdf " ) ,
} ,
Schema : il . ExtractionSchema {
" name " : il . NewTextFieldConfig ( " name " , " Candidate full name " ) ,
" current_role " : il . NewTextFieldConfig ( " current_role " , " Current job title " ) ,
" email " : il . NewEmailFieldConfig ( " email " , " Contact email address " ) ,
" skills " : il . NewArrayFieldConfig ( " skills " , " Top skills " , [ ] il . FieldConfig {
il . NewTextFieldConfig ( " skill " , " Skill name " ) ,
} ) ,
} ,
} )
// Step 2: Generate a candidate summary card
cardResult , err := client . GenerateImage ( il . GenerateImageRequest {
Dimensions : il . Dimensions { WidthInPx : 600 , HeightInPx : 400 } ,
OutputFormat : " png " ,
Layers : [ ] il . Layer {
il . NewSolidColorBackgroundLayer ( 0 , " #F8FAFC " ) ,
il . NewRectangleLayer ( 1 , " #4F46E5 " ,
il . Position { XInPx : 0 , YInPx : 0 } ,
il . Dimensions { WidthInPx : 600 , HeightInPx : 120 } ) ,
il . NewTextLayer ( 2 , " Jane Doe " , " Inter " , 32 , " #FFFFFF " ,
il . Position { XInPx : 40 , YInPx : 25 } ,
il . Dimensions { WidthInPx : 520 , HeightInPx : 40 } ) ,
il . NewTextLayer ( 3 , " Senior Software Engineer " , " Inter " , 18 , " #C7D2FE " ,
il . Position { XInPx : 40 , YInPx : 72 } ,
il . Dimensions { WidthInPx : 520 , HeightInPx : 30 } ) ,
il . NewTextLayer ( 4 , " Top Skills " , " Inter " , 16 , " #6B7280 " ,
il . Position { XInPx : 40 , YInPx : 150 } ,
il . Dimensions { WidthInPx : 520 , HeightInPx : 24 } ) ,
il . NewTextLayer ( 5 , " TypeScript \u00b7 React \u00b7 Node.js \u00b7 PostgreSQL \u00b7 AWS " , " Inter " , 16 , " #374151 " ,
il . Position { XInPx : 40 , YInPx : 185 } ,
il . Dimensions { WidthInPx : 520 , HeightInPx : 60 } ) ,
} ,
} )