How do I use the Crystal API for text analysis?

Follow the steps outlined below to analyze text or PDF files using the Crystal API.

Reach out to Crystal to get a token and pricing

Please email us at hello@crystalknows.com for pricing and to get access to the Crystal API for text analysis.

Once you have API access, you can send a PDF file or raw text. Details on how to do each are below.

Analyze a PDF file

1. Send PDF file through the route below

Host: https://api.crystalknows.com

POST /v1/analysis/pdf

Query Parameters:

content-type: multipart/form-data

{
token: YOUR_API_TOKEN,
file: file
}

Response:

content-type: application/json

{
data: {
id: "id"
}
}

2. Take the ID above and use it in the route below to retrieve results

GET /v1/analysis/:ID

Returns:

content-type: application/json

{
"data": {
"personality": {
"disc_type": "IS"
},
"images": {
"disc_map": URL
},
"content": {
"behavior": [
"Find ways around the rules",
"Feel comfortable as the primary speaker in a group",
"Elevate new ideas",
"Speak persuasively in a one-on-one meeting",
"Take big risks"
],
"motivations": [
"Opportunities to advance",
"Winning other people over",
"Ambitious goals",
"Opportunities to perform and entertain",
"Challenges"
],
"drains": [
"Feeling held back by process",
"Over-planning",
"Repetitive, routine tasks",
"Using too much caution",
"Following lots of rules"
],
"communication": [
"Keep conversation brief",
"Bring lots of energy to the conversation",
"Project boldness and confidence (even at the risk of sounding impolite)",
"Let him take the lead",
"Stick to the big picture"
],
"meeting": [
"Send a bulleted list with anything they need to prepare",
"Avoid too much formality",
"Prepare to be challenged",
"Start by casting an exciting vision",
"Make the meeting as short as possible"
]
}
}

Analyze a text sample

POST /v1/analysis/text

Query Parameters:

{
token: YOUR_API_TOKEN,
text: string
}

Response:
content-type: application/json

{
data: {
personality: {
disc_type: "IS"
},
"content": {
"behavior": [
"Find ways around the rules",
"Feel comfortable as the primary speaker in a group",
"Elevate new ideas",
"Speak persuasively in a one-on-one meeting",
"Take big risks"
],
"motivations": [
"Opportunities to advance",
"Winning other people over",
"Ambitious goals",
"Opportunities to perform and entertain",
"Challenges"
],
"drains": [
"Feeling held back by process",
"Over-planning",
"Repetitive, routine tasks",
"Using too much caution",
"Following lots of rules"
],
"communication": [
"Keep conversation brief",
"Bring lots of energy to the conversation",
"Project boldness and confidence (even at the risk of sounding impolite)",
"Let him take the lead",
"Stick to the big picture"
],
"meeting": [
"Send a bulleted list with anything they need to prepare",
"Avoid too much formality",
"Prepare to be challenged",
"Start by casting an exciting vision",
"Make the meeting as short as possible"
]
}
}

Status codes

  • Success: 200 status code
  • Bad request: 400 status code
  • Unauthorized: 401 status code

If the text or PDF doesn't yield a personality (typically due to errors parsing the PDF or insufficient text), the Crystal API will return a 200 status code with the following:

{
data: nil,
message: "Content did not yield a personality"