Skip to content

Commit

Permalink
Merge pull request #613 from panoratech/feat/fix-docs-gaps
Browse files Browse the repository at this point in the history
🚑 Fix docs gaps
  • Loading branch information
naelob authored Aug 5, 2024
2 parents 514db1e + 00a0b57 commit 1836fb0
Show file tree
Hide file tree
Showing 115 changed files with 1,716 additions and 667 deletions.
2 changes: 1 addition & 1 deletion apps/webapp/src/hooks/create/useCreateProject.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ interface IProDto {

const useCreateProject = () => {
const add = async (data: IProDto) => {
const response = await fetch(`${config.API_URL}/projects`, {
const response = await fetch(`${config.API_URL}/projects/internal`, {
method: 'POST',
body: JSON.stringify(data),
headers: {
Expand Down
2 changes: 1 addition & 1 deletion apps/webapp/src/hooks/create/useDefineField.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ interface IDefineTargetFieldDto{

const useDefineField = () => {
const define = async (data: IDefineTargetFieldDto) => {
const response = await fetch(`${config.API_URL}/field_mappings/define`, {
const response = await fetch(`${config.API_URL}/field_mappings/internal/define`, {
method: 'POST',
body: JSON.stringify(data),
headers: {
Expand Down
2 changes: 1 addition & 1 deletion apps/webapp/src/hooks/create/useMapField.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ interface IMapTargetFieldDto {

const useMapField = () => {
const map = async (data: IMapTargetFieldDto) => {
const response = await fetch(`${config.API_URL}/field_mappings/map`, {
const response = await fetch(`${config.API_URL}/field_mappings/internal/map`, {
method: 'POST',
body: JSON.stringify(data),
headers: {
Expand Down
2 changes: 1 addition & 1 deletion apps/webapp/src/hooks/get/useConnections.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ const useConnections = () => {
return useQuery({
queryKey: ['connections'],
queryFn: async (): Promise<Connection[]> => {
const response = await fetch(`${config.API_URL}/connections`,{
const response = await fetch(`${config.API_URL}/connections/internal`,{
method: 'GET',
headers: {
'Content-Type': 'application/json',
Expand Down
2 changes: 1 addition & 1 deletion apps/webapp/src/hooks/get/useEvents.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ const fetchEvents = async (params: PaginationParams): Promise<Event[]> => {
limit: params.limit.toString(),
});

const response = await fetch(`${config.API_URL}/events?${searchParams.toString()}`,
const response = await fetch(`${config.API_URL}/events/internal?${searchParams.toString()}`,
{
method: 'GET',
headers: {
Expand Down
2 changes: 1 addition & 1 deletion apps/webapp/src/hooks/get/useFieldMappings.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ const useFieldMappings = () => {
return useQuery({
queryKey: ['mappings'],
queryFn: async (): Promise<Attribute[]> => {
const response = await fetch(`${config.API_URL}/field_mappings/attributes`,
const response = await fetch(`${config.API_URL}/field_mappings/internal/attributes`,
{
method: 'GET',
headers: {
Expand Down
2 changes: 1 addition & 1 deletion apps/webapp/src/hooks/get/useProjects.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ const useProjects = () => {
return useQuery({
queryKey: ['projects'],
queryFn: async (): Promise<Project[]> => {
const response = await fetch(`${config.API_URL}/projects`,
const response = await fetch(`${config.API_URL}/projects/internal`,
{
method: 'GET',
headers: {
Expand Down
16 changes: 8 additions & 8 deletions docker-compose.dev.yml
Original file line number Diff line number Diff line change
Expand Up @@ -281,14 +281,14 @@ services:
# condition: service_healthy
# network_mode: "host"

# docs:
# build:
# dockerfile: ./Dockerfile.dev
# context: ./docs/
# ports:
# - 911:3000
# volumes:
# - ./docs/:/app
docs:
build:
dockerfile: ./Dockerfile.dev
context: ./docs/
ports:
- 911:3000
volumes:
- ./docs/:/app

volumes:
local_pgdata:
Expand Down
34 changes: 17 additions & 17 deletions docs/api-reference/authentication.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -16,9 +16,11 @@ You also have to catch a [connection token](/core-concepts/auth) which contains
<Info>In this example, we will create a contact in a CRM. Visit other sections of the [documentation](/ticketing/overview) to find category-specific examples.</Info>
<CodeGroup>
```javascript TypeScript
import { PanoraSDK } from '@panora/sdk-typescript';
import { Panora } from "@panora/sdk";

const sdk = new PanoraSDK({ accessToken: "MY_API_KEY" });
const panora = new Panora({
apiKey: process.env.API_KEY,
});

const input = {
first_name: 'tom',
Expand All @@ -37,21 +39,23 @@ You also have to catch a [connection token](/core-concepts/auth) which contains
],
};

const result = await sdk.crmContact.addContact(input, 'MY_USER_CONNECTION_TOKEN', {
remoteData: true,
const result = await panora.crm.contacts.create({
xConnectionToken: "YOUR_USER_CONNECTION_TOKEN",
unifiedCrmContactInput: input,
});

console.log(result);
```

```python Python
from panorasdk import PanoraSDK

sdk = PanoraSDK()
```python Python
import os
from panora_sdk import Panora

sdk.set_access_token("MY_API_KEY")
panora = Panora(
api_key=os.getenv("API_KEY", ""),
)

request_body = {
body = {
'first_name': 'tom',
'last_name': 'jedusor',
'email_addresses': [
Expand All @@ -68,19 +72,15 @@ You also have to catch a [connection token](/core-concepts/auth) which contains
]
}

results = sdk.crm_contact.add_contact(
request_input = request_body,
connection_token = 'MY_USER_CONNECTION_TOKEN',
remote_data = True
)
res = panora.crm.contacts.create(x_connection_token="YOUR_USER_CONNECTION_TOKEN", unified_crm_contact_input=body)

print(results)
print(res)
```

```shell curl
curl --request POST \
--url https://api.panora.dev/crm/contacts \
--header 'Authorization: Bearer <MY_API_KEY>' \
--header 'x-api-key: <api-key>' \
--header 'Content-Type: application/json' \
--header 'x-connection-token: <MY_USER_CONNECTION_TOKEN>' \
--data '{
Expand Down
120 changes: 120 additions & 0 deletions docs/ats/quickstart.mdx
Original file line number Diff line number Diff line change
@@ -0,0 +1,120 @@
---
title: "Quick Start"
description: "Read and write data to multiple ATS platforms using a single API"
icon: "star"
---

## Create a candidate in an ATS using Panora

<Check>
We assume for this tutorial that you have a valid Panora API Key, and a
`connection_token`. Find help [here](/core-concepts/auth).
</Check>

<Steps>
<Info>
You can find the Typescript SDK [here](https://www.npmjs.com/package/@panora/sdk-typescript)
</Info>
<Step title="Setup your API Key in your code:">
<CodeGroup>
```javascript TypeScript SDK
import { Panora } from '@panora/sdk';
const panora = new Panora({ apiKey: process.env.API_KEY });
```

```python Python SDK
import os
from panora_sdk import Panora
panora = Panora(
api_key=os.getenv("API_KEY", ""),
)
```
</CodeGroup>
</Step>

<Step title="Create an candidate in your CRM:">
<Info>In this example, we will create a contact in a CRM. Visit other sections of the documentation to find category-specific examples</Info>
<CodeGroup>

```shell curl
curl --request POST \
--url https://api.panora.dev/ats/applications \
--header 'x-api-key: <api-key> ' \
--header 'Content-Type: application/json' \
--header 'x-connection-token: <connection_token>' \
--data '{
"appliedAt": "2024-10-01T12:00:00Z",
"rejectedAt": "2024-10-01T12:00:00Z",
"offers": [
"801f9ede-c698-4e66-a7fc-48d19eebaa4f",
"12345678-1234-1234-1234-123456789012"
],
"source": "Source Name",
"creditedTo": "801f9ede-c698-4e66-a7fc-48d19eebaa4f",
"currentStage": "801f9ede-c698-4e66-a7fc-48d19eebaa4f",
"rejectReason": "Candidate not experienced enough",
"candidateId": "801f9ede-c698-4e66-a7fc-48d19eebaa4f",
"jobId": "801f9ede-c698-4e66-a7fc-48d19eebaa4f"
}'
```

```javascript TypeScript
import { Panora } from "@panora/sdk";

const panora = new Panora({
apiKey: process.env.API_KEY,
});

const result = await panora.ats.applications.create({
xConnectionToken: "YOUR_USER_CONNECTION_TOKEN",
remoteData: false,
unifiedAtsApplicationInput: {
appliedAt: new Date("2024-10-01T12:00:00Z"),
rejectedAt: new Date("2024-10-01T12:00:00Z"),
offers: [
"801f9ede-c698-4e66-a7fc-48d19eebaa4f",
"12345678-1234-1234-1234-123456789012",
],
source: "Source Name",
creditedTo: "801f9ede-c698-4e66-a7fc-48d19eebaa4f",
currentStage: "801f9ede-c698-4e66-a7fc-48d19eebaa4f",
rejectReason: "Candidate not experienced enough",
candidateId: "801f9ede-c698-4e66-a7fc-48d19eebaa4f",
jobId: "801f9ede-c698-4e66-a7fc-48d19eebaa4f",
},
});

console.log(result);
```

```python Python
import os
from panora_sdk import Panora

panora = Panora(
api_key=os.getenv("API_KEY", ""),
)

body = {
"appliedAt": "2024-10-01T12:00:00Z",
"rejectedAt": "2024-10-01T12:00:00Z",
"offers": [
"801f9ede-c698-4e66-a7fc-48d19eebaa4f",
"12345678-1234-1234-1234-123456789012",
],
"source": "Source Name",
"creditedTo": "801f9ede-c698-4e66-a7fc-48d19eebaa4f",
"currentStage": "801f9ede-c698-4e66-a7fc-48d19eebaa4f",
"rejectReason": "Candidate not experienced enough",
"candidateId": "801f9ede-c698-4e66-a7fc-48d19eebaa4f",
"jobId": "801f9ede-c698-4e66-a7fc-48d19eebaa4f",
}

res = panora.ats.applications.create(x_connection_token="YOUR_USER_CONNECTION_TOKEN", unified_ats_application_input={})

print(res)
```
</CodeGroup>
</Step>

</Steps>
40 changes: 17 additions & 23 deletions docs/backend-sdk/python.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -6,43 +6,37 @@ description: "Introduction to our Python SDK"
## Installing & instantiating the Python SDK

```bash
pip install panorasdk
pip install panora-sdk
```
or
```bash
poetry add panora-sdk
```

Instantiate the SDK:

<Tip>Go to your dashboard to get your [API Key](https://dashboard.panora.dev/api-keys)</Tip>

```python
sdk = PanoraSDK('YOUR_API_KEY')
```

Or through the `set_access_token` method:

```python
sdk = PanoraSDK()
sdk.set_access_token('YOUR_API_KEY')
```

You can also set it for each service individually:
import os
from panora_sdk import Panora

```python
sdk = PanoraSDK()
sdk.main.set_access_token('YOUR_API_KEY')
panora = Panora(
api_key=os.getenv("API_KEY", ""),
)
```

### List all connections to your app

```python
from panorasdk import PanoraSDK

sdk = PanoraSDK()

sdk.set_access_token("YOUR_API_KEY")
import os
from panora_sdk import Panora

results = sdk.connections.get_connections()
panora = Panora(
api_key=os.getenv("API_KEY", ""),
)
res = panora.connections.list()

print(results)
print(res)
```

This will list all the connections available, across all users. You should get an object similar to this one below. Read more about the `connection` object here in the [API reference](/connections/overview) or the [glossary](/glossary/connection-object).
Expand Down
21 changes: 13 additions & 8 deletions docs/backend-sdk/typescript.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -6,32 +6,37 @@ description: "Introduction to our Typescript SDK"
## Installing & instantiating the Typescript SDK
<Info>
You can find the Typescript SDK on NPM
[here](https://www.npmjs.com/package/@panora/sdk-typescript)
[here](https://www.npmjs.com/package/@panora/sdk)
</Info>

```bash
npm i @panora/typescript-sdk
npm i @panora/sdk
```

Instantiate the SDK:

<Tip>Go to your dashboard to get your [API Key](https://dashboard.panora.dev/api-keys)</Tip>

```javascript
import { PanoraSDK } from "@panora/typescript-sdk";
import { Panora } from "@panora/sdk";

const panora = new Panora({
apiKey: process.env.API_KEY,
});

const sdk = new PanoraSDK("YOUR_API_KEY");
```

### List all connections to your app
### List all connections to your app

```javascript
import { PanoraSDK } from "@panora/typescript-sdk";
import { Panora } from "@panora/typescript-sdk";

const sdk = new PanoraSDK("YOUR_API_KEY");
const panora = new Panora({
apiKey: process.env.API_KEY,
});

(async () => {
const result = await sdk.connections.getConnections();
const result = await panora.connections.list();
console.log(result);
})();
```
Expand Down
Loading

0 comments on commit 1836fb0

Please sign in to comment.