# Welcome!

ExpertFile provides a variety of ways to quickly and powerfully add your expert content to you site. Whether it be through using our RESTful API, Wordpress Plugin or Embed Builder tool we've developed these instructions and code samples to help make it as easy as possible.

## Get integrated in just a few hours!

Our **Embed Builder** is the fastest way to customize and implement your expert content assets, from searchable directories to profiles, posts and more.  You can use the builder once you're logged in to the dashboard, but if you'd like a more detailed reference of the parameters available to you, check out the following embed docs.  Embeds should be used in conjunction with the API for enhanced [SEO](/reference/api-reference/experts/expert-profile/seo-meta-data).

{% content-ref url="/pages/ENOBzeQWRqn2U07BJqkz" %}
[Embeds](/reference/embeds)
{% endcontent-ref %}

**Are you running WordPress?** Our plugin can be just as quick-and-easy to use as the embeds!

{% content-ref url="/pages/x3P2nGe5r90ieTwS5xK1" %}
[WordPress](/reference/wordpress)
{% endcontent-ref %}

## Looking for additional customization?

Using ExpertFile's API not only gives you control over how and where you display your expert content, but also allows you to easily connect with existing tools in your marketing stack such as your CRM or CMS.  Dive a little deeper and start exploring our API reference to get an idea of everything that's possible with the API.

{% content-ref url="/pages/lnj9Hs8um1DLbuFmmi9P" %}
[API Reference](/reference/api-reference)
{% endcontent-ref %}


# API Reference

Dive into the specifics of each API endpoint by checking out our complete documentation.

## Experts

The most common usecase would be setting up a directory of your organization's experts, complete with keyword searching and filtering options.

You'll also be able to build out full expert profiles and send inquiries using your own forms & styles.

{% content-ref url="/pages/Zsk7DIR3qC4JeRM4rO2q" %}
[Experts](/reference/api-reference/experts)
{% endcontent-ref %}

## Posts

You can also create a listing page with all your posts, as well as a page showing the complete post details

{% content-ref url="/pages/4kiLOFgsxjNfQ86fpr1T" %}
[Posts (Spotlights)](/reference/api-reference/posts-spotlights)
{% endcontent-ref %}

## ExpertAnswers

Showoff all your expert answers with your own listing and full answer page

{% content-ref url="/pages/m6FIL3rIgYECj0Lr7BeQ" %}
[Q\&A (Answers)](/reference/api-reference/q-and-a-answers)
{% endcontent-ref %}


# Authentication

ExpertFile expects an access token to be included in all API requests to the server in a header that looks like the following:

## Create token.

<mark style="color:green;">`POST`</mark> `https://public-api.expertfile.com/oauth/token`

You can find your Client ID and Client Secret in Settings->Integrations inside ExpertFile dashboard. The url is: <https://expertfile.com/dashboard/settings/integrations>.

<figure><img src="https://1291996600-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FJl8SkdXXTR0rcda2A45A%2Fuploads%2FWpHEe5OKvJx5pHhcEG5J%2FScreenshot%202024-04-18%20at%204.13.00%20PM.png?alt=media&amp;token=59f2db88-d3ca-4628-906e-65b9cd7becce" alt=""><figcaption></figcaption></figure>

#### Response

{% tabs %}
{% tab title="200" %}

```json
  data: {
    accessToken: '<ACCESS CODE>',
    accessTokenExpiresAt: '2024-06-24T16:10:43.457Z',
    client: '<CLIENT ID>',
    user: <ORG ID>,
    scope: true
  },
  success: true
}
```

{% endtab %}
{% endtabs %}

#### Code

{% tabs %}
{% tab title="Node" %}

```javascript
const data = new URLSearchParams();

data.append('client_id', '<YOUR CLIENT ID>');
data.append('client_secret', '<YOUR CLIENT SECRET>');
data.append('grant_type', 'client_credentials');

fetch('https://public-api.expertfile.com/v2/oauth/token', {
    method: 'POST',
    headers: {
        'Content-Type': 'application/x-www-form-urlencoded'
    },
    body: data
})
.then(response => response.json())
.then(json => {
    const { success, data } = json

    if (success) {
        const { accessToken, accessTokenExpiresAt } = data
        console.log('Token used to sign requests for data', accessToken)
    }

})
.catch(error => console.error(error));
```

{% endtab %}

{% tab title="PHP" %}

```php
$client_id = urlencode('<YOUR CLIENT ID>');
$client_secret = urlencode('<YOUR CLIENT SECRET>');
$grant_type =  'client_credentials';

$params =
    [
        'client_id' => $client_id,
        'client_secret' => $client_secret,
        'grant_type' => $grant_type
    ];

$url = 'https://public-api.expertfile.com/v2/oauth/token';

$ch = curl_init($url);
curl_setopt($ch, CURLOPT_HTTPHEADER, array('Content-Type: application/x-www-form-urlencoded'));
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_POSTFIELDS, http_build_query($params));

$response = curl_exec($ch);
$json = json_decode($response);

if ($json->success) {
    var_dump('Token used to sign requests for data', $json->data->accessToken);
}

curl_close($ch);
```

{% endtab %}

{% tab title="Curl" %}

```
curl -X POST \
  https://public-api.expertfile.com/v2/oauth/token \
  -H 'cache-control: no-cache' \
  -H 'content-type: application/x-www-form-urlencoded' \
  -d 'client_id=<YOUR_ID>&client_secret=<YOUR_SECRET>&grant_type=client_credentials'
```

{% endtab %}
{% endtabs %}

{% hint style="info" %}
**Good to know:** You'll be required to sign all requests for data using the token received in this response. Tokens are valid for 30 days, so you may want to store the token for reuse and avoid making repeat calls for a new token.
{% endhint %}


# Experts

Welcome to the Experts section of the documentation. Here you'll learn how you can create your own expert listing on your website, complete with full text search and faceted filtering.

Once you've created an access token you can explore the search endpoint. To show an experts full profile you can use the expert endpoint. Within this section, you'll notice you can work with individual profile fields. If you're just looking to make a complete profile, you'll only require the `expert` endpoint.

You can also create your own forms and submit inquiry details to ExpertFile using the inquiry endpoint.

### Generate a Token:

{% content-ref url="/pages/BYd1G0wKUbajbfmWWW79" %}
[Authentication](/reference/api-reference/authentication)
{% endcontent-ref %}

### Explore the Expert Listing/Search endpoint:

{% content-ref url="/pages/OYUtadTzQaCz9tGC0iQN" %}
[Expert Directory/Search](/reference/api-reference/experts/expert-directory-search)
{% endcontent-ref %}

### Full profile data:

{% content-ref url="/pages/D7LpiyuWZUV6ikty0sJZ" %}
[Expert Profile](/reference/api-reference/experts/expert-profile)
{% endcontent-ref %}

### Submitting Inquiries:

{% content-ref url="/pages/jhhvvAt4TsU6r09h8iRD" %}
[Inquiries](/reference/api-reference/inquiries)
{% endcontent-ref %}

### Adding Analytics tracking to your pages:

{% content-ref url="/pages/B8RUWa1icG9Xs3ADG2IM" %}
[Tracking Code (Analytics)](/reference/tracking-code-analytics)
{% endcontent-ref %}


# Expert Directory/Search

This is the main endpoint used to list all the experts in searchable format.

{% hint style="info" %}
Remember to change **:corporation** with your corporation id(found in the integrations section of the dashboard).
{% endhint %}

## Listing Experts

<mark style="color:green;">`GET`</mark> [**/v2/organization/:corporation/expert**](https://public-api.expertfile.com/v2/organization/:corporation/expert)

**Headers**

| Name          | Value              |
| ------------- | ------------------ |
| Content-Type  | `application/json` |
| Authorization | `Bearer <token>`   |

**Url**

<table><thead><tr><th width="339.3333333333333">Name</th><th>Type</th><th>Description</th></tr></thead><tbody><tr><td>corporation</td><td>number</td><td>Corporation ID</td></tr><tr><td>username</td><td>string</td><td>Unique username</td></tr><tr><td>q</td><td>string</td><td>Keyword search term</td></tr><tr><td>access</td><td>string</td><td>public/private/all</td></tr><tr><td>status</td><td>string</td><td>published/unpublished/all</td></tr><tr><td>page_size</td><td>number</td><td>Size of page</td></tr><tr><td>page_from</td><td>number</td><td>Starting point</td></tr><tr><td>countries</td><td>string</td><td>Filter by country. Array of countries(i.e. ["CA","US"])<br>See full list <a href="/reference/helpers#country-codes"><em><strong>here</strong></em></a></td></tr><tr><td>topics</td><td>string</td><td>Filter by topics. Array of topics(i.e. ["topic1","topic2"])</td></tr><tr><td>industries</td><td>string</td><td>Filter by industries. Array of industries(i.e. ["industry1","industry2"])</td></tr><tr><td>categories</td><td>string</td><td>Filter by categories. Array of categories(i.e. ["cat1","cat2"])</td></tr><tr><td>tags</td><td>string</td><td>Filter by tags. Array of tags(i.e. ["tag1","tag2"])</td></tr><tr><td>fields</td><td>string</td><td><p>Array of field name(i.e. ["fullname","username"]) </p><p>See full list <a href="/reference/helpers#return-fields"><em><strong>here</strong></em></a></p></td></tr><tr><td>sort</td><td>string</td><td>Sorting order(name/featured)</td></tr><tr><td>searchfield</td><td>string</td><td>Fullname to query only name field.</td></tr></tbody></table>

**Response**

{% tabs %}
{% tab title="200" %}

```json
{
  data: {
    experts: [],
    aggregations: {
      has_uploaded_video: [],
      has_vimeo_video: [],
      has_slideshare_document: [],
      topics: [],
      countries: [],
      has_photo: [],
      states: [],
      has_uploaded_podchaser: [],
      has_book: [],
      companies: [],
      industries: [ay],
      has_youtube_video: [],
      classification_tags: [],
      profiles: [],
      has_profile: [],
      has_uploaded_document: [],
      classification_categories: [],
      alpha: []
    },
    total: 10
  },
  success: true
}  
```

{% endtab %}
{% endtabs %}

**Code**

{% tabs %}
{% tab title="Node" %}

```javascript
const accessToken = `<ACCESS TOKEN>`

fetch('https://public-api.expertfile.com/v2/organization/:corporation/expert', {
    method: 'GET',
    headers: {
        'Content-Type': 'application/x-www-form-urlencoded',
        'Authorization': `Bearer ${accessToken}`
    }
})
.then(response => response.json())
.then(json => {
    const { success, data } = json

    if (success) {
        const { experts, aggregations } = data;
        console.log('Experts', experts);
        console.log('Filters', aggregations);
    }

})
.catch(error => console.error(error));
```

{% endtab %}

{% tab title="PHP" %}

```php
$accessToken = urlencode('<ACCESS TOKEN>');
$url = 'https://public-api.expertfile.com/v2/organization/:corporation/expert';

$ch = curl_init($url);
curl_setopt(
    $ch,
    CURLOPT_HTTPHEADER,
    array('Content-Type: application/x-www-form-urlencoded', 'Authorization: Bearer ' . $accessToken)
);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);

$response = curl_exec($ch);
$json = json_decode($response);

if($json->success){
    var_dump($json->data);
}

curl_close($ch);

```

{% endtab %}

{% tab title="Curl" %}

```
curl https://public-api.expertfile.com/v2/organization/:corporation/expert \
    -H "Content-Type: application/json" \
    -H "Authorization: Bearer <ACCESS TOKEN>"
```

{% endtab %}
{% endtabs %}

## Applying Category Filter to Experts

<mark style="color:green;">`GET`</mark> [**/v2/organization/:corporation/expert**](https://public-api.expertfile.com/v2/organization/:corporation/expert)

**Headers**

| Name          | Value              |
| ------------- | ------------------ |
| Content-Type  | `application/json` |
| Authorization | `Bearer <token>`   |

**Url**

<table><thead><tr><th width="339.3333333333333">Name</th><th>Type</th><th>Description</th></tr></thead><tbody><tr><td>corporation</td><td>number</td><td>Corporation ID</td></tr><tr><td>categories</td><td>string</td><td>Filter by categories. Array of categories(i.e. ["cat1","cat2"])</td></tr></tbody></table>

**Response**

{% tabs %}
{% tab title="200" %}

```json
{
  data: {
    experts: [],
    aggregations: {
      has_uploaded_video: [],
      has_vimeo_video: [],
      has_slideshare_document: [],
      topics: [],
      countries: [],
      has_photo: [],
      states: [],
      has_uploaded_podchaser: [],
      has_book: [],
      companies: [],
      industries: [],
      has_youtube_video: [],
      classification_tags: [],
      profiles: [],
      has_profile: [],
      has_uploaded_document: [],
      classification_categories: [],
      alpha: []
    },
    total: 10
  },
  success: true
}  
```

{% endtab %}
{% endtabs %}

**Code**

{% tabs %}
{% tab title="Node" %}

```javascript
const accessToken = `<ACCESS TOKEN>`

const params = {
    categories: JSON.stringify(['Advisors', 'Featured'])
};

const qs = new URLSearchParams(params).toString()

const path = `https://public-api.expertfile.com/v2/organization/:corporation/expert${qs ? '?' + qs : ''}`
fetch(path, {
    method: 'GET',
    headers: {
        'Content-Type': 'application/x-www-form-urlencoded',
        'Authorization': `Bearer ${accessToken}`
    }
})
.then(response => response.json())
.then(json => {
    const { success, data } = json

    if (success) {
        const { experts, aggregations } = data;
        console.log('Experts', experts);
        console.log('Filters', aggregations);
    }

})
.catch(error => console.error(error));
```

{% endtab %}

{% tab title="PHP" %}

```php
$accessToken = urlencode('<ACCESS CODE>');
$parameters = array(
    'categories' => json_encode(['Advisors', 'Featured'])
);

$url = 'https://public-api.expertfile.com/v2/organization/:corporation/expert?' . http_build_query($parameters);

$ch = curl_init($url);
curl_setopt(
    $ch,
    CURLOPT_HTTPHEADER,
    array('Content-Type: application/x-www-form-urlencoded', 'Authorization: Bearer ' . $accessToken)
);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);

$response = curl_exec($ch);
$json = json_decode($response);

if($json->success){
    var_dump($json->data);
}

curl_close($ch);
```

{% endtab %}

{% tab title="Curl" %}

```
curl --GET \
--data-urlencode 'categories=["Advisors","Featured"]' \
https://public-api.expertfile.com/v2/organization/:corporation/expert \
-H "Content-Type: application/json" \
-H "Authorization: Bearer <ACCESS CODE>"
```

{% endtab %}
{% endtabs %}


# Expert Profile

CRUD endpoints for a user's full profile. This is the endpoint used to create the full profile for a expert as it includes all data fields.

{% hint style="info" %}
Please note that in all urls & code samples you'll need to replace`:username` and `:corporation` with appropriate values
{% endhint %}

## Get Individual Expert

<mark style="color:green;">`GET`</mark> [**/v2/organization/:corporation/expert/:username**](https://public-api.expertfile.com/v2/organization/:corporation/expert/:username)

**Headers**

| Name          | Value              |
| ------------- | ------------------ |
| Content-Type  | `application/json` |
| Authorization | `Bearer <token>`   |

**Url**

<table><thead><tr><th width="339.3333333333333">Name</th><th>Type</th><th>Description</th></tr></thead><tbody><tr><td>corporation</td><td>number</td><td>Corporation ID</td></tr><tr><td>username</td><td>string</td><td>Unique username</td></tr></tbody></table>

**Response**

{% tabs %}
{% tab title="200" %}

```json
 {
  data: {
    accomplishment: [], 
    account: [],
    affiliation: [],
    assessment: [],   
    article: [],
    audio: [],
    audios_all: [],
    availability: [],
    avatar: { s: {}, m: {}, o: {}, l: {} },
    biography: [],
    book: [],
    category: [],
    corporationprofile: [],
    corporationsocial: [],
    course: [],
    cv: [],
    document: [],
    documents_all: [],
    education: [],
    eventappearance: [],
    fee: [],
    industry: [],
    language: [],
    link: [],
    mediaappearance: [],
    patent: [],
    partnership: [],
    photo: [],
    podchaser: [],
    profiletype: [],
    qanda: [],
    researchfocus: [],
    researchgrant: [],
    sampletalk: [],
    seo: []
    social: [],
    slideshare: [],
    spotlight: [],
    tag: [],
    tagline: [],
    testimonial: [],
    topic: [],
    video: [],
    videos_all: [],
    vimeo: [],
    youtube: [],    
  },
  success: true
}
```

{% endtab %}
{% endtabs %}

Code

{% tabs %}
{% tab title="Node" %}

```javascript
const accessToken = `<ACCESS TOKEN>`

fetch('https://public-api.expertfile.com/v2/organization/:corporation/expert/:username', {
    method: 'GET',
    headers: {
        'Content-Type': 'application/x-www-form-urlencoded',
        'Authorization': `Bearer ${accessToken}`
    }
})
.then(response => response.json())
.then(json => {
    const { success, data } = json

    if (success) {
        const profile = data;
        console.log('profile', profile)
    }

})
.catch(error => console.error(error));
```

{% endtab %}

{% tab title="PHP" %}

```php
$accessToken = urlencode('<ACCESS TOKEN>');
$url = 'https://public-api.expertfile.com/v2/organization/:corporation/expert/:username';

$ch = curl_init($url);
curl_setopt(
    $ch,
    CURLOPT_HTTPHEADER,
    array('Content-Type: application/x-www-form-urlencoded', 'Authorization: Bearer ' . $accessToken)
);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);

$response = curl_exec($ch);
$json = json_decode($response);

if($json->success){
    var_dump($json->data);
}

curl_close($ch);
```

{% endtab %}

{% tab title="Curl" %}

```
curl https://public-api.expertfile.com/v2/organization/:corporation/expert/:username
    -H "Content-Type: application/json" \
    -H "Authorization: Bearer <ACCESS TOKEN>"
```

{% endtab %}
{% endtabs %}

## Create Expert

<mark style="color:blue;">`POST`</mark>[ **/v2/organization/:corporation/expert**](https://public-api.expertfile.com/v2/organization/:corporation/expert/:username)

**Headers**

| Name          | Value              |
| ------------- | ------------------ |
| Content-Type  | `application/json` |
| Authorization | `Bearer <token>`   |

**Url**

<table><thead><tr><th width="339.3333333333333">Name</th><th>Type</th><th>Description</th></tr></thead><tbody><tr><td>corporation</td><td>number</td><td>Corporation ID</td></tr><tr><td>username</td><td>string</td><td>Unique username</td></tr></tbody></table>

**Body**

<table><thead><tr><th width="339.3333333333333">Name</th><th>Type</th><th>Description</th></tr></thead><tbody><tr><td>firstname<mark style="color:red;"><strong>*</strong></mark></td><td>string</td><td>First Name</td></tr><tr><td>lastname<mark style="color:red;"><strong>*</strong></mark></td><td>string</td><td>Last Name</td></tr><tr><td>job_title<mark style="color:red;"><strong>*</strong></mark></td><td>string</td><td>Job</td></tr><tr><td>email<mark style="color:red;"><strong>*</strong></mark></td><td>string</td><td>Email</td></tr><tr><td>company<mark style="color:red;"><strong>*</strong></mark></td><td>string</td><td>Company</td></tr><tr><td>department</td><td>string</td><td>Department</td></tr><tr><td>phone_number</td><td>string</td><td>Phone #</td></tr><tr><td>phone_number_extension</td><td>string</td><td>Phone extension</td></tr><tr><td>location_city</td><td>string</td><td>City</td></tr><tr><td>location_state</td><td>string</td><td>State/Province<br>See full list <a href="/reference/helpers#state-province-codes"><em><strong>here</strong></em></a></td></tr><tr><td>location_country</td><td>string</td><td>Country<br>See full list <a href="/reference/helpers#country-codes"><em><strong>here</strong></em></a></td></tr><tr><td>location_postal</td><td>string</td><td>ZIP/Postal Code</td></tr><tr><td>location_address</td><td>string</td><td>Address</td></tr><tr><td>location_building</td><td>string</td><td>Building</td></tr><tr><td>location_room</td><td>string</td><td>Room #</td></tr></tbody></table>

**Response**

{% tabs %}
{% tab title="200" %}

```json
 {
  data: {
    username: '<USERNAME>', 
    inserted: true
  },
  success: true
}
```

{% endtab %}
{% endtabs %}

Code

{% tabs %}
{% tab title="Node" %}

```javascript
const data = new URLSearchParams();
const accessToken = `<ACCESS TOKEN>`

data.append('firstname', 'Testfirstname');
data.append('lastname', 'Testlastname');
data.append('job_title', 'Job title');
data.append('email', 'testfromapi@testing.com');
data.append('company', 'Testcompany');
data.append('department', 'Testdepartment');
data.append('phone_number', 'Testphone');
data.append('phone_number_extension', 'Testext');
data.append('location_city', 'Testcity');
data.append('location_state', 'ON');
data.append('location_country', 'CA');
data.append('location_postal', 'Testpostal');
data.append('location_address', 'Testaddress');
data.append('location_building', 'Testbuilding');
data.append('location_room', 'Testroom');

fetch('https://public-api.expertfile.com/v2/organization/:corporation/expert', {
    method: 'POST',
    headers: {
        'Content-Type': 'application/x-www-form-urlencoded',
        'Authorization': `Bearer ${accessToken}`
    },
    body: data
})
.then(response => response.json())
.then(json => {
    const { success, data, error } = json

    if (success) {
        const { username } = data
        console.log('New username', username)
    }

})
.catch(error => console.error(error));
```

{% endtab %}

{% tab title="PHP" %}

```php
$accessToken = urlencode('<ACCESS TOKEN>');

$url = 'https://public-api.expertfile.com/v2/organization/:corporation/expert';
$data = [
'firstname' => 'Testfirstname',
'lastname' => 'Testlastname',
'job_title' => 'Job title',
'email' => 'testfromapi@testing.com',
'company' => 'Testcompany',
'department' => 'Testdepartment',
'phone_number' => 'Testphone',
'phone_number_extension' => 'Testext',
'location_city' => 'Testcity',
'location_state' => 'ON',
'location_country' => 'CA',
'location_postal' => 'Testpostal',
'location_address' => 'Testaddress',
'location_building' => 'Testbuilding',
'location_room' => 'Testroom'
];

$ch = curl_init($url);
curl_setopt(
    $ch,
    CURLOPT_HTTPHEADER,
    array('Content-Type: application/x-www-form-urlencoded', 'Authorization: Bearer ' . $accessToken)
);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_POSTFIELDS, http_build_query($data));

$response = curl_exec($ch);
$json = json_decode($response);

if($json->success){
    var_dump($json->data);
}

curl_close($ch);
```

{% endtab %}

{% tab title="Curl" %}

```
curl -X POST https://public-api.expertfile.com/v2/organization/:corporation/expert \
    -H "Content-Type: application/json" \
    -H "Authorization: Bearer <ACCESS TOKEN>" \
    -d '{"firstname": "Testfirstname","lastname": "Testlastname","job_title": "Job title","email": "testfromapi@testing.com","company": "Testcompany","department": "Testdepartment","phone_number": "Testphone","phone_number_extension": "Testext","location_city": "Testcity","location_state": "ON","location_country": "CA","location_postal": "Testpostal","location_address": "Testaddress","location_building": "Testbuilding", "location_room": "Testroom"}'
```

{% endtab %}
{% endtabs %}

## Update Expert

<mark style="color:blue;">`PUT`</mark> [**/v2/organization/:corporation/expert/:username**](https://public-api.expertfile.com/v2/organization/:corporation/expert/:username)

**Headers**

| Name          | Value              |
| ------------- | ------------------ |
| Content-Type  | `application/json` |
| Authorization | `Bearer <token>`   |

**Url**

<table><thead><tr><th width="339.3333333333333">Name</th><th>Type</th><th>Description</th></tr></thead><tbody><tr><td>corporation</td><td>number</td><td>Corporation ID</td></tr><tr><td>username</td><td>string</td><td>Unique username</td></tr></tbody></table>

**Body**

<table><thead><tr><th width="339.3333333333333">Name</th><th>Type</th><th>Description</th></tr></thead><tbody><tr><td>firstname</td><td>string</td><td>First Name</td></tr><tr><td>lastname</td><td>string</td><td>Last Name</td></tr><tr><td>job_title</td><td>string</td><td>Job</td></tr><tr><td>email</td><td>string</td><td>Email</td></tr><tr><td>company</td><td>string</td><td>Company</td></tr><tr><td>department</td><td>string</td><td>Department</td></tr><tr><td>phone_number</td><td>string</td><td>Phone #</td></tr><tr><td>phone_number_extension</td><td>string</td><td>Phone extension</td></tr><tr><td>location_city</td><td>string</td><td>City</td></tr><tr><td>location_state</td><td>string</td><td>State/Province<br>See full list <a href="/reference/helpers#state-province-codes"><em><strong>here</strong></em></a></td></tr><tr><td>location_country</td><td>string</td><td>Country<br>See full list <a href="/reference/helpers#country-codes"><em><strong>here</strong></em></a></td></tr><tr><td>location_postal</td><td>string</td><td>ZIP/Postal Code</td></tr><tr><td>location_address</td><td>string</td><td>Address</td></tr><tr><td>location_building</td><td>string</td><td>Building</td></tr><tr><td>location_room</td><td>string</td><td>Room # </td></tr><tr><td>is_published</td><td>number</td><td>Published(1 or 0)</td></tr><tr><td>is_private</td><td>number</td><td>Private(1 or 0)</td></tr></tbody></table>

**Response**

{% tabs %}
{% tab title="200" %}

```json
 {
  data: {
    username: '<USERNAME>', 
    updated: true
  },
  success: true
}
```

{% endtab %}
{% endtabs %}

Code

{% tabs %}
{% tab title="Node" %}

```javascript
const data = new URLSearchParams();
const accessToken = `<ACCESS TOKEN>`

data.append('firstname', 'Testfirstname');
data.append('lastname', 'Testlastname');
data.append('job_title', 'Job title');
data.append('email', 'testfromapi@testing.com');
data.append('company', 'Testcompany');
data.append('department', 'Testdepartment');
data.append('phone_number', 'Testphone');
data.append('phone_number_extension', 'Testext');
data.append('location_city', 'Testcity');
data.append('location_state', 'ON');
data.append('location_country', 'CA');
data.append('location_postal', 'Testpostal');
data.append('location_address', 'Testaddress');
data.append('location_building', 'Testbuilding');
data.append('location_room', 'Testroom');
data.append('is_published', '1');
data.append('is_private', '0');

fetch('https://public-api.expertfile.com/v2/organization/:corporation/expert/:username', {
    method: 'PUT',
    headers: {
        'Content-Type': 'application/x-www-form-urlencoded',
        'Authorization': `Bearer ${accessToken}`
    },
    body: data
})
.then(response => response.json())
.then(json => {
    const { success, data, error } = json

    if (success) {
        const { username } = data
        console.log('Updated username', username)
    }

})
.catch(error => console.error(error));
```

{% endtab %}

{% tab title="PHP" %}

```php
$accessToken = urlencode('<ACCESS TOKEN>');

$url = 'https://public-api.expertfile.com/v2/organization/:corporation/expert/:username';
$data = [
'firstname' => 'Testfirstname',
'lastname' => 'Testlastname',
'job_title' => 'Job title',
'email' => 'testfromapi@testing.com',
'company' => 'Testcompany',
'department' => 'Testdepartment',
'phone_number' => 'Testphone',
'phone_number_extension' => 'Testext',
'location_city' => 'Testcity',
'location_state' => 'ON',
'location_country' => 'CA',
'location_postal' => 'Testpostal',
'location_address' => 'Testaddress',
'location_building' => 'Testbuilding',
'location_room' => 'Testroom',
'is_published' => '1',
'is_private' => '0'
];

$ch = curl_init($url);
curl_setopt(
    $ch,
    CURLOPT_HTTPHEADER,
    array('Content-Type: application/x-www-form-urlencoded', 'Authorization: Bearer ' . $accessToken)
);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_PUT, http_build_query($data));

$response = curl_exec($ch);
$json = json_decode($response);

if($json->success){
    var_dump($json->data);
}

curl_close($ch);
```

{% endtab %}

{% tab title="Curl" %}

```
curl -X PUT https://public-api.expertfile.com/v2/organization/:corporation/expert/:username \
    -H "Content-Type: application/json" \
    -H "Authorization: Bearer <ACCESS TOKEN>" \
    -d '{"firstname": "Testfirstname","lastname": "Testlastname","job_title": "Job title","email": "testfromapi@testing.com","company": "Testcompany","department": "Testdepartment","phone_number": "Testphone","phone_number_extension": "Testext","location_city": "Testcity","location_state": "ON","location_country": "CA","location_postal": "Testpostal","location_address": "Testaddress","location_building": "Testbuilding", "location_room": "Testroom", "is_published": "1" "is_private": "0"}'
```

{% endtab %}
{% endtabs %}

## Delete Expert

<mark style="color:red;">`DELETE`</mark> [**/v2/organization/:corporation/expert/:username**](https://public-api.expertfile.com/v2/organization/:corporation/expert/:username)

**Headers**

| Name          | Value              |
| ------------- | ------------------ |
| Content-Type  | `application/json` |
| Authorization | `Bearer <token>`   |

**Url**

<table><thead><tr><th width="339.3333333333333">Name</th><th>Type</th><th>Description</th></tr></thead><tbody><tr><td>corporation</td><td>number</td><td>Corporation ID</td></tr><tr><td>username</td><td>string</td><td>Unique username</td></tr></tbody></table>

**Response**

{% tabs %}
{% tab title="200" %}

```json
{ 
    data: { 
        deleted: true, 
        username: '<USERNAME>', 
    }, 
    success: true 
}
```

{% endtab %}
{% endtabs %}

**Code**

{% tabs %}
{% tab title="Node" %}

```javascript
const accessToken = `<ACCESS TOKEN>`

fetch('https://public-api.expertfile.com/v2/organization/:corporation/expert/:username', {
    method: 'DELETE',
    headers: {
        'Content-Type': 'application/x-www-form-urlencoded',
        'Authorization': `Bearer ${accessToken}`
    }
})
.then(response => response.json())
.then(json => {
    const { success, data, error } = json

    if (success) {
        const { username } = data
        console.log('Deleted username', username)
    }

})
.catch(error => console.error(error));
```

{% endtab %}

{% tab title="PHP" %}

```php
$accessToken = urlencode('<ACCESS TOKEN>');

$url = 'https://public-api.expertfile.com/v2/organization/:corporation/expert/:username';

$ch = curl_init($url);
curl_setopt(
    $ch,
    CURLOPT_HTTPHEADER,
    array('Content-Type: application/x-www-form-urlencoded', 'Authorization: Bearer ' . $accessToken)
);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_CUSTOMREQUEST, "DELETE");

$response = curl_exec($ch);
$json = json_decode($response);

if($json->success){
    var_dump($json->data);
}

curl_close($ch);
```

{% endtab %}

{% tab title="Curl" %}

```
curl -X DELETE https://public-api.expertfile.com/v2/organization/:corporation/expert/:username \
    -H "Content-Type: application/json" \
    -H "Authorization: Bearer <ACCESS TOKEN>"
```

{% endtab %}
{% endtabs %}


# Accomplishments

CRUD endpoints for a user's accomplishments

{% hint style="info" %}
Please note that in all urls & code samples you'll need to replace`:username` and `:corporation` with appropriate values
{% endhint %}

## Get All Accomplishments

<mark style="color:green;">`GET`</mark> [**/v2/organization/:corporation/expert/:username/accomplishment**](https://public-api.expertfile.com/v2/organization/:corporation/expert/:username/accomplishment/)

**Headers**

| Name          | Value              |
| ------------- | ------------------ |
| Content-Type  | `application/json` |
| Authorization | `Bearer <token>`   |

**Url**

<table><thead><tr><th width="339.3333333333333">Name</th><th>Type</th><th>Description</th></tr></thead><tbody><tr><td>corporation</td><td>number</td><td>Corporation ID</td></tr><tr><td>username</td><td>string</td><td>Unique username</td></tr></tbody></table>

**Response**

{% tabs %}
{% tab title="200" %}

```json
 {
  data: [
    {
      id: 1,
      title: 'Accomplishment Title',
      description: 'Accomplishment Description',
      start: 0,
      end: null,
      type: 71
    }
  ],
  success: true
}
```

{% endtab %}
{% endtabs %}

Code

{% tabs %}
{% tab title="Node" %}

```javascript
const accessToken = `<ACCESS TOKEN>`

fetch('https://public-api.expertfile.com/v2/organization/:corporation/expert/:username/accomplishment', {
    method: 'GET',
    headers: {
        'Content-Type': 'application/x-www-form-urlencoded',
        'Authorization': `Bearer ${accessToken}`
    }
})
.then(response => response.json())
.then(json => {
    const { success, data } = json

    if (success) {
        const talks = data;
        console.log('all accomplishments', json)
    }

})
.catch(error => console.error(error));
```

{% endtab %}

{% tab title="PHP" %}

```php
$accessToken = urlencode('<ACCESS TOKEN>');
$url = 'https://public-api.expertfile.com/v2/organization/:corporation/expert/:username/accomplishment';

$ch = curl_init($url);
curl_setopt(
    $ch,
    CURLOPT_HTTPHEADER,
    array('Content-Type: application/x-www-form-urlencoded', 'Authorization: Bearer ' . $accessToken)
);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);

$response = curl_exec($ch);
$json = json_decode($response);

if($json->success){
    var_dump($json->data);
}

curl_close($ch);

```

{% endtab %}

{% tab title="Curl" %}

```
curl https://public-api.expertfile.com/v2/organization/:corporation/expert/:username/accomplishment \
    -H "Content-Type: application/json" \
    -H "Authorization: Bearer <ACCESS TOKEN>"
```

{% endtab %}
{% endtabs %}

## Get Individual Accomplishment

<mark style="color:green;">`GET`</mark> [**/v2/organization/:corporation/expert/:username/accomplishment/:id**](https://public-api.expertfile.com/v2/organization/:corporation/expert/:username/accomplishment/:id)

**Headers**

| Name          | Value              |
| ------------- | ------------------ |
| Content-Type  | `application/json` |
| Authorization | `Bearer <token>`   |

**Url**

<table><thead><tr><th width="339.3333333333333">Name</th><th>Type</th><th>Description</th></tr></thead><tbody><tr><td>corporation</td><td>number</td><td>Corporation ID</td></tr><tr><td>username</td><td>string</td><td>Unique username</td></tr><tr><td>id</td><td>number</td><td>Accomplishment ID</td></tr></tbody></table>

**Response**

{% tabs %}
{% tab title="200" %}

```json
 {
  data: [
    {
      id: 1,
      title: 'Accomplishment Title',
      description: 'Accomplishment Description',
      start: 0,
      end: null,
      type: 71
    }
  ],
  success: true
}
```

{% endtab %}
{% endtabs %}

Code

{% tabs %}
{% tab title="Node" %}

```javascript
const accessToken = `<ACCESS CODE>`

fetch('https://public-api.expertfile.com/v2/organization/:corporation/expert/:username/accomplishment/:id', {
    method: 'GET',
    headers: {
        'Content-Type': 'application/x-www-form-urlencoded',
        'Authorization': `Bearer ${accessToken}`
    }
})
.then(response => response.json())
.then(json => {
    const { success, data, error } = json

    if (success) {
        console.log('accomplishment', data)
    }

})
.catch(error => console.error(error));
```

{% endtab %}

{% tab title="PHP" %}

```php
$accessToken = urlencode('<ACCESS TOKEN>');
$url = 'https://public-api.expertfile.com/v2/organization/:corporation/expert/:username/accomplishment/:id';

$ch = curl_init($url);
curl_setopt(
    $ch,
    CURLOPT_HTTPHEADER,
    array('Content-Type: application/x-www-form-urlencoded', 'Authorization: Bearer ' . $accessToken)
);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);

$response = curl_exec($ch);
$json = json_decode($response);

if($json->success){
    var_dump($json->data);
}

curl_close($ch);
```

{% endtab %}

{% tab title="Curl" %}

```
curl -X GET https://public-api.expertfile.com/v2/organization/:corporation/expert/:username/accomplishment/:id \
    -H "Content-Type: application/json" \
    -H "Authorization: Bearer <ACCESS TOKEN>"     
```

{% endtab %}
{% endtabs %}

## Create Accomplishment

<mark style="color:blue;">`POST`</mark> [**/v2/organization/:corporation/expert/:username/accomplishment**](https://public-api.expertfile.com/v2/organization/:corporation/expert/:username/accomplishment)

**Headers**

| Name          | Value              |
| ------------- | ------------------ |
| Content-Type  | `application/json` |
| Authorization | `Bearer <token>`   |

**Url**

<table><thead><tr><th width="339.3333333333333">Name</th><th>Type</th><th>Description</th></tr></thead><tbody><tr><td>corporation</td><td>number</td><td>Corporation ID</td></tr><tr><td>username</td><td>string</td><td>Unique username</td></tr></tbody></table>

**Body**

<table><thead><tr><th width="339.3333333333333">Name</th><th>Type</th><th>Description</th></tr></thead><tbody><tr><td>title<mark style="color:red;">*</mark></td><td>string</td><td>Accomplishment Title</td></tr><tr><td>description<mark style="color:red;">*</mark></td><td>string</td><td>Accomplishment Description</td></tr><tr><td>start</td><td>unix timestamp</td><td>Accomplishment date</td></tr><tr><td>type</td><td>number</td><td>Accomplishment ID(71 for 'professional' and 73 for 'personal')</td></tr></tbody></table>

**Response**

{% tabs %}
{% tab title="200" %}

```json
{ 
    data: { 
        id: 1
    }, 
    success: true 
}
```

{% endtab %}
{% endtabs %}

Code

{% tabs %}
{% tab title="Node" %}

```javascript
const data = new URLSearchParams();
const accessToken = `<ACCESS TOKEN>`

data.append('title', 'My Accomplishment Idea');
data.append('description', 'My accomplishment is about...');
data.append('type', 71);

fetch('https://public-api.expertfile.com/v2/organization/:corporation/expert/:username/accomplishment', {
    method: 'POST',
    headers: {
        'Content-Type': 'application/x-www-form-urlencoded',
        'Authorization': `Bearer ${accessToken}`
    },
    body: data
})
.then(response => response.json())
.then(json => {
    const { success, data, error } = json

    if (success) {
        const { id } = data
        console.log('New accomplishment id', id)
    }

})
.catch(error => console.error(error));

```

{% endtab %}

{% tab title="PHP" %}

```php
$accessToken = urlencode('<ACCESS TOKEN>');

$url = 'https://public-api.expertfile.com/v2/organization/:corporation/expert/:username/accomplishment';
$data = ['title' => 'My Accomplishment Idea', 'description' => 'My accomplishment is about...', 'type' => 71];

$ch = curl_init($url);
curl_setopt(
    $ch,
    CURLOPT_HTTPHEADER,
    array('Content-Type: application/x-www-form-urlencoded', 'Authorization: Bearer ' . $accessToken)
);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_POSTFIELDS, http_build_query($data));

$response = curl_exec($ch);
$json = json_decode($response);

if($json->success){
    var_dump($json->data);
}

curl_close($ch);
```

{% endtab %}

{% tab title="Curl" %}

```
curl -X POST https://public-api.expertfile.com/v2/organization/:corporation/expert/:username/accomplishment \
    -H "Content-Type: application/json" \
    -H "Authorization: Bearer <ACCESS TOKEN>" \
    -d '{"title":"My Accomplishment Idea", "description":"My accomplishment is about...", "type": 71}'
```

{% endtab %}
{% endtabs %}

## Update Accomplishment

<mark style="color:blue;">`PUT`</mark> [**/v2/organization/:corporation/expert/:username/accomplishment/:id**](https://public-api.expertfile.com/v2/organization/:corporation/expert/:username/accomplishment/:id)

**Headers**

| Name          | Value              |
| ------------- | ------------------ |
| Content-Type  | `application/json` |
| Authorization | `Bearer <token>`   |

**Url**

<table><thead><tr><th width="339.3333333333333">Name</th><th>Type</th><th>Description</th></tr></thead><tbody><tr><td>corporation</td><td>number</td><td>Corporation ID</td></tr><tr><td>username</td><td>string</td><td>Unique username</td></tr><tr><td>id</td><td>number</td><td>Accomplishment ID</td></tr></tbody></table>

**Body**

<table><thead><tr><th width="339.3333333333333">Name</th><th>Type</th><th>Description</th></tr></thead><tbody><tr><td>title<mark style="color:red;">*</mark></td><td>string</td><td>Accomplishment Title</td></tr><tr><td>description<mark style="color:red;">*</mark></td><td>string</td><td>Accomplishment Description</td></tr><tr><td>start</td><td>unix timestamp</td><td>Accomplishment date</td></tr><tr><td>type</td><td>number</td><td>Sample Talk Type ID(71 for 'professional' and 73 for 'personal')</td></tr></tbody></table>

**Response**

{% tabs %}
{% tab title="200" %}

```json
{ 
    data: { 
        id: 1, 
        updated: true 
    }, 
    success: true 
}
```

{% endtab %}
{% endtabs %}

Code

{% tabs %}
{% tab title="Node" %}

```javascript
const data = new URLSearchParams();
const accessToken = `<ACCESS TOKEN>`

data.append('title', 'My Accomplishment Idea');
data.append('description', 'My accomplishment is about...');
data.append('type', 71);

fetch('https://public-api.expertfile.com/v2/organization/:corporation/expert/:username/accomplishment/:id', {
    method: 'PUT',
    headers: {
        'Content-Type': 'application/x-www-form-urlencoded',
        'Authorization': `Bearer ${accessToken}`
    },
    body: data
})
.then(response => response.json())
.then(json => {
    const { success, data, error } = json

    if (success) {
        const { id } = data
        console.log('Updated accomplishment id', id)
    }

})
.catch(error => console.error(error));

```

{% endtab %}

{% tab title="PHP" %}

```php
$accessToken = urlencode('<ACCESS TOKEN>');

$url = 'https://public-api.expertfile.com/v2/organization/:corporation/expert/:username/accomplishment/:id';
$data = ['title' => 'My Accomplishment Idea', 'description' => 'My accomplishment is about...', 'type' => 71];

$ch = curl_init($url);
curl_setopt(
    $ch,
    CURLOPT_HTTPHEADER,
    array('Content-Type: application/x-www-form-urlencoded', 'Authorization: Bearer ' . $accessToken)
);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_PUT, http_build_query($data));

$response = curl_exec($ch);
$json = json_decode($response);

if($json->success){
    var_dump($json->data);
}

curl_close($ch);
```

{% endtab %}

{% tab title="Curl" %}

```
curl -X PUT https://public-api.expertfile.com/v2/organization/:corporation/expert/:username/accomplishment/:id \
    -H "Content-Type: application/json" \
    -H "Authorization: Bearer <ACCESS TOKEN>" \
    -d '{"title":"My Accomplishment Idea", "description":"My accomplishment is about...", "type": 71}'
```

{% endtab %}
{% endtabs %}

## Delete Accomplishment

<mark style="color:red;">`DELETE`</mark> [**/v2/organization/:corporation/expert/:username/accomplishment/:id**](https://public-api.expertfile.com/v2/organization/:corporation/expert/:username/accomplishment/:id)

**Headers**

| Name          | Value              |
| ------------- | ------------------ |
| Content-Type  | `application/json` |
| Authorization | `Bearer <token>`   |

**Url**

<table><thead><tr><th width="339.3333333333333">Name</th><th>Type</th><th>Description</th></tr></thead><tbody><tr><td>corporation</td><td>number</td><td>Corporation ID</td></tr><tr><td>username</td><td>string</td><td>Unique username</td></tr><tr><td>id</td><td>number</td><td>Accomplishment ID</td></tr></tbody></table>

**Response**

{% tabs %}
{% tab title="200" %}

```json
{ 
    data: { 
        deleted: true, 
        id: 1 
    }, 
    success: true 
}
```

{% endtab %}
{% endtabs %}

Code

{% tabs %}
{% tab title="Node" %}

```javascript
const accessToken = `<ACCESS TOKEN>`

fetch('https://public-api.expertfile.com/v2/organization/:corporation/expert/:username/accomplishment/:id', {
    method: 'DELETE',
    headers: {
        'Content-Type': 'application/x-www-form-urlencoded',
        'Authorization': `Bearer ${accessToken}`
    }
})
.then(response => response.json())
.then(json => {
    const { success, data, error } = json

    if (success) {
        const { id } = data
        console.log('Deleted accomplishment id', id)
    }

})
.catch(error => console.error(error));

```

{% endtab %}

{% tab title="PHP" %}

```php
$accessToken = urlencode('<ACCESS TOKEN>');

$url = 'https://public-api.expertfile.com/v2/organization/:corporation/expert/:username/accomplishment/:id';

$ch = curl_init($url);
curl_setopt(
    $ch,
    CURLOPT_HTTPHEADER,
    array('Content-Type: application/x-www-form-urlencoded', 'Authorization: Bearer ' . $accessToken)
);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_CUSTOMREQUEST, "DELETE");

$response = curl_exec($ch);
$json = json_decode($response);

if($json->success){
    var_dump($json->data);
}

curl_close($ch);
```

{% endtab %}

{% tab title="Curl" %}

```
curl -X DELETE https://public-api.expertfile.com/v2/organization/:corporation/expert/:username/accomplishment/:id \
    -H "Content-Type: application/json" \
    -H "Authorization: Bearer <ACCESS TOKEN>"
```

{% endtab %}
{% endtabs %}


# Affiliations

CRUD endpoints for a user's affiliations

{% hint style="info" %}
Please note that in all urls & code samples you'll need to replace`:username` and `:corporation` with appropriate values
{% endhint %}

## Get All Affiliations

<mark style="color:green;">`GET`</mark> [**/v2/organization/:corporation/expert/:username/affiliation**](https://public-api.expertfile.com/v2/organization/:corporation/expert/:username/affiliation)

**Headers**

| Name          | Value              |
| ------------- | ------------------ |
| Content-Type  | `application/json` |
| Authorization | `Bearer <token>`   |

**Url**

<table><thead><tr><th width="339.3333333333333">Name</th><th>Type</th><th>Description</th></tr></thead><tbody><tr><td>corporation</td><td>number</td><td>Corporation ID</td></tr><tr><td>username</td><td>string</td><td>Unique username</td></tr></tbody></table>

**Response**

{% tabs %}
{% tab title="200" %}

```json
{ 
    data: [ 
        { 
            id: 1, 
            name: 'Affiliation Name' 
        } 
    ], 
    success: true 
}
```

{% endtab %}
{% endtabs %}

Code

{% tabs %}
{% tab title="Node" %}

```javascript
const accessToken = `<ACCESS TOKEN>`

fetch('https://public-api.expertfile.com/v2/organization/:corporation/expert/:username/affiliation', {
    method: 'GET',
    headers: {
        'Content-Type': 'application/x-www-form-urlencoded',
        'Authorization': `Bearer ${accessToken}`
    }
})
.then(response => response.json())
.then(json => {
    const { success, data } = json

    if (success) {
        const affiliations = data
        console.log('affiliation', affiliations)
    }

})
.catch(error => console.error(error));
```

{% endtab %}

{% tab title="PHP" %}

```php
$accessToken = urlencode('<ACCESS TOKEN>');
$url = 'https://public-api.expertfile.com/v2/organization/:corporation/expert/:username/affiliation';

$ch = curl_init($url);
curl_setopt(
    $ch,
    CURLOPT_HTTPHEADER,
    array('Content-Type: application/x-www-form-urlencoded', 'Authorization: Bearer ' . $accessToken)
);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);

$response = curl_exec($ch);
$json = json_decode($response);

if($json->success){
    var_dump($json->data);
}

curl_close($ch);

```

{% endtab %}

{% tab title="Curl" %}

```
curl https://public-api.expertfile.com/v2/organization/:corporation/expert/:username/affiliation \
    -H "Content-Type: application/json" \
    -H "Authorization: Bearer <ACCESS TOKEN>"
```

{% endtab %}
{% endtabs %}

## Get Individual Affiliation

<mark style="color:green;">`GET`</mark> [**/v2/organization/:corporation/expert/:username/affiliation/:id**](https://public-api.expertfile.com/v2/organization/:corporation/expert/:username/affiliation/:id)

**Headers**

| Name          | Value              |
| ------------- | ------------------ |
| Content-Type  | `application/json` |
| Authorization | `Bearer <token>`   |

**Url**

<table><thead><tr><th width="339.3333333333333">Name</th><th>Type</th><th>Description</th></tr></thead><tbody><tr><td>corporation</td><td>number</td><td>Corporation ID</td></tr><tr><td>username</td><td>string</td><td>Unique username</td></tr><tr><td>id</td><td>number</td><td>Affiliation ID</td></tr></tbody></table>

**Response**

{% tabs %}
{% tab title="200" %}

```json
{ 
    data: [ 
        { 
            id: 1, 
            name: 'Affiliation Name' 
        } 
    ], 
    success: true 
}
```

{% endtab %}
{% endtabs %}

Code

{% tabs %}
{% tab title="Node" %}

```javascript
const accessToken = `<ACCESS CODE>`

fetch('https://public-api.expertfile.com/v2/organization/:corporation/expert/:username/affiliation/:id', {
    method: 'GET',
    headers: {
        'Content-Type': 'application/x-www-form-urlencoded',
        'Authorization': `Bearer ${accessToken}`
    }
})
.then(response => response.json())
.then(json => {
    const { success, data } = json
    if (success) {
        const affliation = data
        console.log('affliation', affliation[0])
    }

})
.catch(error => console.error(error));
```

{% endtab %}

{% tab title="PHP" %}

```php
$accessToken = urlencode('<ACCESS TOKEN>');
$url = 'https://public-api.expertfile.com/v2/organization/:corporation/expert/:username/affliation/:id';

$ch = curl_init($url);
curl_setopt(
    $ch,
    CURLOPT_HTTPHEADER,
    array('Content-Type: application/x-www-form-urlencoded', 'Authorization: Bearer ' . $accessToken)
);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);

$response = curl_exec($ch);
$json = json_decode($response);

if($json->success){
    var_dump($json->data);
}

curl_close($ch);
```

{% endtab %}

{% tab title="Curl" %}

```
curl -X GET https://public-api.expertfile.com/v2/organization/:corporation/expert/:username/affliation/:id \
    -H "Content-Type: application/json" \
    -H "Authorization: Bearer <ACCESS TOKEN>"     
```

{% endtab %}
{% endtabs %}

## Create Affiliation

<mark style="color:blue;">`POST`</mark>[ **/v2/organization/:corporation/expert/:username/affiliation**](https://public-api.expertfile.com/v2/organization/:corporation/expert/:username/affiliation)

**Headers**

| Name          | Value              |
| ------------- | ------------------ |
| Content-Type  | `application/json` |
| Authorization | `Bearer <token>`   |

**Url**

<table><thead><tr><th width="339.3333333333333">Name</th><th>Type</th><th>Description</th></tr></thead><tbody><tr><td>corporation</td><td>number</td><td>Corporation ID</td></tr><tr><td>username</td><td>string</td><td>Unique username</td></tr></tbody></table>

**Body**

<table><thead><tr><th width="339.3333333333333">Name</th><th>Type</th><th>Description</th></tr></thead><tbody><tr><td>name<mark style="color:red;">*</mark></td><td>string</td><td>Affiliation Name</td></tr></tbody></table>

**Response**

{% tabs %}
{% tab title="200" %}

```json
{ 
    data: { 
        id: 1
    }, 
    success: true 
}
```

{% endtab %}
{% endtabs %}

Code

{% tabs %}
{% tab title="Node" %}

```javascript
const data = new URLSearchParams();

const accessToken = `<ACCESS TOKEN>`

data.append('name', 'My Affiliation');

fetch('https://public-api.expertfile.com/v2/organization/:corporation/expert/:username/affiliation', {
    method: 'POST',
    headers: {
        'Content-Type': 'application/x-www-form-urlencoded',
        'Authorization': `Bearer ${accessToken}`
    },
    body: data
})
.then(response => response.json())
.then(json => {
    const { success, data, error } = json

    if (success) {
        const { id } = data
        console.log('New affiliation id', id)
    }

})
.catch(error => console.error(error));
```

{% endtab %}

{% tab title="PHP" %}

```php
$accessToken = urlencode('<ACCESS TOKEN>');

$url = 'https://public-api.expertfile.com/v2/organization/:corporation/expert/:username/affiliation';
$data = ['name' => 'My Affiliation'];

$ch = curl_init($url);
curl_setopt(
    $ch,
    CURLOPT_HTTPHEADER,
    array('Content-Type: application/x-www-form-urlencoded', 'Authorization: Bearer ' . $accessToken)
);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_POSTFIELDS, http_build_query($data));

$response = curl_exec($ch);
$json = json_decode($response);

if($json->success){
    var_dump($json->data);
}

curl_close($ch);
```

{% endtab %}

{% tab title="Curl" %}

```
curl -X POST https://public-api.expertfile.com/v2/organization/:corporation/expert/:username/affiliation \
    -H "Content-Type: application/json" \
    -H "Authorization: Bearer <ACCESS TOKEN>" \
    -d '{"name":"My Affiliation"}'
```

{% endtab %}
{% endtabs %}

## Update Affiliation

<mark style="color:blue;">`PUT`</mark> [**/v2/organization/:corporation/expert/:username/affiliation/:id**](https://public-api.expertfile.com/v2/organization/:corporation/expert/:username/affiliation)

**Headers**

| Name          | Value              |
| ------------- | ------------------ |
| Content-Type  | `application/json` |
| Authorization | `Bearer <token>`   |

**Url**

<table><thead><tr><th width="339.3333333333333">Name</th><th>Type</th><th>Description</th></tr></thead><tbody><tr><td>corporation</td><td>number</td><td>Corporation ID</td></tr><tr><td>username</td><td>string</td><td>Unique username</td></tr><tr><td>id</td><td>number</td><td>Affiliation ID</td></tr></tbody></table>

**Body**

<table><thead><tr><th width="339.3333333333333">Name</th><th>Type</th><th>Description</th></tr></thead><tbody><tr><td>name<mark style="color:red;">*</mark></td><td>string</td><td>Affiliation Name</td></tr></tbody></table>

**Response**

{% tabs %}
{% tab title="200" %}

```json
{ 
    data: { 
        id: 1
    }, 
    success: true 
}
```

{% endtab %}
{% endtabs %}

Code

{% tabs %}
{% tab title="Node" %}

```javascript
const data = new URLSearchParams();
const accessToken = `<ACCESS TOKEN>`

data.append('name', 'My Affiliation');

fetch('https://public-api.expertfile.com/v2/organization/:corporation/expert/:username/affiliation/:id', {
    method: 'PUT',
    headers: {
        'Content-Type': 'application/x-www-form-urlencoded',
        'Authorization': `Bearer ${accessToken}`
    },
    body: data
})
.then(response => response.json())
.then(json => {
    const { success, data, error } = json

    if (success) {
        const { id } = data
        console.log('Updated affiliation id', id)
    }

})
.catch(error => console.error(error));
```

{% endtab %}

{% tab title="PHP" %}

```php
$accessToken = urlencode('<ACCESS TOKEN>');

$url = 'https://public-api.expertfile.com/v2/organization/:corporation/expert/:username/affiliation/:id';

$data = ['name' => 'My Affiliation'];

$ch = curl_init($url);
curl_setopt(
    $ch,
    CURLOPT_HTTPHEADER,
    array('Content-Type: application/x-www-form-urlencoded', 'Authorization: Bearer ' . $accessToken)
);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_PUT, http_build_query($data));

$response = curl_exec($ch);
$json = json_decode($response);

if($json->success){
    var_dump($json->data);
}

curl_close($ch);
```

{% endtab %}

{% tab title="Curl" %}

```
curl -X PUT https://public-api.expertfile.com/v2/organization/:corporation/expert/:username/affiliation/:id \
    -H "Content-Type: application/json" \
    -H "Authorization: Bearer <ACCESS TOKEN>" \
    -d '{"name":"My Affiliation"}'
```

{% endtab %}
{% endtabs %}

## Delete Link

<mark style="color:red;">`DELETE`</mark>[**/v2/organization/:corporation/expert/:username/affiliation/:id**](https://public-api.expertfile.com/v2/organization/:corporation/expert/:username/affiliation/:idd)

**Headers**

| Name          | Value              |
| ------------- | ------------------ |
| Content-Type  | `application/json` |
| Authorization | `Bearer <token>`   |

**Url**

<table><thead><tr><th width="339.3333333333333">Name</th><th>Type</th><th>Description</th></tr></thead><tbody><tr><td>corporation</td><td>number</td><td>Corporation ID</td></tr><tr><td>username</td><td>string</td><td>Unique username</td></tr><tr><td>id</td><td>number</td><td>Affiliation ID</td></tr></tbody></table>

**Response**

{% tabs %}
{% tab title="200" %}

```json
{ 
    data: { 
        deleted: true, 
        id: 1
    }, 
    success: true 
}
```

{% endtab %}
{% endtabs %}

Code

{% tabs %}
{% tab title="Node" %}

```javascript
const accessToken = `<ACCESS TOKEN>`

fetch('https://public-api.expertfile.com/v2/organization/:corporation/expert/:username/affiliation/:id', {
    method: 'DELETE',
    headers: {
        'Content-Type': 'application/x-www-form-urlencoded',
        'Authorization': `Bearer ${accessToken}`
    }
})
.then(response => response.json())
.then(json => {
    const { success, data, error } = json

    if (success) {
        const { id } = data
        console.log('Deleted affiliation id', id)
    }

})
.catch(error => console.error(error));

```

{% endtab %}

{% tab title="PHP" %}

```php
$accessToken = urlencode('<ACCESS TOKEN>');

$url = 'https://public-api.expertfile.com/v2/organization/:corporation/expert/:username/affiliation/:id';

$ch = curl_init($url);
curl_setopt(
    $ch,
    CURLOPT_HTTPHEADER,
    array('Content-Type: application/x-www-form-urlencoded', 'Authorization: Bearer ' . $accessToken)
);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_CUSTOMREQUEST, "DELETE");

$response = curl_exec($ch);
$json = json_decode($response);

if($json->success){
    var_dump($json->data);
}

curl_close($ch);
```

{% endtab %}

{% tab title="Curl" %}

```
curl -X DELETE https://public-api.expertfile.com/v2/organization/:corporation/expert/:username/affiliation/:id \
    -H "Content-Type: application/json" \
    -H "Authorization: Bearer <ACCESS TOKEN>"
```

{% endtab %}
{% endtabs %}


# Article

CRUD endpoints for a user's articles

{% hint style="info" %}
Please note that in all urls & code samples you'll need to replace`:username` and `:corporation` with appropriate values
{% endhint %}

## Get All Articles

<mark style="color:green;">`GET`</mark>[ **/v2/organization/:corporation/expert/:username/article**](https://public-api.expertfile.com/v2/organization/:corporation/expert/:username/article/)

**Headers**

| Name          | Value              |
| ------------- | ------------------ |
| Content-Type  | `application/json` |
| Authorization | `Bearer <token>`   |

**Url**

<table><thead><tr><th width="339.3333333333333">Name</th><th>Type</th><th>Description</th></tr></thead><tbody><tr><td>corporation</td><td>number</td><td>Corporation ID</td></tr><tr><td>username</td><td>string</td><td>Unique username</td></tr></tbody></table>

**Response**

{% tabs %}
{% tab title="200" %}

```json
{
  data: [
    {
      id: 1,
      title: 'Article Title',
      publisher: '',
      details: '',
      date: 0,
      url: 'https://myurl.com',
      authors: ''
    },
  ],
  success: true
}
```

{% endtab %}
{% endtabs %}

Code

{% tabs %}
{% tab title="Node" %}

```javascript
const accessToken = `<ACCESS TOKEN>`

fetch('https://public-api.expertfile.com/v2/organization/:corporation/expert/:username/article', {
    method: 'GET',
    headers: {
        'Content-Type': 'application/x-www-form-urlencoded',
        'Authorization': `Bearer ${accessToken}`
    }
})
.then(response => response.json())
.then(json => {
    const { success, data } = json

    if (success) {
        const articles = data;
        console.log('all articles', articles)
    }

})
.catch(error => console.error(error));
```

{% endtab %}

{% tab title="PHP" %}

```php
$accessToken = urlencode('<ACCESS TOKEN>');
$url = 'https://public-api.expertfile.com/v2/organization/:corporation/expert/:username/article';

$ch = curl_init($url);
curl_setopt(
    $ch,
    CURLOPT_HTTPHEADER,
    array('Content-Type: application/x-www-form-urlencoded', 'Authorization: Bearer ' . $accessToken)
);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);

$response = curl_exec($ch);
$json = json_decode($response);

if($json->success){
    var_dump($json->data);
}

curl_close($ch);

```

{% endtab %}

{% tab title="Curl" %}

```
curl https://public-api.expertfile.com/v2/organization/:corporation/expert/:username/article \
    -H "Content-Type: application/json" \
    -H "Authorization: Bearer <ACCESS TOKEN>"
```

{% endtab %}
{% endtabs %}

## Get Individual Article

<mark style="color:green;">`GET`</mark> [**/v2/organization/:corporation/expert/:username/article/:id**](https://public-api.expertfile.com/v2/organization/:corporation/expert/:username/article/:id)

**Headers**

| Name          | Value              |
| ------------- | ------------------ |
| Content-Type  | `application/json` |
| Authorization | `Bearer <token>`   |

**Url**

<table><thead><tr><th width="339.3333333333333">Name</th><th>Type</th><th>Description</th></tr></thead><tbody><tr><td>corporation</td><td>number</td><td>Corporation ID</td></tr><tr><td>username</td><td>string</td><td>Unique username</td></tr><tr><td>id</td><td>number</td><td>Article ID</td></tr></tbody></table>

**Response**

{% tabs %}
{% tab title="200" %}

```json
{
  data: [
    {
      id: 1,
      title: 'Article Title',
      publisher: '',
      details: '',
      date: 0,
      url: 'https://myurl.com',
      authors: ''
    },
  ],
  success: true
}
```

{% endtab %}
{% endtabs %}

Code

{% tabs %}
{% tab title="Node" %}

<pre class="language-javascript"><code class="lang-javascript"><strong>const accessToken = `&#x3C;ACCESS TOKEN>`
</strong>
fetch('https://public-api.expertfile.com/v2/organization/:corporation/expert/:username/article/:id', {
    method: 'GET',
    headers: {
        'Content-Type': 'application/x-www-form-urlencoded',
        'Authorization': `Bearer ${accessToken}`
    }
})
.then(response => response.json())
.then(json => {
    const { success, data } = json

    if (success) {
        const article = data;
        console.log('article', article)
    }

})
.catch(error => console.error(error));
</code></pre>

{% endtab %}

{% tab title="PHP" %}

```php
$accessToken = urlencode('<ACCESS TOKEN>');
$url = 'https://public-api.expertfile.com/v2/organization/:corporation/expert/:username/article/:id';

$ch = curl_init($url);
curl_setopt(
    $ch,
    CURLOPT_HTTPHEADER,
    array('Content-Type: application/x-www-form-urlencoded', 'Authorization: Bearer ' . $accessToken)
);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);

$response = curl_exec($ch);
$json = json_decode($response);

if($json->success){
    var_dump($json->data);
}

curl_close($ch);
```

{% endtab %}

{% tab title="Curl" %}

```
curl -X GET https://public-api.expertfile.com/v2/organization/:corporation/expert/:username/article/:id \
    -H "Content-Type: application/json" \
    -H "Authorization: Bearer <ACCESS TOKEN>"     
```

{% endtab %}
{% endtabs %}

## Create Article

<mark style="color:blue;">`POST`</mark> [**/v2/organization/:corporation/expert/:username/article**](https://public-api.expertfile.com/v2/organization/:corporation/expert/:username/article/)

**Headers**

| Name          | Value              |
| ------------- | ------------------ |
| Content-Type  | `application/json` |
| Authorization | `Bearer <token>`   |

**Url**

<table><thead><tr><th width="339.3333333333333">Name</th><th>Type</th><th>Description</th></tr></thead><tbody><tr><td>corporation</td><td>number</td><td>Corporation ID</td></tr><tr><td>username</td><td>string</td><td>Unique username</td></tr></tbody></table>

**Body**

<table><thead><tr><th width="339.3333333333333">Name</th><th>Type</th><th>Description</th></tr></thead><tbody><tr><td>title<mark style="color:red;">*</mark></td><td>string</td><td>Article Title</td></tr><tr><td>details<mark style="color:red;">*</mark></td><td>string</td><td>Article Details</td></tr><tr><td>url</td><td>string</td><td>Article Url</td></tr><tr><td>publisher<mark style="color:red;">*</mark></td><td>string</td><td>Article Publisher</td></tr><tr><td>authors</td><td>string</td><td>Article Authors</td></tr></tbody></table>

**Response**

{% tabs %}
{% tab title="200" %}

```json
{ 
    data: { 
        id: 1
    }, 
    success: true 
}
```

{% endtab %}
{% endtabs %}

Code

{% tabs %}
{% tab title="Node" %}

```javascript
const data = new URLSearchParams();
const accessToken = `<ACCESS TOKEN>`

data.append('title', 'Article title');
data.append('details', 'Article details...');
data.append('url', 'https://myurl.com');
data.append('publisher', 'Article publishers...');
data.append('authors', 'Article authors');

fetch('https://public-api.expertfile.com/v2/organization/:corporation/expert/:username/article', {
    method: 'POST',
    headers: {
        'Content-Type': 'application/x-www-form-urlencoded',
        'Authorization': `Bearer ${accessToken}`
    },
    body: data
})
.then(response => response.json())
.then(json => {
    const { success, data, error } = json

    if (success) {
        const { id } = data
        console.log('New article id', id)
    }

})
.catch(error => console.error(error));
```

{% endtab %}

{% tab title="PHP" %}

```php
$accessToken = urlencode('<ACCESS TOKEN>');

$url = 'https://public-api.expertfile.com/v2/organization/:corporation/expert/:username/article';
$data = ['title' => 'Article title', 'details' => 'Article details...', 'url' => 'https://myurl.com', 'publisher' => 'Article publishers...', 'authors' => 'Article authors'];

$ch = curl_init($url);
curl_setopt(
    $ch,
    CURLOPT_HTTPHEADER,
    array('Content-Type: application/x-www-form-urlencoded', 'Authorization: Bearer ' . $accessToken)
);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_POSTFIELDS, http_build_query($data));

$response = curl_exec($ch);
$json = json_decode($response);

if($json->success){
    var_dump($json->data);
}

curl_close($ch)
```

{% endtab %}

{% tab title="Curl" %}

```
curl -X POST https://public-api.expertfile.com/v2/organization/:corporation/expert/:username/article \
    -H "Content-Type: application/json" \
    -H "Authorization: Bearer <ACCESS TOKEN>" \
    -d '{"title": "Article title", "Article": "Article details...", "url": "https://myurl.com", "publisher": "Article publishers...", "authors": "Article authors"}'
```

{% endtab %}
{% endtabs %}

## Update Article

<mark style="color:blue;">`PUT`</mark> [**/v2/organization/:corporation/expert/:username/article/:id**](https://public-api.expertfile.com/v2/organization/:corporation/expert/:username/article/:id)

**Headers**

| Name          | Value              |
| ------------- | ------------------ |
| Content-Type  | `application/json` |
| Authorization | `Bearer <token>`   |

**Url**

<table><thead><tr><th width="339.3333333333333">Name</th><th>Type</th><th>Description</th></tr></thead><tbody><tr><td>corporation</td><td>number</td><td>Corporation ID</td></tr><tr><td>username</td><td>string</td><td>Unique username</td></tr><tr><td>id</td><td>number</td><td>Article ID</td></tr></tbody></table>

**Body**

<table><thead><tr><th width="339.3333333333333">Name</th><th>Type</th><th>Description</th></tr></thead><tbody><tr><td>title<mark style="color:red;">*</mark></td><td>string</td><td>Article Title</td></tr><tr><td>details<mark style="color:red;">*</mark></td><td>string</td><td>Article Details</td></tr><tr><td>url</td><td>string</td><td>Article Url</td></tr><tr><td>publisher<mark style="color:red;">*</mark></td><td>string</td><td>Article Publisher</td></tr><tr><td>authors</td><td>string</td><td>Article Authors</td></tr></tbody></table>

**Response**

{% tabs %}
{% tab title="200" %}

```json
{ 
    data: { 
        id: 1, 
        updated: true 
    }, 
    success: true 
}
```

{% endtab %}
{% endtabs %}

Code

{% tabs %}
{% tab title="Node" %}

```javascript
const data = new URLSearchParams();
const accessToken = `<ACCESS TOKEN>`

data.append('title', 'Article title');
data.append('details', 'Article details...');
data.append('url', 'https://myurl.com');
data.append('publisher', 'Article publishers...');
data.append('authors', 'Article authors');

fetch('https://public-api.expertfile.com/v2/organization/:corporation/expert/:username/article/:id', {
    method: 'PUT',
    headers: {
        'Content-Type': 'application/x-www-form-urlencoded',
        'Authorization': `Bearer ${accessToken}`
    },
    body: data
})
.then(response => response.json())
.then(json => {
    const { success, data, error } = json

    if (success) {
        const { id } = data
        console.log('New article id', id)
    }

})
.catch(error => console.error(error));

```

{% endtab %}

{% tab title="PHP" %}

```php
$accessToken = urlencode('<ACCESS TOKEN>');

$url = 'https://public-api.expertfile.com/v2/organization/:corporation/expert/:username/article/:id';
$data = ['title' => 'Article title', 'details' => 'Article details...', 'url' => 'https://myurl.com', 'publisher' => 'Article publishers...', 'authors' => 'Article authors'];

$ch = curl_init($url);
curl_setopt(
    $ch,
    CURLOPT_HTTPHEADER,
    array('Content-Type: application/x-www-form-urlencoded', 'Authorization: Bearer ' . $accessToken)
);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_PUT, http_build_query($data));

$response = curl_exec($ch);
$json = json_decode($response);

if($json->success){
    var_dump($json->data);
}

curl_close($ch)
```

{% endtab %}

{% tab title="Curl" %}

```
curl -X PUT https://public-api.expertfile.com/v2/organization/:corporation/expert/:username/article/:id \
    -H "Content-Type: application/json" \
    -H "Authorization: Bearer <ACCESS TOKEN>" \
    -d '{"title": "Article title", "Article": "Course details...", "url": "https://myurl.com", "publisher": "Article publishers...", "authors": "Article authors"}'
```

{% endtab %}
{% endtabs %}

## Delete Article

<mark style="color:red;">`DELETE`</mark> [**/v2/organization/:corporation/expert/:username/article/:id**](https://public-api.expertfile.com/v2/organization/:corporation/expert/:username/article/:id)

**Headers**

| Name          | Value              |
| ------------- | ------------------ |
| Content-Type  | `application/json` |
| Authorization | `Bearer <token>`   |

**Url**

<table><thead><tr><th width="339.3333333333333">Name</th><th>Type</th><th>Description</th></tr></thead><tbody><tr><td>corporation</td><td>number</td><td>Corporation ID</td></tr><tr><td>username</td><td>string</td><td>Unique username</td></tr><tr><td>id</td><td>number</td><td>Article ID</td></tr></tbody></table>

**Response**

{% tabs %}
{% tab title="200" %}

```json
{ 
    data: { 
        deleted: true, 
        id: 1 
    }, 
    success: true 
}
```

{% endtab %}
{% endtabs %}

Code

{% tabs %}
{% tab title="Node" %}

```javascript
const accessToken = `<ACCESS TOKEN>`

fetch('https://public-api.expertfile.com/v2/organization/:corporation/expert/:username/article/:id', {
    method: 'DELETE',
    headers: {
        'Content-Type': 'application/x-www-form-urlencoded',
        'Authorization': `Bearer ${accessToken}`
    }
})
.then(response => response.json())
.then(json => {
    const { success, data, error } = json

    if (success) {
        const { id } = data
        console.log('Deleted article id', id)
    }

})
.catch(error => console.error(error));

```

{% endtab %}

{% tab title="PHP" %}

```php
$accessToken = urlencode('<ACCESS TOKEN>');

$url = 'https://public-api.expertfile.com/v2/organization/:corporation/expert/:username/course/:id';

$ch = curl_init($url);
curl_setopt(
    $ch,
    CURLOPT_HTTPHEADER,
    array('Content-Type: application/x-www-form-urlencoded', 'Authorization: Bearer ' . $accessToken)
);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_CUSTOMREQUEST, "DELETE");

$response = curl_exec($ch);
$json = json_decode($response);

if($json->success){
    var_dump($json->data);
}

curl_close($ch);
```

{% endtab %}

{% tab title="Curl" %}

```
curl -X DELETE https://public-api.expertfile.com/v2/organization/:corporation/expert/:username/course/:id \
    -H "Content-Type: application/json" \
    -H "Authorization: Bearer <ACCESS TOKEN>"
```

{% endtab %}
{% endtabs %}


# Availability

Get or create/update the a user's availability

{% hint style="info" %}
Please note that in all urls & code samples you'll need to replace`:username` and `:corporation` with appropriate values
{% endhint %}

## Get Availability

<mark style="color:green;">`GET`</mark>[ **/v2/organization/:corporation/expert/:username/availability**](https://public-api.expertfile.com/v2/organization/:corporation/expert/:username/availability)

**Headers**

| Name          | Value              |
| ------------- | ------------------ |
| Content-Type  | `application/json` |
| Authorization | `Bearer <token>`   |

**Url**

<table><thead><tr><th width="339.3333333333333">Name</th><th>Type</th><th>Description</th></tr></thead><tbody><tr><td>corporation</td><td>number</td><td>Corporation ID</td></tr><tr><td>username</td><td>string</td><td>Unique username</td></tr></tbody></table>

**Response**

{% tabs %}
{% tab title="200" %}

```json
 {
  data: [
    {
      availability_keynote: 1,
      availability_moderator: 1,
      availability_panelist: 1,
      availability_workshop: 1,
      availability_host_mc: 1,
      availability_appearance: 1,
      availability_corptraining: 1
    }
  ],
  success: true
}
```

{% endtab %}
{% endtabs %}

Code

{% tabs %}
{% tab title="Node" %}

```javascript
const accessToken = `<ACCESS TOKEN>`

fetch('https://public-api.expertfile.com/v2/organization/:corporation/expert/:username/availability', {
    method: 'GET',
    headers: {
        'Content-Type': 'application/x-www-form-urlencoded',
        'Authorization': `Bearer ${accessToken}`
    }
})
.then(response => response.json())
.then(json => {
    const { success, data } = json

    if (success) {
        const availability = data[0]
        console.log('availability', availability)
    }

})
.catch(error => console.error(error));
```

{% endtab %}

{% tab title="PHP" %}

```php
$accessToken = urlencode('<ACCESS TOKEN>');
$url = 'https://public-api.expertfile.com/v2/organization/:corporation/expert/:username/availability';

$ch = curl_init($url);
curl_setopt(
    $ch,
    CURLOPT_HTTPHEADER,
    array('Content-Type: application/x-www-form-urlencoded', 'Authorization: Bearer ' . $accessToken)
);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);

$response = curl_exec($ch);
$json = json_decode($response);

if($json->success){
    echo $json->data[0]->availability;
}

curl_close($ch);
```

{% endtab %}

{% tab title="Curl" %}

```
curl https://public-api.expertfile.com/v2/organization/:corporation/expert/:username/availability \
    -H "Content-Type: application/json" \
    -H "Authorization: Bearer <ACCESS TOKEN>"

```

{% endtab %}
{% endtabs %}

## Update Availability

<mark style="color:blue;">`POST`</mark> [**/v2/organization/:corporation/expert/:username/availability**](https://public-api.expertfile.com/v2/organization/:corporation/expert/:username/availability)

**Headers**

| Name          | Value              |
| ------------- | ------------------ |
| Content-Type  | `application/json` |
| Authorization | `Bearer <token>`   |

**Url**

<table><thead><tr><th width="339.3333333333333">Name</th><th>Type</th><th>Description</th></tr></thead><tbody><tr><td>corporation</td><td>number</td><td>Corporation ID</td></tr><tr><td>username</td><td>string</td><td>Unique username</td></tr></tbody></table>

**Body**

<table><thead><tr><th>Name</th><th width="249">Type</th><th>Description</th></tr></thead><tbody><tr><td>availability_keynote</td><td>number</td><td>Available for Keynote</td></tr><tr><td>availability_moderator</td><td>number</td><td>Available for Moderator</td></tr><tr><td>availability_panelist</td><td>number</td><td>Available for Panelist</td></tr><tr><td>availability_workshop</td><td>number</td><td>Available for Workshop</td></tr><tr><td>availability_host_mc</td><td>number</td><td>Available for Host/MC</td></tr><tr><td>availability_appearance</td><td>number</td><td>Available for Author Appearance</td></tr><tr><td>availability_corptraining</td><td>number</td><td>Available for Corp Training</td></tr></tbody></table>

**Response**

{% tabs %}
{% tab title="200" %}

```json
{ 
    data: { 
        id: null 
    }, 
    success: true 
}
```

{% endtab %}
{% endtabs %}

Code

{% tabs %}
{% tab title="Node" %}

```javascript
const data = new URLSearchParams();
const accessToken = `<ACCESS TOKEN>`

data.append('availability_keynote', 1)
data.append('availability_moderator', 1)
data.append('availability_panelist', 1)
data.append('availability_workshop', 1)
data.append('availability_host_mc', 1)
data.append('availability_appearance', 1)
data.append('availability_corptraining', 1)

fetch('https://public-api.expertfile.com/v2/organization/:corporation/expert/:username/availability', {
    method: 'POST',
    headers: {
        'Content-Type': 'application/x-www-form-urlencoded',
        'Authorization': `Bearer ${accessToken}`
    },
    body: data
})
.then(response => response.json())
.then(json => {
    const { success, data } = json

})
.catch(error => console.error(error));

```

{% endtab %}

{% tab title="PHP" %}

```php
$accessToken = urlencode('<ACCESS TOKEN>');

$url = 'https://public-api.expertfile.com/v2/organization/:corporation/expert/:username/availability';

$data = ['availability_keynote' => 1,
 'availability_moderator' => 1,
 'availability_panelist' => 1,
 'availability_workshop' => 1,
 'availability_host_mc' => 1,
 'availability_appearance' => 1,
 'availability_corptraining' => 1];

$ch = curl_init($url);
curl_setopt(
    $ch,
    CURLOPT_HTTPHEADER,
    array('Content-Type: application/x-www-form-urlencoded', 'Authorization: Bearer ' . $accessToken)
);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_POSTFIELDS, http_build_query($data));

$response = curl_exec($ch);
$json = json_decode($response);

if($json->success){
    var_dump($json->data);
}

curl_close($ch);
```

{% endtab %}

{% tab title="Curl" %}

```
curl -X POST https://public-api.expertfile.com/v2/organization/:corporation/expert/:username/availability \
    -H "Content-Type: application/json" \
    -H "Authorization: Bearer <ACCESS TOKEN>" \
    -d '{"availability_keynote": 1, "availability_moderator": 1, "availability_panelist": 1, "availability_workshop": 1, "availability_host_mc": 1, "availability_appearance": 1, "availability_corptraining": 1}'    
```

{% endtab %}
{% endtabs %}


# Biography

Get or create/update the a user's biography field

{% hint style="info" %}
Please note that in all urls & code samples you'll need to replace`:username` and `:corporation` with appropriate values
{% endhint %}

## Get Biography

<mark style="color:green;">`GET`</mark> [**/v2/organization/:corporation/expert/:username/biography**](https://public-api.expertfile.com/v2/organization/:corporation/expert/:username/biography)

**Headers**

| Name          | Value              |
| ------------- | ------------------ |
| Content-Type  | `application/json` |
| Authorization | `Bearer <token>`   |

**Url**

<table><thead><tr><th width="339.3333333333333">Name</th><th>Type</th><th>Description</th></tr></thead><tbody><tr><td>corporation</td><td>number</td><td>Corporation ID</td></tr><tr><td>username</td><td>string</td><td>Unique username</td></tr></tbody></table>

**Response**

{% tabs %}
{% tab title="200" %}

```json
 {
  data: [
    {
      biography: 'Biography text for expert here.'
    }
  ],
  success: true
}
```

{% endtab %}
{% endtabs %}

Code

{% tabs %}
{% tab title="Node" %}

```javascript
const accessToken = `<ACCESS TOKEN>`

fetch('https://public-api.expertfile.com/v2/organization/:corporation/expert/:username/biography', {
    method: 'GET',
    headers: {
        'Content-Type': 'application/x-www-form-urlencoded',
        'Authorization': `Bearer ${accessToken}`
    }
})
.then(response => response.json())
.then(json => {
    const { success, data } = json

    if (success) {
        const { biography } = data[0]
        console.log('biography', biography)
    }

})
.catch(error => console.error(error));
```

{% endtab %}

{% tab title="PHP" %}

```php
$accessToken = urlencode('<ACCESS TOKEN>');
$url = 'https://public-api.expertfile.com/v2/organization/:corporation/expert/:username/biography';

$ch = curl_init($url);
curl_setopt(
    $ch,
    CURLOPT_HTTPHEADER,
    array('Content-Type: application/x-www-form-urlencoded', 'Authorization: Bearer ' . $accessToken)
);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);

$response = curl_exec($ch);
$json = json_decode($response);

if($json->success){
    echo $json->data[0]->biography;
}

curl_close($ch);
```

{% endtab %}

{% tab title="Curl" %}

```
curl https://public-api.expertfile.com/v2/organization/:corporation/expert/:username/biography \
    -H "Content-Type: application/json" \
    -H "Authorization: Bearer <ACCESS TOKEN>"

```

{% endtab %}
{% endtabs %}

## Update Biography

<mark style="color:blue;">`POST`</mark> [**/v2/organization/:corporation/expert/:username/biography**](https://public-api.expertfile.com/v2/organization/:corporation/expert/:username/biography)

**Headers**

| Name          | Value              |
| ------------- | ------------------ |
| Content-Type  | `application/json` |
| Authorization | `Bearer <token>`   |

**Url**

<table><thead><tr><th width="339.3333333333333">Name</th><th>Type</th><th>Description</th></tr></thead><tbody><tr><td>corporation</td><td>number</td><td>Corporation ID</td></tr><tr><td>username</td><td>string</td><td>Unique username</td></tr></tbody></table>

**Body**

| Name                                          | Type   | Description          |
| --------------------------------------------- | ------ | -------------------- |
| description<mark style="color:red;">\*</mark> | string | Content of biography |

**Response**

{% tabs %}
{% tab title="200" %}

```json
{ 
    data: { 
        id: null 
    }, 
    success: true 
}
```

{% endtab %}
{% endtabs %}

Code

{% tabs %}
{% tab title="Node" %}

```javascript
const data = new URLSearchParams();
const accessToken = `<ACCESS TOKEN>`

data.append('description', 'Your biography text');

fetch('https://public-api.expertfile.com/v2/organization/:corporation/expert/:username/biography', {
    method: 'POST',
    headers: {
        'Content-Type': 'application/x-www-form-urlencoded',
        'Authorization': `Bearer ${accessToken}`
    },
    body: data
})
.then(response => response.json())
.then(json => {
    const { success, data } = json

    if (success) {
        const { id } = data
    }

})
.catch(error => console.error(error));

```

{% endtab %}

{% tab title="PHP" %}

```php
$accessToken = urlencode('<ACCESS TOKEN>');

$url = 'https://public-api.expertfile.com/v2/organization/:corporation/expert/:username/biography';
$data = ['description' => 'Your biography text'];

$ch = curl_init($url);
curl_setopt(
    $ch,
    CURLOPT_HTTPHEADER,
    array('Content-Type: application/x-www-form-urlencoded', 'Authorization: Bearer ' . $accessToken)
);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_POSTFIELDS, http_build_query($data));

$response = curl_exec($ch);
$json = json_decode($response);

if($json->success){
    var_dump($json->data);
}

curl_close($ch);
```

{% endtab %}

{% tab title="Curl" %}

```
curl -X POST https://public-api.expertfile.com/v2/organization/:corporation/expert/:username/biography \
    -H "Content-Type: application/json" \
    -H "Authorization: Bearer <ACCESS TOKEN>" \
    -d '{"description":"Your biography text"}'
```

{% endtab %}
{% endtabs %}


# Categories

CRUD endpoints for a user's categories

{% hint style="info" %}
Please note that in all urls & code samples you'll need to replace`:username` and `:corporation` with appropriate values
{% endhint %}

## Get All Categories

<mark style="color:green;">`GET`</mark>[ **/v2/organization/:corporation/expert/:username/category**](https://public-api.expertfile.com/v2/organization/:corporation/staff/:username/category)

**Headers**

| Name          | Value              |
| ------------- | ------------------ |
| Content-Type  | `application/json` |
| Authorization | `Bearer <token>`   |

**Url**

<table><thead><tr><th width="339.3333333333333">Name</th><th>Type</th><th>Description</th></tr></thead><tbody><tr><td>corporation</td><td>number</td><td>Corporation ID</td></tr><tr><td>username</td><td>string</td><td>Unique username</td></tr></tbody></table>

**Response**

{% tabs %}
{% tab title="200" %}

```json
 {
  data: [
    {
      id: 1,
      category_id: 1,
      category: "category name"
    }
  ],
  success: true
}
```

{% endtab %}
{% endtabs %}

Code

{% tabs %}
{% tab title="Node" %}

```javascript
const accessToken = `<ACCESS TOKEN>`

fetch('https://public-api.expertfile.com/v2/organization/:corporation/expert/:username/category', {
    method: 'GET',
    headers: {
        'Content-Type': 'application/x-www-form-urlencoded',
        'Authorization': `Bearer ${accessToken}`
    }
})
.then(response => response.json())
.then(json => {
    const { success, data } = json

    if (success) {
        const category = data
        console.log('category', category)
    }

})
.catch(error => console.error(error));
```

{% endtab %}

{% tab title="PHP" %}

```php
$accessToken = urlencode('<ACCESS TOKEN>');
$url = 'https://public-api.expertfile.com/v2/organization/:corporation/expert/:username/category';

$ch = curl_init($url);
curl_setopt(
    $ch,
    CURLOPT_HTTPHEADER,
    array('Content-Type: application/x-www-form-urlencoded', 'Authorization: Bearer ' . $accessToken)
);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);

$response = curl_exec($ch);
$json = json_decode($response);

if($json->success){
    var_dump($json->data);
}

curl_close($ch);

```

{% endtab %}

{% tab title="Curl" %}

```
curl https://public-api.expertfile.com/v2/organization/:corporation/expert/:username/category \
    -H "Content-Type: application/json" \
    -H "Authorization: Bearer <ACCESS TOKEN>"
```

{% endtab %}
{% endtabs %}

## Get Individual Category

<mark style="color:green;">`GET`</mark> [**/v2/organization/:corporation/expert/:username/category/:id**](https://public-api.expertfile.com/v2/organization/:corporation/staff/:username/category/:id)

**Headers**

| Name          | Value              |
| ------------- | ------------------ |
| Content-Type  | `application/json` |
| Authorization | `Bearer <token>`   |

**Url**

<table><thead><tr><th width="339.3333333333333">Name</th><th>Type</th><th>Description</th></tr></thead><tbody><tr><td>corporation</td><td>number</td><td>Corporation ID</td></tr><tr><td>username</td><td>string</td><td>Unique username</td></tr><tr><td>id</td><td>number</td><td>Category ID</td></tr></tbody></table>

**Response**

{% tabs %}
{% tab title="200" %}

```json
{
  data: [
    {
      id: 1,
      category_id: 1,
      category: "category name"
    }
  ],
  success: true
}
```

{% endtab %}
{% endtabs %}

Code

{% tabs %}
{% tab title="Node" %}

```javascript
const accessToken = `<ACCESS CODE>`

fetch('https://public-api.expertfile.com/v2/organization/:corporation/expert/:username/category/:id', {
    method: 'GET',
    headers: {
        'Content-Type': 'application/x-www-form-urlencoded',
        'Authorization': `Bearer ${accessToken}`
    }
})
.then(response => response.json())
.then(json => {
    const { success, data } = json

    if (success) {
        const category = data
        console.log('category', category[0])
    }

})
.catch(error => console.error(error));
```

{% endtab %}

{% tab title="PHP" %}

```php
$accessToken = urlencode('<ACCESS TOKEN>');
$url = 'https://public-api.expertfile.com/v2/organization/:corporation/expert/:username/category/:id';

$ch = curl_init($url);
curl_setopt(
    $ch,
    CURLOPT_HTTPHEADER,
    array('Content-Type: application/x-www-form-urlencoded', 'Authorization: Bearer ' . $accessToken)
);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);

$response = curl_exec($ch);
$json = json_decode($response);

if($json->success){
    var_dump($json->data);
}

curl_close($ch);
```

{% endtab %}

{% tab title="Curl" %}

```
curl -X GET https://public-api.expertfile.com/v2/organization/:corporation/expert/:username/category/:id \
    -H "Content-Type: application/json" \
    -H "Authorization: Bearer <ACCESS TOKEN>"     
```

{% endtab %}
{% endtabs %}

## Create Category

<mark style="color:blue;">`POST`</mark> [**/v2/organization/:corporation/expert/:username/category**](https://public-api.expertfile.com/v2/organization/:corporation/staff/:username/category/)

**Headers**

| Name          | Value              |
| ------------- | ------------------ |
| Content-Type  | `application/json` |
| Authorization | `Bearer <token>`   |

**Url**

<table><thead><tr><th width="339.3333333333333">Name</th><th>Type</th><th>Description</th></tr></thead><tbody><tr><td>corporation</td><td>number</td><td>Corporation ID</td></tr><tr><td>username</td><td>string</td><td>Unique username</td></tr></tbody></table>

**Body**

<table><thead><tr><th width="339.3333333333333">Name</th><th>Type</th><th>Description</th></tr></thead><tbody><tr><td>name<mark style="color:red;">*</mark></td><td>string</td><td>Category Name</td></tr></tbody></table>

**Response**

{% tabs %}
{% tab title="200" %}

```json
{ 
    data: { 
        id: 1
    }, 
    success: true 
}
```

{% endtab %}
{% endtabs %}

**Code**

{% tabs %}
{% tab title="Node" %}

```javascript
const data = new URLSearchParams();
const accessToken = `<ACCESS TOKEN>`

data.append('name', 'Test');

fetch('https://public-api.expertfile.com/v2/organization/:corporation/expert/:username/category', {
    method: 'POST',
    headers: {
        'Content-Type': 'application/x-www-form-urlencoded',
        'Authorization': `Bearer ${accessToken}`
    },
    body: data
})
.then(response => response.json())
.then(json => {
    const { success, data, error } = json

    if (success) {
        const { id } = data
        console.log('New category id', id)
    }

})
.catch(error => console.error(error));

```

{% endtab %}

{% tab title="PHP" %}

```php
$accessToken = urlencode('<ACCESS TOKEN>');

$url = 'https://public-api.expertfile.com/v2/organization/:corporation/expert/:username/category';
$data = ['name' => 'Test'];

$ch = curl_init($url);
curl_setopt(
    $ch,
    CURLOPT_HTTPHEADER,
    array('Content-Type: application/x-www-form-urlencoded', 'Authorization: Bearer ' . $accessToken)
);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_POSTFIELDS, http_build_query($data));

$response = curl_exec($ch);
$json = json_decode($response);

if($json->success){
    var_dump($json->data);
}

curl_close($ch);
```

{% endtab %}

{% tab title="Curl" %}

```
curl -X POST https://public-api.expertfile.com/v2/organization/:corporation/expert/:username/category \
    -H "Content-Type: application/json" \
    -H "Authorization: Bearer <ACCESS TOKEN>" \
    -d '{"name":"Test"}'
```

{% endtab %}
{% endtabs %}

## Delete Category

<mark style="color:red;">`DELETE`</mark>[**/v2/organization/:corporation/expert/:username/category/:id**](https://public-api.expertfile.com/v2/organization/:corporation/staff/:username/category/:id)

**Headers**

| Name          | Value              |
| ------------- | ------------------ |
| Content-Type  | `application/json` |
| Authorization | `Bearer <token>`   |

**Url**

<table><thead><tr><th width="339.3333333333333">Name</th><th>Type</th><th>Description</th></tr></thead><tbody><tr><td>corporation</td><td>number</td><td>Corporation ID</td></tr><tr><td>username</td><td>string</td><td>Unique username</td></tr><tr><td>id</td><td>number</td><td>Category ID</td></tr></tbody></table>

**Response**

{% tabs %}
{% tab title="200" %}

```json
{ 
    data: { 
        deleted: true, 
        id: 1
    }, 
    success: true 
}
```

{% endtab %}
{% endtabs %}

Code

{% tabs %}
{% tab title="Node" %}

```javascript
const accessToken = `<ACCESS TOKEN>`

fetch('https://public-api.expertfile.com/v2/organization/:corporation/expert/:username/category/:id', {
    method: 'DELETE',
    headers: {
        'Content-Type': 'application/x-www-form-urlencoded',
        'Authorization': `Bearer ${accessToken}`
    }
})
.then(response => response.json())
.then(json => {
    const { success, data, error } = json

    if (success) {
        const { id } = data
        console.log('Deleted category id', id)
    }

})
.catch(error => console.error(error));

```

{% endtab %}

{% tab title="PHP" %}

```php
$accessToken = urlencode('<ACCESS TOKEN>');

$url = 'https://public-api.expertfile.com/v2/organization/:corporation/expert/:username/category/:id';

$ch = curl_init($url);
curl_setopt(
    $ch,
    CURLOPT_HTTPHEADER,
    array('Content-Type: application/x-www-form-urlencoded', 'Authorization: Bearer ' . $accessToken)
);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_CUSTOMREQUEST, "DELETE");

$response = curl_exec($ch);
$json = json_decode($response);

if($json->success){
    var_dump($json->data);
}

curl_close($ch);
```

{% endtab %}

{% tab title="Curl" %}

```
curl -X DELETE https://public-api.expertfile.com/v2/organization/:corporation/expert/:username/category/:id \
    -H "Content-Type: application/json" \
    -H "Authorization: Bearer <ACCESS TOKEN>"
```

{% endtab %}
{% endtabs %}


# Course

CRUD endpoints for a user's courses

{% hint style="info" %}
Please note that in all urls & code samples you'll need to replace`:username` and `:corporation` with appropriate values
{% endhint %}

## Get All Courses

<mark style="color:green;">`GET`</mark> [**/v2/organization/:corporation/expert/:username/course**](https://public-api.expertfile.com/v2/organization/:corporation/expert/:username/course/)

**Headers**

| Name          | Value              |
| ------------- | ------------------ |
| Content-Type  | `application/json` |
| Authorization | `Bearer <token>`   |

**Url**

<table><thead><tr><th width="339.3333333333333">Name</th><th>Type</th><th>Description</th></tr></thead><tbody><tr><td>corporation</td><td>number</td><td>Corporation ID</td></tr><tr><td>username</td><td>string</td><td>Unique username</td></tr></tbody></table>

**Response**

{% tabs %}
{% tab title="200" %}

```json
{
  data: [
    {
      id: 1,
      title: 'Course Title',
      details: 'Course Details',
      url: 'https://www.myurl.com'
    },
  ],
  success: true
}
```

{% endtab %}
{% endtabs %}

Code

{% tabs %}
{% tab title="Node" %}

```javascript
const accessToken = `<ACCESS TOKEN>`

fetch('https://public-api.expertfile.com/v2/organization/:corporation/expert/:username/course', {
    method: 'GET',
    headers: {
        'Content-Type': 'application/x-www-form-urlencoded',
        'Authorization': `Bearer ${accessToken}`
    }
})
.then(response => response.json())
.then(json => {
    const { success, data } = json

    if (success) {
        const courses = data;
        console.log('all courses', courses)
    }

})
.catch(error => console.error(error));
```

{% endtab %}

{% tab title="PHP" %}

```php
$accessToken = urlencode('<ACCESS TOKEN>');
$url = 'https://public-api.expertfile.com/v2/organization/:corporation/expert/:username/course';

$ch = curl_init($url);
curl_setopt(
    $ch,
    CURLOPT_HTTPHEADER,
    array('Content-Type: application/x-www-form-urlencoded', 'Authorization: Bearer ' . $accessToken)
);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);

$response = curl_exec($ch);
$json = json_decode($response);

if($json->success){
    var_dump($json->data);
}

curl_close($ch);

```

{% endtab %}

{% tab title="Curl" %}

```
curl https://public-api.expertfile.com/v2/organization/:corporation/expert/:username/course \
    -H "Content-Type: application/json" \
    -H "Authorization: Bearer <ACCESS TOKEN>"
```

{% endtab %}
{% endtabs %}

## Get Individual Course

<mark style="color:green;">`GET`</mark> [**/v2/organization/:corporation/expert/:username/course/:id**](https://public-api.expertfile.com/v2/organization/:corporation/expert/:username/course/:id)

**Headers**

| Name          | Value              |
| ------------- | ------------------ |
| Content-Type  | `application/json` |
| Authorization | `Bearer <token>`   |

**Url**

<table><thead><tr><th width="339.3333333333333">Name</th><th>Type</th><th>Description</th></tr></thead><tbody><tr><td>corporation</td><td>number</td><td>Corporation ID</td></tr><tr><td>username</td><td>string</td><td>Unique username</td></tr><tr><td>id</td><td>number</td><td>Course ID</td></tr></tbody></table>

**Response**

{% tabs %}
{% tab title="200" %}

```json
{
  data: [
    {
      id: 1,
      title: 'Course Title',
      details: 'Course Details',
      url: 'https://www.myurl.com'
    },
  ],
  success: true
}
```

{% endtab %}
{% endtabs %}

Code

{% tabs %}
{% tab title="Node" %}

<pre class="language-javascript"><code class="lang-javascript"><strong>const accessToken = `&#x3C;ACCESS TOKEN>`
</strong>
fetch('https://public-api.expertfile.com/v2/organization/:corporation/expert/:username/course/:id', {
    method: 'GET',
    headers: {
        'Content-Type': 'application/x-www-form-urlencoded',
        'Authorization': `Bearer ${accessToken}`
    }
})
.then(response => response.json())
.then(json => {
    const { success, data } = json

    if (success) {
        const course = data;
        console.log('course', course)
    }

})
.catch(error => console.error(error));
</code></pre>

{% endtab %}

{% tab title="PHP" %}

```php
$accessToken = urlencode('<ACCESS TOKEN>');
$url = 'https://public-api.expertfile.com/v2/organization/:corporation/expert/:username/course/:id';

$ch = curl_init($url);
curl_setopt(
    $ch,
    CURLOPT_HTTPHEADER,
    array('Content-Type: application/x-www-form-urlencoded', 'Authorization: Bearer ' . $accessToken)
);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);

$response = curl_exec($ch);
$json = json_decode($response);

if($json->success){
    var_dump($json->data);
}

curl_close($ch);
```

{% endtab %}

{% tab title="Curl" %}

```
curl -X GET https://public-api.expertfile.com/v2/organization/:corporation/expert/:username/course/:id \
    -H "Content-Type: application/json" \
    -H "Authorization: Bearer <ACCESS TOKEN>"     
```

{% endtab %}
{% endtabs %}

## Create Course

<mark style="color:blue;">`POST`</mark>[ **/v2/organization/:corporation/expert/:username/course**](https://public-api.expertfile.com/v2/organization/:corporation/expert/:username/course/)

**Headers**

| Name          | Value              |
| ------------- | ------------------ |
| Content-Type  | `application/json` |
| Authorization | `Bearer <token>`   |

**Url**

<table><thead><tr><th width="339.3333333333333">Name</th><th>Type</th><th>Description</th></tr></thead><tbody><tr><td>corporation</td><td>number</td><td>Corporation ID</td></tr><tr><td>username</td><td>string</td><td>Unique username</td></tr></tbody></table>

**Body**

<table><thead><tr><th width="339.3333333333333">Name</th><th>Type</th><th>Description</th></tr></thead><tbody><tr><td>title<mark style="color:red;">*</mark></td><td>string</td><td>Course Title</td></tr><tr><td>details<mark style="color:red;">*</mark></td><td>string</td><td>Course Detail</td></tr><tr><td>url</td><td>string</td><td>Course Url</td></tr></tbody></table>

**Response**

{% tabs %}
{% tab title="200" %}

```json
{ 
    data: { 
        id: 1
    }, 
    success: true 
}
```

{% endtab %}
{% endtabs %}

Code

{% tabs %}
{% tab title="Node" %}

```javascript
const data = new URLSearchParams();
const accessToken = `<ACCESS TOKEN>`

data.append('title', 'Course title');
data.append('details', 'Course details...');
data.append('url', 'https://myurl.com');

fetch('https://public-api.expertfile.com/v2/organization/:corporation/expert/:username/course', {
    method: 'POST',
    headers: {
        'Content-Type': 'application/x-www-form-urlencoded',
        'Authorization': `Bearer ${accessToken}`
    },
    body: data
})
.then(response => response.json())
.then(json => {
    const { success, data, error } = json

    if (success) {
        const { id } = data
        console.log('New course id', id)
    }

})
.catch(error => console.error(error));
```

{% endtab %}

{% tab title="PHP" %}

```php
$accessToken = urlencode('<ACCESS TOKEN>');

$url = 'https://public-api.expertfile.com/v2/organization/:corporation/expert/:username/course';
$data = ['title' => 'Course title', 'details' => 'Course details...', 'url' => 'https://myurl.com'];

$ch = curl_init($url);
curl_setopt(
    $ch,
    CURLOPT_HTTPHEADER,
    array('Content-Type: application/x-www-form-urlencoded', 'Authorization: Bearer ' . $accessToken)
);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_POSTFIELDS, http_build_query($data));

$response = curl_exec($ch);
$json = json_decode($response);

if($json->success){
    var_dump($json->data);
}

curl_close($ch)
```

{% endtab %}

{% tab title="Curl" %}

```
curl -X POST https://public-api.expertfile.com/v2/organization/:corporation/expert/:username/course \
    -H "Content-Type: application/json" \
    -H "Authorization: Bearer <ACCESS TOKEN>" \
    -d '{"title": "Course title", "details": "Course details...", "url": "https://myurl.com"}'
```

{% endtab %}
{% endtabs %}

## Update Course

<mark style="color:blue;">`PUT`</mark> [**/v2/organization/:corporation/expert/:username/course/:id**](https://public-api.expertfile.com/v2/organization/:corporation/expert/:username/course/:id)

**Headers**

| Name          | Value              |
| ------------- | ------------------ |
| Content-Type  | `application/json` |
| Authorization | `Bearer <token>`   |

**Url**

<table><thead><tr><th width="339.3333333333333">Name</th><th>Type</th><th>Description</th></tr></thead><tbody><tr><td>corporation</td><td>number</td><td>Corporation ID</td></tr><tr><td>username</td><td>string</td><td>Unique username</td></tr><tr><td>id</td><td>number</td><td>Course ID</td></tr></tbody></table>

**Body**

<table><thead><tr><th width="339.3333333333333">Name</th><th>Type</th><th>Description</th></tr></thead><tbody><tr><td>title<mark style="color:red;">*</mark></td><td>string</td><td>Course Title</td></tr><tr><td>details<mark style="color:red;">*</mark></td><td>string</td><td>Course Detail</td></tr><tr><td>url</td><td>string</td><td>Course Url</td></tr></tbody></table>

**Response**

{% tabs %}
{% tab title="200" %}

```json
{ 
    data: { 
        id: 1, 
        updated: true 
    }, 
    success: true 
}
```

{% endtab %}
{% endtabs %}

Code

{% tabs %}
{% tab title="Node" %}

```javascript
const data = new URLSearchParams();
const accessToken = `<ACCESS TOKEN>`

data.append('title', 'Course title');
data.append('details', 'Course details...');
data.append('url', 'https://myurl.com');

fetch('https://public-api.expertfile.com/v2/organization/:corporation/expert/:username/course/:id', {
    method: 'PUT',
    headers: {
        'Content-Type': 'application/x-www-form-urlencoded',
        'Authorization': `Bearer ${accessToken}`
    },
    body: data
})
.then(response => response.json())
.then(json => {
    const { success, data, error } = json

    if (success) {
        const { id } = data
        console.log('New patent id', id)
    }

})
.catch(error => console.error(error));

```

{% endtab %}

{% tab title="PHP" %}

```php
$accessToken = urlencode('<ACCESS TOKEN>');

$url = 'https://public-api.expertfile.com/v2/organization/:corporation/expert/:username/course/:id';
$data = ['title' => 'Course title', 'details' => 'Course details...', 'url' => 'https://myurl.com'];

$ch = curl_init($url);
curl_setopt(
    $ch,
    CURLOPT_HTTPHEADER,
    array('Content-Type: application/x-www-form-urlencoded', 'Authorization: Bearer ' . $accessToken)
);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_PUT, http_build_query($data));

$response = curl_exec($ch);
$json = json_decode($response);

if($json->success){
    var_dump($json->data);
}

curl_close($ch)
```

{% endtab %}

{% tab title="Curl" %}

```
curl -X PUT https://public-api.expertfile.com/v2/organization/:corporation/expert/:username/course/:id \
    -H "Content-Type: application/json" \
    -H "Authorization: Bearer <ACCESS TOKEN>" \
    -d '{"title": "Course title", "details": "Course details...", "url": "https://myurl.com"}'
```

{% endtab %}
{% endtabs %}

## Delete Course

<mark style="color:red;">`DELETE`</mark> [**/v2/organization/:corporation/expert/:username/course/:id**](https://public-api.expertfile.com/v2/organization/:corporation/expert/:username/course/:id)

**Headers**

| Name          | Value              |
| ------------- | ------------------ |
| Content-Type  | `application/json` |
| Authorization | `Bearer <token>`   |

**Url**

<table><thead><tr><th width="339.3333333333333">Name</th><th>Type</th><th>Description</th></tr></thead><tbody><tr><td>corporation</td><td>number</td><td>Corporation ID</td></tr><tr><td>username</td><td>string</td><td>Unique username</td></tr><tr><td>id</td><td>number</td><td>Course ID</td></tr></tbody></table>

**Response**

{% tabs %}
{% tab title="200" %}

```json
{ 
    data: { 
        deleted: true, 
        id: 1 
    }, 
    success: true 
}
```

{% endtab %}
{% endtabs %}

Code

{% tabs %}
{% tab title="Node" %}

```javascript
const accessToken = `<ACCESS TOKEN>`

fetch('https://public-api.expertfile.com/v2/organization/:corporation/expert/:username/course/:id', {
    method: 'DELETE',
    headers: {
        'Content-Type': 'application/x-www-form-urlencoded',
        'Authorization': `Bearer ${accessToken}`
    }
})
.then(response => response.json())
.then(json => {
    const { success, data, error } = json

    if (success) {
        const { id } = data
        console.log('Deleted course id', id)
    }

})
.catch(error => console.error(error));

```

{% endtab %}

{% tab title="PHP" %}

```php
$accessToken = urlencode('<ACCESS TOKEN>');

$url = 'https://public-api.expertfile.com/v2/organization/:corporation/expert/:username/course/:id';

$ch = curl_init($url);
curl_setopt(
    $ch,
    CURLOPT_HTTPHEADER,
    array('Content-Type: application/x-www-form-urlencoded', 'Authorization: Bearer ' . $accessToken)
);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_CUSTOMREQUEST, "DELETE");

$response = curl_exec($ch);
$json = json_decode($response);

if($json->success){
    var_dump($json->data);
}

curl_close($ch);
```

{% endtab %}

{% tab title="Curl" %}

```
curl -X DELETE https://public-api.expertfile.com/v2/organization/:corporation/expert/:username/course/:id \
    -H "Content-Type: application/json" \
    -H "Authorization: Bearer <ACCESS TOKEN>"
```

{% endtab %}
{% endtabs %}


# Education

CRUD endpoints for a user's education

{% hint style="info" %}
Please note that in all urls & code samples you'll need to replace`:username` and `:corporation` with appropriate values
{% endhint %}

## Get All Education

<mark style="color:green;">`GET`</mark> [**/v2/organization/:corporation/expert/:username/education**](https://public-api.expertfile.com/v2/organization/:corporation/expert/:username/education)

**Headers**

| Name          | Value              |
| ------------- | ------------------ |
| Content-Type  | `application/json` |
| Authorization | `Bearer <token>`   |

**Url**

<table><thead><tr><th width="339.3333333333333">Name</th><th>Type</th><th>Description</th></tr></thead><tbody><tr><td>corporation</td><td>number</td><td>Corporation ID</td></tr><tr><td>username</td><td>string</td><td>Unique username</td></tr></tbody></table>

**Response**

{% tabs %}
{% tab title="200" %}

```json
 {
  data: [
    {
      id: 1,
      institution: "Instituion Name",
      degree: 'Degree Name',
      description: 'Description',
      major: 'Major',
      date: 2000
    },
  ],
  success: true
}
```

{% endtab %}
{% endtabs %}

Code

{% tabs %}
{% tab title="Node" %}

```javascript
const accessToken = `<ACCESS CODE>`

fetch('https://public-api.expertfile.com/v2/organization/:corporation/expert/:username/education', {
    method: 'GET',
    headers: {
        'Content-Type': 'application/x-www-form-urlencoded',
        'Authorization': `Bearer ${accessToken}`
    }
})
.then(response => response.json())
.then(json => {
    const { success, data } = json

    if (success) {
        const education = data;
        console.log('all education', education)
    }

})
.catch(error => console.error(error));
```

{% endtab %}

{% tab title="PHP" %}

```php
$accessToken = urlencode('<ACCESS TOKEN>');
$url = 'https://public-api.expertfile.com/v2/organization/:corporation/expert/:username/education';

$ch = curl_init($url);
curl_setopt(
    $ch,
    CURLOPT_HTTPHEADER,
    array('Content-Type: application/x-www-form-urlencoded', 'Authorization: Bearer ' . $accessToken)
);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);

$response = curl_exec($ch);
$json = json_decode($response);

if($json->success){
    var_dump($json->data);
}

curl_close($ch);

```

{% endtab %}

{% tab title="Curl" %}

```
curl https://public-api.expertfile.com/v2/organization/:corporation/expert/:username/education \
    -H "Content-Type: application/json" \
    -H "Authorization: Bearer <ACCESS TOKEN>"
```

{% endtab %}
{% endtabs %}

## Get Individual Education

<mark style="color:green;">`GET`</mark> [**/v2/organization/:corporation/expert/:username/education/:id**](https://public-api.expertfile.com/v2/organization/:corporation/expert/:username/education)

**Headers**

| Name          | Value              |
| ------------- | ------------------ |
| Content-Type  | `application/json` |
| Authorization | `Bearer <token>`   |

**Url**

<table><thead><tr><th width="339.3333333333333">Name</th><th>Type</th><th>Description</th></tr></thead><tbody><tr><td>corporation</td><td>number</td><td>Corporation ID</td></tr><tr><td>username</td><td>string</td><td>Unique username</td></tr><tr><td>id</td><td>number</td><td>Education ID</td></tr></tbody></table>

**Response**

{% tabs %}
{% tab title="200" %}

```json
 {
  data: [
    {
      id: 1,
      institution: "Instituion Name",
      degree: 'Degree Name',
      description: 'Description',
      major: 'Major',
      date: 2000
    },
  ],
  success: true
}
```

{% endtab %}
{% endtabs %}

Code

{% tabs %}
{% tab title="Node" %}

```javascript
const accessToken = `<ACCESS CODE>`

fetch('https://public-api.expertfile.com/v2/organization/:corporation/expert/:username/education/:id', {
    method: 'GET',
    headers: {
        'Content-Type': 'application/x-www-form-urlencoded',
        'Authorization': `Bearer ${accessToken}`
    }
})
.then(response => response.json())
.then(json => {
    const { success, data, error } = json

    if (success) {
        console.log('education', data)
    }

})
.catch(error => console.error(error));
```

{% endtab %}

{% tab title="PHP" %}

```php
$accessToken = urlencode('<ACCESS TOKEN>');
$url = 'https://public-api.expertfile.com/v2/organization/:corporation/expert/:username/education/:id';

$ch = curl_init($url);
curl_setopt(
    $ch,
    CURLOPT_HTTPHEADER,
    array('Content-Type: application/x-www-form-urlencoded', 'Authorization: Bearer ' . $accessToken)
);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);

$response = curl_exec($ch);
$json = json_decode($response);

if($json->success){
    var_dump($json->data);
}

curl_close($ch);
```

{% endtab %}

{% tab title="Curl" %}

```
curl -X GET https://public-api.expertfile.com/v2/organization/:corporation/expert/:username/education/:id \
    -H "Content-Type: application/json" \
    -H "Authorization: Bearer <ACCESS TOKEN>"     
```

{% endtab %}
{% endtabs %}

## Create Education

<mark style="color:blue;">`POST`</mark> [**/v2/organization/:corporation/expert/:username/education**](https://public-api.expertfile.com/v2/organization/:corporation/expert/:username/education)

**Headers**

| Name          | Value              |
| ------------- | ------------------ |
| Content-Type  | `application/json` |
| Authorization | `Bearer <token>`   |

**Url**

<table><thead><tr><th width="339.3333333333333">Name</th><th>Type</th><th>Description</th></tr></thead><tbody><tr><td>corporation</td><td>number</td><td>Corporation ID</td></tr><tr><td>username</td><td>string</td><td>Unique username</td></tr></tbody></table>

**Body**

<table><thead><tr><th width="339.3333333333333">Name</th><th>Type</th><th>Description</th></tr></thead><tbody><tr><td>institution<mark style="color:red;">*</mark></td><td>string</td><td>Institution Name</td></tr><tr><td>degree<mark style="color:red;">*</mark></td><td>string</td><td>Degree Name</td></tr><tr><td>major</td><td>string</td><td>Major</td></tr><tr><td>description</td><td>string</td><td>Description</td></tr><tr><td>date</td><td>string</td><td>Graduation date(i.e. '2004')</td></tr></tbody></table>

**Response**

{% tabs %}
{% tab title="200" %}

```json
{ 
    data: { 
        id: 1
    }, 
    success: true 
}
```

{% endtab %}
{% endtabs %}

Code

{% tabs %}
{% tab title="Node" %}

```javascript
const data = new URLSearchParams();
const accessToken = `<ACCESS TOKEN>`

data.append('institution', 'University Name');
data.append('degree', 'BSc.');
data.append('major', 'Mathematics');
data.append('description', 'Some additional info. on my degree')
data.append('date', '2004')

fetch('https://public-api.expertfile.com/v2/organization/:corporation/expert/:username/education', {
    method: 'POST',
    headers: {
        'Content-Type': 'application/x-www-form-urlencoded',
        'Authorization': `Bearer ${accessToken}`
    },
    body: data
})
.then(response => response.json())
.then(json => {
    const { success, data, error } = json

    if (success) {
        const { id } = data
        console.log('New education id', id)
    }

})
.catch(error => console.error(error));
```

{% endtab %}

{% tab title="PHP" %}

```php
$accessToken = urlencode('<ACCESS TOKEN>');

$url = 'https://public-api.expertfile.com/v2/organization/:corporation/expert/:username/education';
$data = ['institution' => 'University Name', 'degree' => 'BSc.', 'major' => 'Mathematics', 'description' => 'Some additional info. on my degree', 'date' => '2004'];

$ch = curl_init($url);
curl_setopt(
    $ch,
    CURLOPT_HTTPHEADER,
    array('Content-Type: application/x-www-form-urlencoded', 'Authorization: Bearer ' . $accessToken)
);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_POSTFIELDS, http_build_query($data));

$response = curl_exec($ch);
$json = json_decode($response);

if($json->success){
    var_dump($json->data);
}

curl_close($ch)
```

{% endtab %}

{% tab title="Curl" %}

```
curl -X POST https://public-api.expertfile.com/v2/organization/:corporation/expert/:username/education \
    -H "Content-Type: application/json" \
    -H "Authorization: Bearer <ACCESS TOKEN>" \
    -d '{"institution": "University Name", "degree": "BSc.", "major": "Mathematics", "description": "Some additional info. on my degree", "date":  "2004"}'
```

{% endtab %}
{% endtabs %}

## Update Education

<mark style="color:blue;">`PUT`</mark> [**/v2/organization/:corporation/expert/:username/education/:id**](https://public-api.expertfile.com/v2/organization/:corporation/expert/:username/education/:id)

**Headers**

| Name          | Value              |
| ------------- | ------------------ |
| Content-Type  | `application/json` |
| Authorization | `Bearer <token>`   |

**Url**

<table><thead><tr><th width="339.3333333333333">Name</th><th>Type</th><th>Description</th></tr></thead><tbody><tr><td>corporation</td><td>number</td><td>Corporation ID</td></tr><tr><td>username</td><td>string</td><td>Unique username</td></tr><tr><td>id</td><td>number</td><td>Education ID</td></tr></tbody></table>

**Body**

<table><thead><tr><th width="339.3333333333333">Name</th><th>Type</th><th>Description</th></tr></thead><tbody><tr><td>institution<mark style="color:red;">*</mark></td><td>string</td><td>Institution Name</td></tr><tr><td>degree<mark style="color:red;">*</mark></td><td>string</td><td>Degree Name</td></tr><tr><td>major</td><td>string</td><td>Major</td></tr><tr><td>description</td><td>string</td><td>Description</td></tr><tr><td>date</td><td>string</td><td>Graduation date(i.e. '2004')</td></tr></tbody></table>

**Response**

{% tabs %}
{% tab title="200" %}

```json
{ 
    data: { 
        id: 1, 
        updated: true 
    }, 
    success: true 
}
```

{% endtab %}
{% endtabs %}

Code

{% tabs %}
{% tab title="Node" %}

```javascript
const data = new URLSearchParams();
const accessToken = `<ACCESS TOKEN>`

data.append('institution', 'University Name');
data.append('degree', 'BSc.');
data.append('major', 'Mathematics');
data.append('description', 'Some additional info. on my degree')
data.append('date', '2004')

fetch('https://public-api.expertfile.com/v2/organization/:corporation/expert/:username/education/:id', {
    method: 'PUT',
    headers: {
        'Content-Type': 'application/x-www-form-urlencoded',
        'Authorization': `Bearer ${accessToken}`
    },
    body: data
})
.then(response => response.json())
.then(json => {
    const { success, data, error } = json

    if (success) {
        const { id } = data
        console.log('New education id', id)
    }

})
.catch(error => console.error(error));

```

{% endtab %}

{% tab title="PHP" %}

```php
$accessToken = urlencode('<ACCESS TOKEN>');

$url = 'https://public-api.expertfile.com/v2/organization/:corporation/expert/:username/education/:id';
$data = ['institution' => 'University Name', 'degree' => 'BSc.', 'major' => 'Mathematics', 'description' => 'Some additional info. on my degree', 'date' => '2004'];

$ch = curl_init($url);
curl_setopt(
    $ch,
    CURLOPT_HTTPHEADER,
    array('Content-Type: application/x-www-form-urlencoded', 'Authorization: Bearer ' . $accessToken)
);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_PUT, http_build_query($data));

$response = curl_exec($ch);
$json = json_decode($response);

if($json->success){
    var_dump($json->data);
}

curl_close($ch)
```

{% endtab %}

{% tab title="Curl" %}

```
curl -X PUT https://public-api.expertfile.com/v2/organization/:corporation/expert/:username/education/:id \
    -H "Content-Type: application/json" \
    -H "Authorization: Bearer <ACCESS TOKEN>" \
    -d '{"institution": "University Name", "degree": "BSc.", "major": "Mathematics", "description": "Some additional info. on my degree", "date":  "2004"}'
```

{% endtab %}
{% endtabs %}

## Delete Education

<mark style="color:red;">`DELETE`</mark> [**/v2/organization/:corporation/expert/:username/education/:id**](https://public-api.expertfile.com/v2/organization/:corporation/expert/:username/education/:id)

**Headers**

| Name          | Value              |
| ------------- | ------------------ |
| Content-Type  | `application/json` |
| Authorization | `Bearer <token>`   |

**Url**

<table><thead><tr><th width="339.3333333333333">Name</th><th>Type</th><th>Description</th></tr></thead><tbody><tr><td>corporation</td><td>number</td><td>Corporation ID</td></tr><tr><td>username</td><td>string</td><td>Unique username</td></tr><tr><td>id</td><td>number</td><td>Education ID</td></tr></tbody></table>

**Response**

{% tabs %}
{% tab title="200" %}

```json
{ 
    data: { 
        deleted: true, 
        id: 1 
    }, 
    success: true 
}
```

{% endtab %}
{% endtabs %}

Code

{% tabs %}
{% tab title="Node" %}

```javascript
const accessToken = `<ACCESS TOKEN>`

fetch('https://public-api.expertfile.com/v2/organization/:corporation/expert/:username/education/:id', {
    method: 'DELETE',
    headers: {
        'Content-Type': 'application/x-www-form-urlencoded',
        'Authorization': `Bearer ${accessToken}`
    }
})
.then(response => response.json())
.then(json => {
    const { success, data, error } = json

    if (success) {
        const { id } = data
        console.log('Deleted education id', id)
    }

})
.catch(error => console.error(error));

```

{% endtab %}

{% tab title="PHP" %}

```php
$accessToken = urlencode('<ACCESS TOKEN>');

$url = 'https://public-api.expertfile.com/v2/organization/:corporation/expert/:username/education/:id';

$ch = curl_init($url);
curl_setopt(
    $ch,
    CURLOPT_HTTPHEADER,
    array('Content-Type: application/x-www-form-urlencoded', 'Authorization: Bearer ' . $accessToken)
);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_CUSTOMREQUEST, "DELETE");

$response = curl_exec($ch);
$json = json_decode($response);

if($json->success){
    var_dump($json->data);
}

curl_close($ch);
```

{% endtab %}

{% tab title="Curl" %}

```
curl -X DELETE https://public-api.expertfile.com/v2/organization/:corporation/expert/:username/education/:id \
    -H "Content-Type: application/json" \
    -H "Authorization: Bearer <ACCESS TOKEN>"
```

{% endtab %}
{% endtabs %}


# Event Appearances

CRUD endpoints for a user's event appearances

{% hint style="info" %}
Please note that in all urls & code samples you'll need to replace`:username` and `:corporation` with appropriate values
{% endhint %}

## Get All Event Appearances

<mark style="color:green;">`GET`</mark> [**/v2/organization/:corporation/expert/:username/eventappearance**](https://public-api.expertfile.com/v2/organization/:corporation/expert/:username/eventappearance)

**Headers**

| Name          | Value              |
| ------------- | ------------------ |
| Content-Type  | `application/json` |
| Authorization | `Bearer <token>`   |

**Url**

<table><thead><tr><th width="339.3333333333333">Name</th><th>Type</th><th>Description</th></tr></thead><tbody><tr><td>corporation</td><td>number</td><td>Corporation ID</td></tr><tr><td>username</td><td>string</td><td>Unique username</td></tr></tbody></table>

**Response**

{% tabs %}
{% tab title="200" %}

```json
 {
  data: [
    {
      id: 1,
      title: 'Event Title',
      event_name: 'Event Name',
      location: 'Event Location',
      date: 0
    },
  ],
  success: true
}
```

{% endtab %}
{% endtabs %}

Code

{% tabs %}
{% tab title="Node" %}

```javascript
const accessToken = `<ACCESS CODE>`

fetch('https://public-api.expertfile.com/v2/organization/:corporation/expert/:username/eventappearance', {
    method: 'GET',
    headers: {
        'Content-Type': 'application/x-www-form-urlencoded',
        'Authorization': `Bearer ${accessToken}`
    }
})
.then(response => response.json())
.then(json => {
    const { success, data } = json

    if (success) {
        const events = data;
        console.log('all events', events)
    }

})
.catch(error => console.error(error));
```

{% endtab %}

{% tab title="PHP" %}

```php
$accessToken = urlencode('<ACCESS TOKEN>');
$url = 'https://public-api.expertfile.com/v2/organization/:corporation/expert/:username/eventappearance';

$ch = curl_init($url);
curl_setopt(
    $ch,
    CURLOPT_HTTPHEADER,
    array('Content-Type: application/x-www-form-urlencoded', 'Authorization: Bearer ' . $accessToken)
);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);

$response = curl_exec($ch);
$json = json_decode($response);

if($json->success){
    var_dump($json->data);
}

curl_close($ch);

```

{% endtab %}

{% tab title="Curl" %}

```
curl https://public-api.expertfile.com/v2/organization/:corporation/expert/:username/eventappearance \
    -H "Content-Type: application/json" \
    -H "Authorization: Bearer <ACCESS TOKEN>"
```

{% endtab %}
{% endtabs %}

## Get Individual Event Appearances

<mark style="color:green;">`GET`</mark> [**/v2/organization/:corporation/expert/:username/eventappearance/:id**](https://public-api.expertfile.com/v2/organization/:corporation/expert/:username/eventappearance)

**Headers**

| Name          | Value              |
| ------------- | ------------------ |
| Content-Type  | `application/json` |
| Authorization | `Bearer <token>`   |

**Url**

<table><thead><tr><th width="339.3333333333333">Name</th><th>Type</th><th>Description</th></tr></thead><tbody><tr><td>corporation</td><td>number</td><td>Corporation ID</td></tr><tr><td>username</td><td>string</td><td>Unique username</td></tr><tr><td>id</td><td>number</td><td>Event Appearance ID</td></tr></tbody></table>

**Response**

{% tabs %}
{% tab title="200" %}

```json
 {
  data: [
    {
      id: 1,
      title: 'Event Title',
      event_name: 'Event Name',
      location: 'Event Location',
      date: 0
    },
  ],
  success: true
}
```

{% endtab %}
{% endtabs %}

Code

{% tabs %}
{% tab title="Node" %}

```javascript
const accessToken = `<ACCESS CODE>`

fetch('https://public-api.expertfile.com/v2/organization/:corporation/expert/:username/eventappearance/:id', {
    method: 'GET',
    headers: {
        'Content-Type': 'application/x-www-form-urlencoded',
        'Authorization': `Bearer ${accessToken}`
    }
})
.then(response => response.json())
.then(json => {
    const { success, data, error } = json

    if (success) {
        console.log('event', data)
    }

})
.catch(error => console.error(error));
```

{% endtab %}

{% tab title="PHP" %}

```php
$accessToken = urlencode('<ACCESS TOKEN>');
$url = 'https://public-api.expertfile.com/v2/organization/:corporation/expert/:username/eventappearance/:id';

$ch = curl_init($url);
curl_setopt(
    $ch,
    CURLOPT_HTTPHEADER,
    array('Content-Type: application/x-www-form-urlencoded', 'Authorization: Bearer ' . $accessToken)
);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);

$response = curl_exec($ch);
$json = json_decode($response);

if($json->success){
    var_dump($json->data);
}

curl_close($ch);
```

{% endtab %}

{% tab title="Curl" %}

```
curl -X GET https://public-api.expertfile.com/v2/organization/:corporation/expert/:username/eventappearance/:id \
    -H "Content-Type: application/json" \
    -H "Authorization: Bearer <ACCESS TOKEN>"     
```

{% endtab %}
{% endtabs %}

## Create Event Appearances

<mark style="color:blue;">`POST`</mark>[ **/v2/organization/:corporation/expert/:username/eventappearance**](https://public-api.expertfile.com/v2/organization/:corporation/expert/:username/eventappearance)

**Headers**

| Name          | Value              |
| ------------- | ------------------ |
| Content-Type  | `application/json` |
| Authorization | `Bearer <token>`   |

**Url**

<table><thead><tr><th width="339.3333333333333">Name</th><th>Type</th><th>Description</th></tr></thead><tbody><tr><td>corporation</td><td>number</td><td>Corporation ID</td></tr><tr><td>username</td><td>string</td><td>Unique username</td></tr></tbody></table>

**Body**

<table><thead><tr><th width="339.3333333333333">Name</th><th>Type</th><th>Description</th></tr></thead><tbody><tr><td>title<mark style="color:red;">*</mark></td><td>string</td><td>Event Title</td></tr><tr><td>event_name<mark style="color:red;">*</mark></td><td>string</td><td>Event Name</td></tr><tr><td>location</td><td>string</td><td>Event Location</td></tr><tr><td>date</td><td>unix timestamp</td><td>Event Date</td></tr></tbody></table>

**Response**

{% tabs %}
{% tab title="200" %}

```json
{ 
    data: { 
        id: 1
    }, 
    success: true 
}
```

{% endtab %}
{% endtabs %}

Code

{% tabs %}
{% tab title="Node" %}

```javascript
const data = new URLSearchParams();
const accessToken = `<ACCESS CODE>`

data.append('title', 'My Event Title');
data.append('event_name', 'My Event Name...');
data.append('location', 'My Event Location');
data.append('date', 1341892800);

fetch('https://public-api.expertfile.com/v2/organization/:corporation/expert/:username/eventappearance', {
    method: 'POST',
    headers: {
        'Content-Type': 'application/x-www-form-urlencoded',
        'Authorization': `Bearer ${accessToken}`
    },
    body: data
})
.then(response => response.json())
.then(json => {
    const { success, data, error } = json

    if (success) {
        const { id } = data
        console.log('New event id', id)
    }

})
.catch(error => console.error(error));
```

{% endtab %}

{% tab title="PHP" %}

<pre class="language-php"><code class="lang-php">$accessToken = urlencode('&#x3C;ACCESS TOKEN>');

$url = 'https://public-api.expertfile.com/v2/organization/:corporation/expert/:username/eventappearance';
<strong>$data = ['title' => 'My Event Title', 'event_name' => 'My Event Name...', 'location' => 'My Event Location', 'date' => 1341892800];
</strong>
$ch = curl_init($url);
curl_setopt(
    $ch,
    CURLOPT_HTTPHEADER,
    array('Content-Type: application/x-www-form-urlencoded', 'Authorization: Bearer ' . $accessToken)
);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_POSTFIELDS, http_build_query($data));

$response = curl_exec($ch);
$json = json_decode($response);

if($json->success){
    var_dump($json->data);
}

curl_close($ch);
</code></pre>

{% endtab %}

{% tab title="Curl" %}

```
curl -X POST https://public-api.expertfile.com/v2/organization/:corporation/expert/:username/eventappearance \
    -H "Content-Type: application/json" \
    -H "Authorization: Bearer <ACCESS TOKEN>" \
    -d '{"title":"My Event Title", "event_name":"My Event Name...", "location":"My Event Location", "date":  1341892800}'

```

{% endtab %}
{% endtabs %}

## Update Event Appearances

<mark style="color:blue;">`PUT`</mark> [**/v2/organization/:corporation/expert/:username/eventappearance/:id**](https://public-api.expertfile.com/v2/organization/:corporation/expert/:username/eventappearance/:id)

**Headers**

| Name          | Value              |
| ------------- | ------------------ |
| Content-Type  | `application/json` |
| Authorization | `Bearer <token>`   |

**Url**

<table><thead><tr><th width="339.3333333333333">Name</th><th>Type</th><th>Description</th></tr></thead><tbody><tr><td>corporation</td><td>number</td><td>Corporation ID</td></tr><tr><td>username</td><td>string</td><td>Unique username</td></tr><tr><td>id</td><td>number</td><td>Event ID</td></tr></tbody></table>

**Body**

<table><thead><tr><th width="339.3333333333333">Name</th><th>Type</th><th>Description</th></tr></thead><tbody><tr><td>title<mark style="color:red;">*</mark></td><td>string</td><td>Event Title</td></tr><tr><td>event_name<mark style="color:red;">*</mark></td><td>string</td><td>Event Name</td></tr><tr><td>location</td><td>string</td><td>Event Location</td></tr><tr><td>date</td><td>unix timestamp</td><td>Event Date</td></tr></tbody></table>

**Response**

{% tabs %}
{% tab title="200" %}

```json
{ 
    data: { 
        id: 1, 
        updated: true 
    }, 
    success: true 
}
```

{% endtab %}
{% endtabs %}

Code

{% tabs %}
{% tab title="Node" %}

```javascript
const data = new URLSearchParams();
const accessToken = `<ACCESS CODE>`

data.append('title', 'My Event Title');
data.append('event_name', 'My Event Name...');
data.append('location', 'My Event Location');
data.append('date', 1341892800);

fetch('https://public-api.expertfile.com/v2/organization/:corporation/expert/:username/eventappearance/:id', {
    method: 'PUT',
    headers: {
        'Content-Type': 'application/x-www-form-urlencoded',
        'Authorization': `Bearer ${accessToken}`
    },
    body: data
})
.then(response => response.json())
.then(json => {
    const { success, data, error } = json

    if (success) {
        const { id } = data
        console.log('Updated event id', id)
    }

})
.catch(error => console.error(error));

```

{% endtab %}

{% tab title="PHP" %}

```php
$accessToken = urlencode('<ACCESS TOKEN>');

$url = 'https://public-api.expertfile.com/v2/organization/:corporation/expert/:username/eventappearance/:id';
$data = ['title' => 'My Event Title', 'event_name' => 'My Event Name...', 'location' => 'My Event Location', 'date' => 1341892800];

$ch = curl_init($url);
curl_setopt(
    $ch,
    CURLOPT_HTTPHEADER,
    array('Content-Type: application/x-www-form-urlencoded', 'Authorization: Bearer ' . $accessToken)
);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_PUT, http_build_query($data));

$response = curl_exec($ch);
$json = json_decode($response);

if($json->success){
    var_dump($json->data);
}

curl_close($ch);
```

{% endtab %}

{% tab title="Curl" %}

```
curl -X PUT https://public-api.expertfile.com/v2/organization/:corporation/expert/:username/eventappearance/:id \
    -H "Content-Type: application/json" \
    -H "Authorization: Bearer <ACCESS TOKEN>" \
    -d '{"title":"My Event Title", "event_name":"My Event Name...", "location":"My Event Location", "date":  1341892800}'
```

{% endtab %}
{% endtabs %}

## Delete Event Appearances

<mark style="color:red;">`DELETE`</mark> [**/v2/organization/:corporation/expert/:username/eventappearance/:id**](https://public-api.expertfile.com/v2/organization/:corporation/expert/:username/eventappearance/:id)

**Headers**

| Name          | Value              |
| ------------- | ------------------ |
| Content-Type  | `application/json` |
| Authorization | `Bearer <token>`   |

**Url**

<table><thead><tr><th width="339.3333333333333">Name</th><th>Type</th><th>Description</th></tr></thead><tbody><tr><td>corporation</td><td>number</td><td>Corporation ID</td></tr><tr><td>username</td><td>string</td><td>Unique username</td></tr><tr><td>id</td><td>number</td><td>Event ID</td></tr></tbody></table>

**Response**

{% tabs %}
{% tab title="200" %}

```json
{ 
    data: { 
        deleted: true, 
        id: 1 
    }, 
    success: true 
}
```

{% endtab %}
{% endtabs %}

Code

{% tabs %}
{% tab title="Node" %}

```javascript
const accessToken = `<ACCESS TOKEN>`

fetch('https://public-api.expertfile.com/v2/organization/:corporation/expert/:username/eventappearance/:id', {
    method: 'DELETE',
    headers: {
        'Content-Type': 'application/x-www-form-urlencoded',
        'Authorization': `Bearer ${accessToken}`
    }
})
.then(response => response.json())
.then(json => {
    const { success, data, error } = json

    if (success) {
        const { id } = data
        console.log('Deleted event id', id)
    }

})
.catch(error => console.error(error));

```

{% endtab %}

{% tab title="PHP" %}

```php
$accessToken = urlencode('<ACCESS TOKEN>');

$url = 'https://public-api.expertfile.com/v2/organization/:corporation/expert/:username/eventappearance/:id';

$ch = curl_init($url);
curl_setopt(
    $ch,
    CURLOPT_HTTPHEADER,
    array('Content-Type: application/x-www-form-urlencoded', 'Authorization: Bearer ' . $accessToken)
);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_CUSTOMREQUEST, "DELETE");

$response = curl_exec($ch);
$json = json_decode($response);

if($json->success){
    var_dump($json->data);
}

curl_close($ch);
```

{% endtab %}

{% tab title="Curl" %}

```
curl -X DELETE https://public-api.expertfile.com/v2/organization/:corporation/expert/:username/eventappearance/:id \
    -H "Content-Type: application/json" \
    -H "Authorization: Bearer <ACCESS TOKEN>"
```

{% endtab %}
{% endtabs %}


# Fees

Get or create/update the a user's fees

{% hint style="info" %}
Please note that in all urls & code samples you'll need to replace`:username` and `:corporation` with appropriate values
{% endhint %}

## Get Fees

<mark style="color:green;">`GET`</mark> [**/v2/organization/:corporation/expert/:username/fee**](https://public-api.expertfile.com/v2/organization/:corporation/expert/:username/fee)

**Headers**

| Name          | Value              |
| ------------- | ------------------ |
| Content-Type  | `application/json` |
| Authorization | `Bearer <token>`   |

**Url**

<table><thead><tr><th width="339.3333333333333">Name</th><th>Type</th><th>Description</th></tr></thead><tbody><tr><td>corporation</td><td>number</td><td>Corporation ID</td></tr><tr><td>username</td><td>string</td><td>Unique username</td></tr></tbody></table>

**Response**

{% tabs %}
{% tab title="200" %}

```json
 {
  data: [
    { 
      fee_min: 1000, 
      fee_max: 8000
   }
  ],
  success: true
}
```

{% endtab %}
{% endtabs %}

Code

{% tabs %}
{% tab title="Node" %}

```javascript
const accessToken = `<ACCESS TOKEN>`

fetch('https://public-api.expertfile.com/v2/organization/:corporation/expert/:username/fee', {
    method: 'GET',
    headers: {
        'Content-Type': 'application/x-www-form-urlencoded',
        'Authorization': `Bearer ${accessToken}`
    }
})
.then(response => response.json())
.then(json => {
    const { success, data } = json

    if (success) {
        const fee = data[0]
        console.log('fee', fee)
    }

})
.catch(error => console.error(error));
```

{% endtab %}

{% tab title="PHP" %}

```php
$accessToken = urlencode('<ACCESS TOKEN>');
$url = 'https://public-api.expertfile.com/v2/organization/:corporation/expert/:username/fee';

$ch = curl_init($url);
curl_setopt(
    $ch,
    CURLOPT_HTTPHEADER,
    array('Content-Type: application/x-www-form-urlencoded', 'Authorization: Bearer ' . $accessToken)
);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);

$response = curl_exec($ch);
$json = json_decode($response);

if($json->success){
    echo $json->data[0]->availability;
}

curl_close($ch);
```

{% endtab %}

{% tab title="Curl" %}

```
curl https://public-api.expertfile.com/v2/organization/:corporation/expert/:username/fee \
    -H "Content-Type: application/json" \
    -H "Authorization: Bearer <ACCESS TOKEN>"

```

{% endtab %}
{% endtabs %}

## Update Fees

<mark style="color:blue;">`POST`</mark>[ **/v2/organization/:corporation/expert/:username/fee**](https://public-api.expertfile.com/v2/organization/:corporation/expert/:username/fee)

**Headers**

| Name          | Value              |
| ------------- | ------------------ |
| Content-Type  | `application/json` |
| Authorization | `Bearer <token>`   |

**Url**

<table><thead><tr><th width="339.3333333333333">Name</th><th>Type</th><th>Description</th></tr></thead><tbody><tr><td>corporation</td><td>number</td><td>Corporation ID</td></tr><tr><td>username</td><td>string</td><td>Unique username</td></tr></tbody></table>

**Body**

<table><thead><tr><th>Name</th><th width="249">Type</th><th>Description</th></tr></thead><tbody><tr><td>fee_min<mark style="color:red;">*</mark></td><td>number</td><td>Min. fee</td></tr><tr><td>fee_max<mark style="color:red;">*</mark></td><td>number</td><td>Max. fee</td></tr></tbody></table>

**Response**

{% tabs %}
{% tab title="200" %}

```json
{ 
    data: { 
        id: null 
    }, 
    success: true 
}
```

{% endtab %}
{% endtabs %}

Code

{% tabs %}
{% tab title="Node" %}

```javascript
const data = new URLSearchParams();
const accessToken = `<ACCESS TOKEN>`

data.append('fee_min', 1000)
data.append('fee_max', 3000)

fetch('https://public-api.expertfile.com/v2/organization/:corporation/expert/:username/fee', {
    method: 'POST',
    headers: {
        'Content-Type': 'application/x-www-form-urlencoded',
        'Authorization': `Bearer ${accessToken}`
    },
    body: data
})
.then(response => response.json())
.then(json => {
    const { success, data } = json

})
.catch(error => console.error(error));

```

{% endtab %}

{% tab title="PHP" %}

```php
$accessToken = urlencode('<ACCESS TOKEN>');

$url = 'https://public-api.expertfile.com/v2/organization/:corporation/expert/:username/fee';
$data = ['fee_min' => 1000, 'fee_max' => 3000];

$ch = curl_init($url);
curl_setopt(
    $ch,
    CURLOPT_HTTPHEADER,
    array('Content-Type: application/x-www-form-urlencoded', 'Authorization: Bearer ' . $accessToken)
);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_POSTFIELDS, http_build_query($data));

$response = curl_exec($ch);
$json = json_decode($response);

if($json->success){
    var_dump($json->data);
}

curl_close($ch);
```

{% endtab %}

{% tab title="Curl" %}

```
curl -X POST https://public-api.expertfile.com/v2/organization/:corporation/expert/:username/fee \
    -H "Content-Type: application/json" \
    -H "Authorization: Bearer <ACCESS TOKEN>" \
    -d '{"fee_min": 1000, "fee_max": 3000}'
```

{% endtab %}
{% endtabs %}


# Industries

CRUD endpoints for a user's industries

{% hint style="info" %}
Please note that in all urls & code samples you'll need to replace`:username` and `:corporation` with appropriate values
{% endhint %}

## Get All Industries

<mark style="color:green;">`GET`</mark> [**/v2/organization/:corporation/expert/:username/industry**](https://public-api.expertfile.com/v2/organization/:corporation/expert/:username/industry/)

**Headers**

| Name          | Value              |
| ------------- | ------------------ |
| Content-Type  | `application/json` |
| Authorization | `Bearer <token>`   |

**Url**

<table><thead><tr><th width="339.3333333333333">Name</th><th>Type</th><th>Description</th></tr></thead><tbody><tr><td>corporation</td><td>number</td><td>Corporation ID</td></tr><tr><td>username</td><td>string</td><td>Unique username</td></tr></tbody></table>

**Response**

{% tabs %}
{% tab title="200" %}

```json
 {
  data: [
    {
      id: 1,
      name: "industry name"
    }
  ],
  success: true
}
```

{% endtab %}
{% endtabs %}

Code

{% tabs %}
{% tab title="Node" %}

```javascript
const accessToken = `<ACCESS TOKEN>`

fetch('https://public-api.expertfile.com/v2/organization/:corporation/expert/:username/industry', {
    method: 'GET',
    headers: {
        'Content-Type': 'application/x-www-form-urlencoded',
        'Authorization': `Bearer ${accessToken}`
    }
})
.then(response => response.json())
.then(json => {
    const { success, data } = json

    if (success) {
        const industry = data
        console.log('industry', industry)
    }

})
.catch(error => console.error(error));
```

{% endtab %}

{% tab title="PHP" %}

```php
$accessToken = urlencode('<ACCESS TOKEN>');
$url = 'https://public-api.expertfile.com/v2/organization/:corporation/expert/:username/industry';

$ch = curl_init($url);
curl_setopt(
    $ch,
    CURLOPT_HTTPHEADER,
    array('Content-Type: application/x-www-form-urlencoded', 'Authorization: Bearer ' . $accessToken)
);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);

$response = curl_exec($ch);
$json = json_decode($response);

if($json->success){
    var_dump($json->data);
}

curl_close($ch);

```

{% endtab %}

{% tab title="Curl" %}

```
curl https://public-api.expertfile.com/v2/organization/:corporation/expert/:username/industry \
    -H "Content-Type: application/json" \
    -H "Authorization: Bearer <ACCESS TOKEN>"
```

{% endtab %}
{% endtabs %}

## Get Individual Industry

<mark style="color:green;">`GET`</mark> [**/v2/organization/:corporation/expert/:username/industry/:id**](https://public-api.expertfile.com/v2/organization/:corporation/expert/:username/industry/:id)

**Headers**

| Name          | Value              |
| ------------- | ------------------ |
| Content-Type  | `application/json` |
| Authorization | `Bearer <token>`   |

**Url**

<table><thead><tr><th width="339.3333333333333">Name</th><th>Type</th><th>Description</th></tr></thead><tbody><tr><td>corporation</td><td>number</td><td>Corporation ID</td></tr><tr><td>username</td><td>string</td><td>Unique username</td></tr><tr><td>id</td><td>number</td><td>Industry ID</td></tr></tbody></table>

**Response**

{% tabs %}
{% tab title="200" %}

```json
{
  data: [
    {
      id: 1,
      name: "industry name"
    }
  ],
  success: true
}
```

{% endtab %}
{% endtabs %}

Code

{% tabs %}
{% tab title="Node" %}

```javascript
const accessToken = `<ACCESS CODE>`

fetch('https://public-api.expertfile.com/v2/organization/:corporation/expert/:username/industry/:id', {
    method: 'GET',
    headers: {
        'Content-Type': 'application/x-www-form-urlencoded',
        'Authorization': `Bearer ${accessToken}`
    }
})
.then(response => response.json())
.then(json => {
    const { success, data } = json

    if (success) {
        const industry = data
        console.log('industry', industry[0])
    }

})
.catch(error => console.error(error));
```

{% endtab %}

{% tab title="PHP" %}

```php
$accessToken = urlencode('<ACCESS TOKEN>');
$url = 'https://public-api.expertfile.com/v2/organization/:corporation/expert/:username/industry/:id';

$ch = curl_init($url);
curl_setopt(
    $ch,
    CURLOPT_HTTPHEADER,
    array('Content-Type: application/x-www-form-urlencoded', 'Authorization: Bearer ' . $accessToken)
);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);

$response = curl_exec($ch);
$json = json_decode($response);

if($json->success){
    var_dump($json->data);
}

curl_close($ch);
```

{% endtab %}

{% tab title="Curl" %}

```
curl -X GET https://public-api.expertfile.com/v2/organization/:corporation/expert/:username/industry/:id \
    -H "Content-Type: application/json" \
    -H "Authorization: Bearer <ACCESS TOKEN>"     
```

{% endtab %}
{% endtabs %}

## Create Industry

<mark style="color:blue;">`POST`</mark> [**/v2/organization/:corporation/expert/:username/industry**](https://public-api.expertfile.com/v2/organization/:corporation/expert/:username/industry/)

**Headers**

| Name          | Value              |
| ------------- | ------------------ |
| Content-Type  | `application/json` |
| Authorization | `Bearer <token>`   |

**Url**

<table><thead><tr><th width="339.3333333333333">Name</th><th>Type</th><th>Description</th></tr></thead><tbody><tr><td>corporation</td><td>number</td><td>Corporation ID</td></tr><tr><td>username</td><td>string</td><td>Unique username</td></tr></tbody></table>

**Body**

<table><thead><tr><th width="339.3333333333333">Name</th><th>Type</th><th>Description</th></tr></thead><tbody><tr><td>name<mark style="color:red;">*</mark></td><td>string</td><td>Industry Name</td></tr></tbody></table>

**Response**

{% tabs %}
{% tab title="200" %}

```json
{ 
    data: { 
        id: 1
    }, 
    success: true 
}
```

{% endtab %}
{% endtabs %}

**Code**

{% tabs %}
{% tab title="Node" %}

```javascript
const data = new URLSearchParams();
const accessToken = `<ACCESS TOKEN>`

data.append('name', 'Computer Software');

fetch('https://public-api.expertfile.com/v2/organization/:corporation/expert/:username/industry', {
    method: 'POST',
    headers: {
        'Content-Type': 'application/x-www-form-urlencoded',
        'Authorization': `Bearer ${accessToken}`
    },
    body: data
})
.then(response => response.json())
.then(json => {
    const { success, data, error } = json

    if (success) {
        const { id } = data
        console.log('New industry id', id)
    }

})
.catch(error => console.error(error));

```

{% endtab %}

{% tab title="PHP" %}

```php
$accessToken = urlencode('<ACCESS TOKEN>');

$url = 'https://public-api.expertfile.com/v2/organization/:corporation/expert/:username/industry';
$data = ['name' => 'Computer Software'];

$ch = curl_init($url);
curl_setopt(
    $ch,
    CURLOPT_HTTPHEADER,
    array('Content-Type: application/x-www-form-urlencoded', 'Authorization: Bearer ' . $accessToken)
);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_POSTFIELDS, http_build_query($data));

$response = curl_exec($ch);
$json = json_decode($response);

if($json->success){
    var_dump($json->data);
}

curl_close($ch);
```

{% endtab %}

{% tab title="Curl" %}

```
curl -X POST https://public-api.expertfile.com/v2/organization/:corporation/expert/:username/industry \
    -H "Content-Type: application/json" \
    -H "Authorization: Bearer <ACCESS TOKEN>" \
    -d '{"name":"Computer Software"}'
```

{% endtab %}
{% endtabs %}

## Delete Industry

<mark style="color:red;">`DELETE`</mark>[**/v2/organization/:corporation/expert/:username/industry/:id**](https://public-api.expertfile.com/v2/organization/:corporation/expert/:username/industry/:id)

**Headers**

| Name          | Value              |
| ------------- | ------------------ |
| Content-Type  | `application/json` |
| Authorization | `Bearer <token>`   |

**Url**

<table><thead><tr><th width="339.3333333333333">Name</th><th>Type</th><th>Description</th></tr></thead><tbody><tr><td>corporation</td><td>number</td><td>Corporation ID</td></tr><tr><td>username</td><td>string</td><td>Unique username</td></tr><tr><td>id</td><td>number</td><td>Industry ID</td></tr></tbody></table>

**Response**

{% tabs %}
{% tab title="200" %}

```json
{ 
    data: { 
        deleted: true, 
        id: 1
    }, 
    success: true 
}
```

{% endtab %}
{% endtabs %}

Code

{% tabs %}
{% tab title="Node" %}

```javascript
const accessToken = `<ACCESS TOKEN>`

fetch('https://public-api.expertfile.com/v2/organization/:corporation/expert/:username/industry/:id', {
    method: 'DELETE',
    headers: {
        'Content-Type': 'application/x-www-form-urlencoded',
        'Authorization': `Bearer ${accessToken}`
    }
})
.then(response => response.json())
.then(json => {
    const { success, data, error } = json

    if (success) {
        const { id } = data
        console.log('Deleted industry id', id)
    }

})
.catch(error => console.error(error));

```

{% endtab %}

{% tab title="PHP" %}

```php
$accessToken = urlencode('<ACCESS TOKEN>');

$url = 'https://public-api.expertfile.com/v2/organization/:corporation/expert/:username/industry/:id';

$ch = curl_init($url);
curl_setopt(
    $ch,
    CURLOPT_HTTPHEADER,
    array('Content-Type: application/x-www-form-urlencoded', 'Authorization: Bearer ' . $accessToken)
);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_CUSTOMREQUEST, "DELETE");

$response = curl_exec($ch);
$json = json_decode($response);

if($json->success){
    var_dump($json->data);
}

curl_close($ch);
```

{% endtab %}

{% tab title="Curl" %}

```
curl -X DELETE https://public-api.expertfile.com/v2/organization/:corporation/expert/:username/industry/:id \
    -H "Content-Type: application/json" \
    -H "Authorization: Bearer <ACCESS TOKEN>"
```

{% endtab %}
{% endtabs %}


# Languages

CRUD endpoints for a user's languages

{% hint style="info" %}
Please note that in all urls & code samples you'll need to replace`:username` and `:corporation` with appropriate values
{% endhint %}

## Get All Languages

<mark style="color:green;">`GET`</mark> [**/v2/organization/:corporation/expert/:username/language**](https://public-api.expertfile.com/v2/organization/:corporation/expert/:username/language)

**Headers**

| Name          | Value              |
| ------------- | ------------------ |
| Content-Type  | `application/json` |
| Authorization | `Bearer <token>`   |

**Url**

<table><thead><tr><th width="339.3333333333333">Name</th><th>Type</th><th>Description</th></tr></thead><tbody><tr><td>corporation</td><td>number</td><td>Corporation ID</td></tr><tr><td>username</td><td>string</td><td>Unique username</td></tr></tbody></table>

**Response**

{% tabs %}
{% tab title="200" %}

```json
 {
  data: [
    {
      id: 1,
      name: "langauge"
    }
  ],
  success: true
}
```

{% endtab %}
{% endtabs %}

Code

{% tabs %}
{% tab title="Node" %}

```javascript
const accessToken = `<ACCESS TOKEN>`

fetch('https://public-api.expertfile.com/v2/organization/:corporation/expert/:username/language', {
    method: 'GET',
    headers: {
        'Content-Type': 'application/x-www-form-urlencoded',
        'Authorization': `Bearer ${accessToken}`
    }
})
.then(response => response.json())
.then(json => {
    const { success, data } = json

    if (success) {
        const language = data
        console.log('language', language)
    }

})
.catch(error => console.error(error));
```

{% endtab %}

{% tab title="PHP" %}

```php
$accessToken = urlencode('<ACCESS TOKEN>');
$url = 'https://public-api.expertfile.com/v2/organization/:corporation/expert/:username/language';

$ch = curl_init($url);
curl_setopt(
    $ch,
    CURLOPT_HTTPHEADER,
    array('Content-Type: application/x-www-form-urlencoded', 'Authorization: Bearer ' . $accessToken)
);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);

$response = curl_exec($ch);
$json = json_decode($response);

if($json->success){
    var_dump($json->data);
}

curl_close($ch);

```

{% endtab %}

{% tab title="Curl" %}

```
curl https://public-api.expertfile.com/v2/organization/:corporation/expert/:username/language \
    -H "Content-Type: application/json" \
    -H "Authorization: Bearer <ACCESS TOKEN>"
```

{% endtab %}
{% endtabs %}

## Get Individual Language

<mark style="color:green;">`GET`</mark> [**/v2/organization/:corporation/expert/:username/language/:id**](https://public-api.expertfile.com/v2/organization/:corporation/expert/:username/language/:id)

**Headers**

| Name          | Value              |
| ------------- | ------------------ |
| Content-Type  | `application/json` |
| Authorization | `Bearer <token>`   |

**Url**

<table><thead><tr><th width="339.3333333333333">Name</th><th>Type</th><th>Description</th></tr></thead><tbody><tr><td>corporation</td><td>number</td><td>Corporation ID</td></tr><tr><td>username</td><td>string</td><td>Unique username</td></tr><tr><td>id</td><td>number</td><td>Language ID</td></tr></tbody></table>

**Response**

{% tabs %}
{% tab title="200" %}

```json
{
  data: [
    {
      id: 1,
      name: "language"
    }
  ],
  success: true
}
```

{% endtab %}
{% endtabs %}

Code

{% tabs %}
{% tab title="Node" %}

```javascript
const accessToken = `<ACCESS CODE>`

fetch('https://public-api.expertfile.com/v2/organization/:corporation/expert/:username/language/:id', {
    method: 'GET',
    headers: {
        'Content-Type': 'application/x-www-form-urlencoded',
        'Authorization': `Bearer ${accessToken}`
    }
})
.then(response => response.json())
.then(json => {
    const { success, data } = json

    if (success) {
        const language = data
        console.log('language', language[0])
    }

})
.catch(error => console.error(error));
```

{% endtab %}

{% tab title="PHP" %}

```php
$accessToken = urlencode('<ACCESS TOKEN>');
$url = 'https://public-api.expertfile.com/v2/organization/:corporation/expert/:username/language/:id';

$ch = curl_init($url);
curl_setopt(
    $ch,
    CURLOPT_HTTPHEADER,
    array('Content-Type: application/x-www-form-urlencoded', 'Authorization: Bearer ' . $accessToken)
);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);

$response = curl_exec($ch);
$json = json_decode($response);

if($json->success){
    var_dump($json->data);
}

curl_close($ch);
```

{% endtab %}

{% tab title="Curl" %}

```
curl -X GET https://public-api.expertfile.com/v2/organization/:corporation/expert/:username/language/:id \
    -H "Content-Type: application/json" \
    -H "Authorization: Bearer <ACCESS TOKEN>"     
```

{% endtab %}
{% endtabs %}

## Create Language

<mark style="color:blue;">`POST`</mark> [**/v2/organization/:corporation/expert/:username/language**](https://public-api.expertfile.com/v2/organization/:corporation/expert/:username/language)

**Headers**

| Name          | Value              |
| ------------- | ------------------ |
| Content-Type  | `application/json` |
| Authorization | `Bearer <token>`   |

**Url**

<table><thead><tr><th width="339.3333333333333">Name</th><th>Type</th><th>Description</th></tr></thead><tbody><tr><td>corporation</td><td>number</td><td>Corporation ID</td></tr><tr><td>username</td><td>string</td><td>Unique username</td></tr></tbody></table>

**Body**

<table><thead><tr><th width="339.3333333333333">Name</th><th>Type</th><th>Description</th></tr></thead><tbody><tr><td>name<mark style="color:red;">*</mark></td><td>string</td><td>Language Name</td></tr></tbody></table>

**Response**

{% tabs %}
{% tab title="200" %}

```json
{ 
    data: { 
        id: 1
    }, 
    success: true 
}
```

{% endtab %}
{% endtabs %}

Code

{% tabs %}
{% tab title="Node" %}

```javascript
const data = new URLSearchParams();
const accessToken = `<ACCESS TOKEN>`

data.append('name', 'Spanish');

fetch('https://public-api.expertfile.com/v2/organization/:corporation/expert/:username/language', {
    method: 'POST',
    headers: {
        'Content-Type': 'application/x-www-form-urlencoded',
        'Authorization': `Bearer ${accessToken}`
    },
    body: data
})
.then(response => response.json())
.then(json => {
    const { success, data, error } = json

    if (success) {
        const { id } = data
        console.log('New language id', id)
    }

})
.catch(error => console.error(error));

```

{% endtab %}

{% tab title="PHP" %}

```php
$accessToken = urlencode('<ACCESS TOKEN>');

$url = 'https://public-api.expertfile.com/v2/organization/:corporation/expert/:username/language';
$data = ['name' => 'Spanish'];

$ch = curl_init($url);
curl_setopt(
    $ch,
    CURLOPT_HTTPHEADER,
    array('Content-Type: application/x-www-form-urlencoded', 'Authorization: Bearer ' . $accessToken)
);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_POSTFIELDS, http_build_query($data));

$response = curl_exec($ch);
$json = json_decode($response);

if($json->success){
    var_dump($json->data);
}

curl_close($ch);
```

{% endtab %}

{% tab title="Curl" %}

```
curl -X POST https://public-api.expertfile.com/v2/organization/:corporation/expert/:username/language \
    -H "Content-Type: application/json" \
    -H "Authorization: Bearer <ACCESS TOKEN>" \
    -d '{"name":"Spanish"}'
```

{% endtab %}
{% endtabs %}

## Update Language

<mark style="color:blue;">`PUT`</mark> [**/v2/organization/:corporation/expert/:username/language/:id**](https://public-api.expertfile.com/v2/organization/:corporation/expert/:username/language/:id)

**Headers**

| Name          | Value              |
| ------------- | ------------------ |
| Content-Type  | `application/json` |
| Authorization | `Bearer <token>`   |

**Url**

<table><thead><tr><th width="339.3333333333333">Name</th><th>Type</th><th>Description</th></tr></thead><tbody><tr><td>corporation</td><td>number</td><td>Corporation ID</td></tr><tr><td>username</td><td>string</td><td>Unique username</td></tr><tr><td>id</td><td>number</td><td>Language ID</td></tr></tbody></table>

**Body**

<table><thead><tr><th width="339.3333333333333">Name</th><th>Type</th><th>Description</th></tr></thead><tbody><tr><td>name<mark style="color:red;">*</mark></td><td>string</td><td>Language Name</td></tr></tbody></table>

**Response**

{% tabs %}
{% tab title="200" %}

```json
{ 
    data: { 
        id: 1
    }, 
    success: true 
}
```

{% endtab %}
{% endtabs %}

Code

{% tabs %}
{% tab title="Node" %}

```javascript
const data = new URLSearchParams();
const accessToken = `<ACCESS TOKEN>`

data.append('name', 'Spanish');

fetch('https://public-api.expertfile.com/v2/organization/:corporation/expert/:username/language/:id', {
    method: 'PUT',
    headers: {
        'Content-Type': 'application/x-www-form-urlencoded',
        'Authorization': `Bearer ${accessToken}`
    },
    body: data
})
.then(response => response.json())
.then(json => {
    const { success, data, error } = json

    if (success) {
        const { id } = data
        console.log('Updated language id', id)
    }

})
.catch(error => console.error(error));

```

{% endtab %}

{% tab title="PHP" %}

```php
$accessToken = urlencode('<ACCESS TOKEN>');

$url = 'https://public-api.expertfile.com/v2/organization/:corporation/expert/:username/language/:id';
$data = ['name' => 'Spanish'];

$ch = curl_init($url);
curl_setopt(
    $ch,
    CURLOPT_HTTPHEADER,
    array('Content-Type: application/x-www-form-urlencoded', 'Authorization: Bearer ' . $accessToken)
);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_PUT, http_build_query($data));

$response = curl_exec($ch);
$json = json_decode($response);

if($json->success){
    var_dump($json->data);
}

curl_close($ch);
```

{% endtab %}

{% tab title="Curl" %}

```
curl -X PUT https://public-api.expertfile.com/v2/organization/:corporation/expert/:username/language/:id \
    -H "Content-Type: application/json" \
    -H "Authorization: Bearer <ACCESS TOKEN>" \
    -d '{"name":"Spanish"}'
```

{% endtab %}
{% endtabs %}

## Delete Language

<mark style="color:red;">`DELETE`</mark>[**/v2/organization/:corporation/expert/:username/language/:id**](https://public-api.expertfile.com/v2/organization/:corporation/expert/:username/language/:id)

**Headers**

| Name          | Value              |
| ------------- | ------------------ |
| Content-Type  | `application/json` |
| Authorization | `Bearer <token>`   |

**Url**

<table><thead><tr><th width="339.3333333333333">Name</th><th>Type</th><th>Description</th></tr></thead><tbody><tr><td>corporation</td><td>number</td><td>Corporation ID</td></tr><tr><td>username</td><td>string</td><td>Unique username</td></tr><tr><td>id</td><td>number</td><td>Language ID</td></tr></tbody></table>

**Response**

{% tabs %}
{% tab title="200" %}

```json
{ 
    data: { 
        deleted: true, 
        id: 1
    }, 
    success: true 
}
```

{% endtab %}
{% endtabs %}

Code

{% tabs %}
{% tab title="Node" %}

```javascript
const accessToken = `<ACCESS TOKEN>`

fetch('https://public-api.expertfile.com/v2/organization/:corporation/expert/:username/language/:id', {
    method: 'DELETE',
    headers: {
        'Content-Type': 'application/x-www-form-urlencoded',
        'Authorization': `Bearer ${accessToken}`
    }
})
.then(response => response.json())
.then(json => {
    const { success, data, error } = json

    if (success) {
        const { id } = data
        console.log('Deleted language id', id)
    }

})
.catch(error => console.error(error));

```

{% endtab %}

{% tab title="PHP" %}

```php
$accessToken = urlencode('<ACCESS TOKEN>');

$url = 'https://public-api.expertfile.com/v2/organization/:corporation/expert/:username/language/:id';

$ch = curl_init($url);
curl_setopt(
    $ch,
    CURLOPT_HTTPHEADER,
    array('Content-Type: application/x-www-form-urlencoded', 'Authorization: Bearer ' . $accessToken)
);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_CUSTOMREQUEST, "DELETE");

$response = curl_exec($ch);
$json = json_decode($response);

if($json->success){
    var_dump($json->data);
}

curl_close($ch);
```

{% endtab %}

{% tab title="Curl" %}

```
curl -X DELETE https://public-api.expertfile.com/v2/organization/:corporation/expert/:username/language/:id \
    -H "Content-Type: application/json" \
    -H "Authorization: Bearer <ACCESS TOKEN>"
```

{% endtab %}
{% endtabs %}


# Links

CRUD endpoints for a user's custom links

{% hint style="info" %}
Please note that in all urls & code samples you'll need to replace`:username` and `:corporation` with appropriate values
{% endhint %}

## Get All Links

<mark style="color:green;">`GET`</mark> [**/v2/organization/:corporation/expert/:username/link**](https://public-api.expertfile.com/v2/organization/:corporation/expert/:username/link)

**Headers**

| Name          | Value              |
| ------------- | ------------------ |
| Content-Type  | `application/json` |
| Authorization | `Bearer <token>`   |

**Url**

<table><thead><tr><th width="339.3333333333333">Name</th><th>Type</th><th>Description</th></tr></thead><tbody><tr><td>corporation</td><td>number</td><td>Corporation ID</td></tr><tr><td>username</td><td>string</td><td>Unique username</td></tr></tbody></table>

**Response**

{% tabs %}
{% tab title="200" %}

```json
 {
  data: [
    {
      id: 1,
      name: "link name",
      url: "link url"
    }
  ],
  success: true
}
```

{% endtab %}
{% endtabs %}

Code

{% tabs %}
{% tab title="Node" %}

```javascript
const accessToken = `<ACCESS TOKEN>`

fetch('https://public-api.expertfile.com/v2/organization/:corporation/expert/:username/link', {
    method: 'GET',
    headers: {
        'Content-Type': 'application/x-www-form-urlencoded',
        'Authorization': `Bearer ${accessToken}`
    }
})
.then(response => response.json())
.then(json => {
    const { success, data } = json

    if (success) {
        const links = data
        console.log('links', links)
    }

})
.catch(error => console.error(error));
```

{% endtab %}

{% tab title="PHP" %}

```php
$accessToken = urlencode('<ACCESS TOKEN>');
$url = 'https://public-api.expertfile.com/v2/organization/:corporation/expert/:username/link';

$ch = curl_init($url);
curl_setopt(
    $ch,
    CURLOPT_HTTPHEADER,
    array('Content-Type: application/x-www-form-urlencoded', 'Authorization: Bearer ' . $accessToken)
);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);

$response = curl_exec($ch);
$json = json_decode($response);

if($json->success){
    var_dump($json->data);
}

curl_close($ch);

```

{% endtab %}

{% tab title="Curl" %}

```
curl https://public-api.expertfile.com/v2/organization/:corporation/expert/:username/link \
    -H "Content-Type: application/json" \
    -H "Authorization: Bearer <ACCESS TOKEN>"
```

{% endtab %}
{% endtabs %}

## Get Individual Link

<mark style="color:green;">`GET`</mark> [**/v2/organization/:corporation/expert/:username/link/:id**](https://public-api.expertfile.com/v2/organization/:corporation/expert/:username/link/:id)

**Headers**

| Name          | Value              |
| ------------- | ------------------ |
| Content-Type  | `application/json` |
| Authorization | `Bearer <token>`   |

**Url**

<table><thead><tr><th width="339.3333333333333">Name</th><th>Type</th><th>Description</th></tr></thead><tbody><tr><td>corporation</td><td>number</td><td>Corporation ID</td></tr><tr><td>username</td><td>string</td><td>Unique username</td></tr><tr><td>id</td><td>number</td><td>Link ID</td></tr></tbody></table>

**Response**

{% tabs %}
{% tab title="200" %}

```json
{
  data: [
    {
      id: 1,
      name: "link name",
      url: "link url"
    }
  ],
  success: true
}
```

{% endtab %}
{% endtabs %}

Code

{% tabs %}
{% tab title="Node" %}

```javascript
const accessToken = `<ACCESS CODE>`

fetch('https://public-api.expertfile.com/v2/organization/:corporation/expert/:username/link/:id', {
    method: 'GET',
    headers: {
        'Content-Type': 'application/x-www-form-urlencoded',
        'Authorization': `Bearer ${accessToken}`
    }
})
.then(response => response.json())
.then(json => {
    const { success, data } = json

    if (success) {
        const link = data
        console.log('links', link[0])
    }

})
.catch(error => console.error(error));
```

{% endtab %}

{% tab title="PHP" %}

```php
$accessToken = urlencode('<ACCESS TOKEN>');
$url = 'https://public-api.expertfile.com/v2/organization/:corporation/expert/:username/link/:id';

$ch = curl_init($url);
curl_setopt(
    $ch,
    CURLOPT_HTTPHEADER,
    array('Content-Type: application/x-www-form-urlencoded', 'Authorization: Bearer ' . $accessToken)
);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);

$response = curl_exec($ch);
$json = json_decode($response);

if($json->success){
    var_dump($json->data);
}

curl_close($ch);
```

{% endtab %}

{% tab title="Curl" %}

```
curl -X GET https://public-api.expertfile.com/v2/organization/:corporation/expert/:username/link/:id \
    -H "Content-Type: application/json" \
    -H "Authorization: Bearer <ACCESS TOKEN>"     
```

{% endtab %}
{% endtabs %}

## Create Link

<mark style="color:blue;">`POST`</mark> [**/v2/organization/:corporation/expert/:username/link**](https://public-api.expertfile.com/v2/organization/:corporation/expert/:username/link)

**Headers**

| Name          | Value              |
| ------------- | ------------------ |
| Content-Type  | `application/json` |
| Authorization | `Bearer <token>`   |

**Url**

<table><thead><tr><th width="339.3333333333333">Name</th><th>Type</th><th>Description</th></tr></thead><tbody><tr><td>corporation</td><td>number</td><td>Corporation ID</td></tr><tr><td>username</td><td>string</td><td>Unique username</td></tr></tbody></table>

**Body**

<table><thead><tr><th width="339.3333333333333">Name</th><th>Type</th><th>Description</th></tr></thead><tbody><tr><td>name<mark style="color:red;">*</mark></td><td>string</td><td>Link Name</td></tr><tr><td>url<mark style="color:red;">*</mark></td><td>string</td><td>Link Url<br><mark style="color:purple;">*must be valid url</mark></td></tr></tbody></table>

**Response**

{% tabs %}
{% tab title="200" %}

```json
{ 
    data: { 
        id: 1
    }, 
    success: true 
}
```

{% endtab %}
{% endtabs %}

Code

{% tabs %}
{% tab title="Node" %}

```javascript
const data = new URLSearchParams();
const accessToken = `<ACCESS TOKEN>`

data.append('name', 'My Blog');
data.append('url', 'https://myblog.com');

fetch('https://public-api.expertfile.com/v2/organization/:corporation/expert/:username/link', {
    method: 'POST',
    headers: {
        'Content-Type': 'application/x-www-form-urlencoded',
        'Authorization': `Bearer ${accessToken}`
    },
    body: data
})
.then(response => response.json())
.then(json => {
    const { success, data, error } = json

    if (success) {
        const { id } = data
        console.log('New link id', id)
    }

})
.catch(error => console.error(error));

```

{% endtab %}

{% tab title="PHP" %}

```php
$accessToken = urlencode('<ACCESS TOKEN>');

$url = 'https://public-api.expertfile.com/v2/organization/:corporation/expert/:username/link';
$data = ['name' => 'My Blog', 'url' => 'https://myblog.com'];

$ch = curl_init($url);
curl_setopt(
    $ch,
    CURLOPT_HTTPHEADER,
    array('Content-Type: application/x-www-form-urlencoded', 'Authorization: Bearer ' . $accessToken)
);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_POSTFIELDS, http_build_query($data));

$response = curl_exec($ch);
$json = json_decode($response);

if($json->success){
    var_dump($json->data);
}

curl_close($ch);
```

{% endtab %}

{% tab title="Curl" %}

```
curl -X POST https://public-api.expertfile.com/v2/organization/:corporation/expert/:username/link \
    -H "Content-Type: application/json" \
    -H "Authorization: Bearer <ACCESS TOKEN>" \
    -d '{"name":"My Blog", "url":"https://myblog.com"}'
```

{% endtab %}
{% endtabs %}

## Update Link

<mark style="color:blue;">`PUT`</mark> [**/v2/organization/:corporation/expert/:username/link/:id**](https://public-api.expertfile.com/v2/organization/:corporation/expert/:username/link/:id)

**Headers**

| Name          | Value              |
| ------------- | ------------------ |
| Content-Type  | `application/json` |
| Authorization | `Bearer <token>`   |

**Url**

<table><thead><tr><th width="339.3333333333333">Name</th><th>Type</th><th>Description</th></tr></thead><tbody><tr><td>corporation</td><td>number</td><td>Corporation ID</td></tr><tr><td>username</td><td>string</td><td>Unique username</td></tr><tr><td>id</td><td>number</td><td>Link ID</td></tr></tbody></table>

**Body**

<table><thead><tr><th width="339.3333333333333">Name</th><th>Type</th><th>Description</th></tr></thead><tbody><tr><td>name<mark style="color:red;">*</mark></td><td>string</td><td>Link Name</td></tr><tr><td>url<mark style="color:red;">*</mark></td><td>string</td><td>Link Url<br><mark style="color:purple;">*must be valid url</mark></td></tr></tbody></table>

**Response**

{% tabs %}
{% tab title="200" %}

```json
{ 
    data: { 
        id: 1
    }, 
    success: true 
}
```

{% endtab %}
{% endtabs %}

Code

{% tabs %}
{% tab title="Node" %}

```javascript
const data = new URLSearchParams();
const accessToken = `<ACCESS TOKEN>`

data.append('name', 'My Blog');
data.append('url', 'https://myblog.com');

fetch('https://public-api.expertfile.com/v2/organization/:corporation/expert/:username/link/:id', {
    method: 'PUT',
    headers: {
        'Content-Type': 'application/x-www-form-urlencoded',
        'Authorization': `Bearer ${accessToken}`
    },
    body: data
})
.then(response => response.json())
.then(json => {
    const { success, data, error } = json

    if (success) {
        const { id } = data
        console.log('Updated link id', id)
    }

})
.catch(error => console.error(error));

```

{% endtab %}

{% tab title="PHP" %}

```php
$accessToken = urlencode('<ACCESS TOKEN>');

$url = 'https://public-api.expertfile.com/v2/organization/:corporation/expert/:username/link/:id';
$data = ['name' => 'My Blog', 'url' => 'https://myblog.com'];

$ch = curl_init($url);
curl_setopt(
    $ch,
    CURLOPT_HTTPHEADER,
    array('Content-Type: application/x-www-form-urlencoded', 'Authorization: Bearer ' . $accessToken)
);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_PUT, http_build_query($data));

$response = curl_exec($ch);
$json = json_decode($response);

if($json->success){
    var_dump($json->data);
}

curl_close($ch);
```

{% endtab %}

{% tab title="Curl" %}

```
curl -X PUT https://public-api.expertfile.com/v2/organization/:corporation/expert/:username/link/:id \
    -H "Content-Type: application/json" \
    -H "Authorization: Bearer <ACCESS TOKEN>" \
    -d '{"name":"My Blog", "url":"https://myblog.com"}'
```

{% endtab %}
{% endtabs %}

## Delete Link

<mark style="color:red;">`DELETE`</mark>[**/v2/organization/:corporation/expert/:username/link/:id**](https://public-api.expertfile.com/v2/organization/:corporation/expert/:username/link/:id)

**Headers**

| Name          | Value              |
| ------------- | ------------------ |
| Content-Type  | `application/json` |
| Authorization | `Bearer <token>`   |

**Url**

<table><thead><tr><th width="339.3333333333333">Name</th><th>Type</th><th>Description</th></tr></thead><tbody><tr><td>corporation</td><td>number</td><td>Corporation ID</td></tr><tr><td>username</td><td>string</td><td>Unique username</td></tr><tr><td>id</td><td>number</td><td>Link ID</td></tr></tbody></table>

**Response**

{% tabs %}
{% tab title="200" %}

```json
{ 
    data: { 
        deleted: true, 
        id: 1
    }, 
    success: true 
}
```

{% endtab %}
{% endtabs %}

Code

{% tabs %}
{% tab title="Node" %}

```javascript
const accessToken = `<ACCESS TOKEN>`

fetch('https://public-api.expertfile.com/v2/organization/:corporation/expert/:username/link/:id', {
    method: 'DELETE',
    headers: {
        'Content-Type': 'application/x-www-form-urlencoded',
        'Authorization': `Bearer ${accessToken}`
    }
})
.then(response => response.json())
.then(json => {
    const { success, data, error } = json

    if (success) {
        const { id } = data
        console.log('Deleted link id', id)
    }

})
.catch(error => console.error(error));

```

{% endtab %}

{% tab title="PHP" %}

```php
$accessToken = urlencode('<ACCESS TOKEN>');

$url = 'https://public-api.expertfile.com/v2/organization/:corporation/expert/:username/link/:id';

$ch = curl_init($url);
curl_setopt(
    $ch,
    CURLOPT_HTTPHEADER,
    array('Content-Type: application/x-www-form-urlencoded', 'Authorization: Bearer ' . $accessToken)
);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_CUSTOMREQUEST, "DELETE");

$response = curl_exec($ch);
$json = json_decode($response);

if($json->success){
    var_dump($json->data);
}

curl_close($ch);
```

{% endtab %}

{% tab title="Curl" %}

```
curl -X DELETE https://public-api.expertfile.com/v2/organization/:corporation/expert/:username/link/:id \
    -H "Content-Type: application/json" \
    -H "Authorization: Bearer <ACCESS TOKEN>"
```

{% endtab %}
{% endtabs %}


# Media Appearances

CRUD endpoints for a user's media appearances

{% hint style="info" %}
Please note that in all urls & code samples you'll need to replace`:username` and `:corporation` with appropriate values
{% endhint %}

## Get All Media Appearances

<mark style="color:green;">`GET`</mark> [**/v2/organization/:corporation/expert/:username/mediaappearance**](https://public-api.expertfile.com/v2/organization/:corporation/expert/:username/mediaappearance)

**Headers**

| Name          | Value              |
| ------------- | ------------------ |
| Content-Type  | `application/json` |
| Authorization | `Bearer <token>`   |

**Url**

<table><thead><tr><th width="339.3333333333333">Name</th><th>Type</th><th>Description</th></tr></thead><tbody><tr><td>corporation</td><td>number</td><td>Corporation ID</td></tr><tr><td>username</td><td>string</td><td>Unique username</td></tr></tbody></table>

**Response**

{% tabs %}
{% tab title="200" %}

```json
 {
  data: [
    {
    id: 1,
    title: 'Appearance Title',
    organization: 'Appearance Org.',
    type: 'online',
    url: 'Url',
    details: 'Appearance Details',
    date:'',
    cover_url: 'Uploaded Img url,
    large_cover_url: 'Uploaded Img url',
    cover_alt_title: 'Uploaded Img alt'
    },
  ],
  success: true
}
```

{% endtab %}
{% endtabs %}

Code

{% tabs %}
{% tab title="Node" %}

```javascript
const accessToken = `<ACCESS CODE>`

fetch('https://public-api.expertfile.com/v2/organization/:corporation/expert/:username/mediaappearance', {
    method: 'GET',
    headers: {
        'Content-Type': 'application/x-www-form-urlencoded',
        'Authorization': `Bearer ${accessToken}`
    }
})
.then(response => response.json())
.then(json => {
    const { success, data } = json

    if (success) {
        const media = data;
        console.log('all media', media)
    }

})
.catch(error => console.error(error));
```

{% endtab %}

{% tab title="PHP" %}

```php
$accessToken = urlencode('<ACCESS TOKEN>');
$url = 'https://public-api.expertfile.com/v2/organization/:corporation/expert/:username/mediaappearance';

$ch = curl_init($url);
curl_setopt(
    $ch,
    CURLOPT_HTTPHEADER,
    array('Content-Type: application/x-www-form-urlencoded', 'Authorization: Bearer ' . $accessToken)
);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);

$response = curl_exec($ch);
$json = json_decode($response);

if($json->success){
    var_dump($json->data);
}

curl_close($ch);

```

{% endtab %}

{% tab title="Curl" %}

```
curl https://public-api.expertfile.com/v2/organization/:corporation/expert/:username/mediaappearance \
    -H "Content-Type: application/json" \
    -H "Authorization: Bearer <ACCESS TOKEN>"
```

{% endtab %}
{% endtabs %}

## Get Individual Media Appearances

<mark style="color:green;">`GET`</mark> [**/v2/organization/:corporation/expert/:username/mediaappearance/:id**](https://public-api.expertfile.com/v2/organization/:corporation/expert/:username/mediaappearance)

**Headers**

| Name          | Value              |
| ------------- | ------------------ |
| Content-Type  | `application/json` |
| Authorization | `Bearer <token>`   |

**Url**

<table><thead><tr><th width="339.3333333333333">Name</th><th>Type</th><th>Description</th></tr></thead><tbody><tr><td>corporation</td><td>number</td><td>Corporation ID</td></tr><tr><td>username</td><td>string</td><td>Unique username</td></tr><tr><td>id</td><td>number</td><td>Media Appearance ID</td></tr></tbody></table>

**Response**

{% tabs %}
{% tab title="200" %}

```json
{
  data: [
    {
    id: 1,
    title: 'Appearance Title',
    organization: 'Appearance Org.',
    type: 'online',
    url: 'Url',
    details: 'Appearance Details',
    date:'',
    cover_url: 'Uploaded Img url,
    large_cover_url: 'Uploaded Img url',
    cover_alt_title: 'Uploaded Img alt'
    },
  ],
  success: true
}
```

{% endtab %}
{% endtabs %}

Code

{% tabs %}
{% tab title="Node" %}

```javascript
const accessToken = `<ACCESS CODE>`

fetch('https://public-api.expertfile.com/v2/organization/:corporation/expert/:username/mediaappearance/:id', {
    method: 'GET',
    headers: {
        'Content-Type': 'application/x-www-form-urlencoded',
        'Authorization': `Bearer ${accessToken}`
    }
})
.then(response => response.json())
.then(json => {
    const { success, data, error } = json

    if (success) {
        console.log('media', data)
    }

})
.catch(error => console.error(error));
```

{% endtab %}

{% tab title="PHP" %}

```php
$accessToken = urlencode('<ACCESS TOKEN>');
$url = 'https://public-api.expertfile.com/v2/organization/:corporation/expert/:username/mediaappearance/:id';

$ch = curl_init($url);
curl_setopt(
    $ch,
    CURLOPT_HTTPHEADER,
    array('Content-Type: application/x-www-form-urlencoded', 'Authorization: Bearer ' . $accessToken)
);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);

$response = curl_exec($ch);
$json = json_decode($response);

if($json->success){
    var_dump($json->data);
}

curl_close($ch);
```

{% endtab %}

{% tab title="Curl" %}

```
curl -X GET https://public-api.expertfile.com/v2/organization/:corporation/expert/:username/mediaappearance/:id \
    -H "Content-Type: application/json" \
    -H "Authorization: Bearer <ACCESS TOKEN>"     
```

{% endtab %}
{% endtabs %}

## Create Media Appearances

<mark style="color:blue;">`POST`</mark> [**/v2/organization/:corporation/expert/:username/mediaappearance**](https://public-api.expertfile.com/v2/organization/:corporation/expert/:username/mediaappearance)

**Headers**

| Name          | Value              |
| ------------- | ------------------ |
| Content-Type  | `application/json` |
| Authorization | `Bearer <token>`   |

**Url**

<table><thead><tr><th width="339.3333333333333">Name</th><th>Type</th><th>Description</th></tr></thead><tbody><tr><td>corporation</td><td>number</td><td>Corporation ID</td></tr><tr><td>username</td><td>string</td><td>Unique username</td></tr></tbody></table>

**Body**

<table><thead><tr><th width="339.3333333333333">Name</th><th>Type</th><th>Description</th></tr></thead><tbody><tr><td>title<mark style="color:red;">*</mark></td><td>string</td><td>Appearance  Title</td></tr><tr><td>organization<mark style="color:red;">*</mark></td><td>string</td><td>Appearance Organization</td></tr><tr><td>details<mark style="color:red;">*</mark></td><td>string</td><td>Appearance Details</td></tr><tr><td>url</td><td>string</td><td>Appearance Url</td></tr><tr><td>date</td><td>unix timestamp</td><td>Appearance Date</td></tr><tr><td>type</td><td>string</td><td>Appearance Type(this can be one of 'print', 'online', 'tv', 'radio')</td></tr></tbody></table>

**Response**

{% tabs %}
{% tab title="200" %}

```json
{ 
    data: { 
        id: 1
    }, 
    success: true 
}
```

{% endtab %}
{% endtabs %}

Code

{% tabs %}
{% tab title="Node" %}

```javascript
const data = new URLSearchParams();
const accessToken = `<ACCESS TOKEN>`

data.append('title', 'My Appearance Title');
data.append('organization', 'My Appearance Name...');
data.append('details', 'My Appearance Details');
data.append('url', 'https://url.com')
data.append('type', 'online')
data.append('date', 1341892800);

fetch('https://public-api.expertfile.com/v2/organization/:corporation/expert/:username/mediaappearance', {
    method: 'POST',
    headers: {
        'Content-Type': 'application/x-www-form-urlencoded',
        'Authorization': `Bearer ${accessToken}`
    },
    body: data
})
.then(response => response.json())
.then(json => {
    const { success, data, error } = json

    if (success) {
        const { id } = data
        console.log('New media id', id)
    }

})
.catch(error => console.error(error));
```

{% endtab %}

{% tab title="PHP" %}

```php
$accessToken = urlencode('<ACCESS TOKEN>');

$url = 'https://public-api.expertfile.com/v2/organization/:corporation/expert/:username/mediaappearance';
$data = ['title' => 'My Appearance Title', 'organization' => 'My Appearance Name...', 'details' => 'My Appearance Details', 'url' => 'https://location.com', 'type' => 'online', 'date' => 1341892800];

$ch = curl_init($url);
curl_setopt(
    $ch,
    CURLOPT_HTTPHEADER,
    array('Content-Type: application/x-www-form-urlencoded', 'Authorization: Bearer ' . $accessToken)
);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_POSTFIELDS, http_build_query($data));

$response = curl_exec($ch);
$json = json_decode($response);

if($json->success){
    var_dump($json->data);
}

curl_close($ch);
```

{% endtab %}

{% tab title="Curl" %}

```
curl -X POST https://public-api.expertfile.com/v2/organization/:corporation/expert/:username/mediaappearance \
    -H "Content-Type: application/json" \
    -H "Authorization: Bearer <ACCESS TOKEN>" \
    -d '{"title":"My Appearance Title", "organization":"My Appearance Name...", "details":"My Appearance Details", "url": "https://location.com", "type":online", "date":  1341892800}'

```

{% endtab %}
{% endtabs %}

## Update Media Appearances

<mark style="color:blue;">`PUT`</mark> [**/v2/organization/:corporation/expert/:username/mediaappearance/:id**](https://public-api.expertfile.com/v2/organization/:corporation/expert/:username/mediaappearance)

**Headers**

| Name          | Value              |
| ------------- | ------------------ |
| Content-Type  | `application/json` |
| Authorization | `Bearer <token>`   |

**Url**

<table><thead><tr><th width="339.3333333333333">Name</th><th>Type</th><th>Description</th></tr></thead><tbody><tr><td>corporation</td><td>number</td><td>Corporation ID</td></tr><tr><td>username</td><td>string</td><td>Unique username</td></tr><tr><td>id</td><td>number</td><td>Appearance ID</td></tr></tbody></table>

**Body**

<table><thead><tr><th width="339.3333333333333">Name</th><th>Type</th><th>Description</th></tr></thead><tbody><tr><td>title<mark style="color:red;">*</mark></td><td>string</td><td>Appearance  Title</td></tr><tr><td>organization<mark style="color:red;">*</mark></td><td>string</td><td>Appearance Organization</td></tr><tr><td>details<mark style="color:red;">*</mark></td><td>string</td><td>Appearance Details</td></tr><tr><td>url</td><td>string</td><td>Appearance Url</td></tr><tr><td>date</td><td>unix timestamp</td><td>Appearance Date</td></tr><tr><td>type</td><td>string</td><td>Appearance Type(this can be one of 'print', 'online', 'tv', 'radio')</td></tr></tbody></table>

**Response**

{% tabs %}
{% tab title="200" %}

```json
{ 
    data: { 
        id: 1, 
        updated: true 
    }, 
    success: true 
}
```

{% endtab %}
{% endtabs %}

Code

{% tabs %}
{% tab title="Node" %}

```javascript
const data = new URLSearchParams();
const accessToken = `<ACCESS TOKEN>`

data.append('title', 'My Appearance Title');
data.append('organization', 'My Appearance Name...');
data.append('details', 'My Appearance Details');
data.append('url', 'https://url.com')
data.append('type', 'online')
data.append('date', 1341892800);

fetch('https://public-api.expertfile.com/v2/organization/:corporation/expert/:username/mediaappearance/:id', {
    method: 'PUT',
    headers: {
        'Content-Type': 'application/x-www-form-urlencoded',
        'Authorization': `Bearer ${accessToken}`
    },
    body: data
})
.then(response => response.json())
.then(json => {
    const { success, data, error } = json

    if (success) {
        const { id } = data
        console.log('New media id', id)
    }

})
.catch(error => console.error(error));

```

{% endtab %}

{% tab title="PHP" %}

```php
$accessToken = urlencode('<ACCESS TOKEN>');

$url = 'https://public-api.expertfile.com/v2/organization/:corporation/expert/:username/eventappearance/:id';
$data = ['title' => 'My Appearance Title', 'organization' => 'My Appearance Name...', 'details' => 'My Appearance Details', 'url' => 'https://location.com', 'type' => 'online', 'date' => 1341892800];

$ch = curl_init($url);
curl_setopt(
    $ch,
    CURLOPT_HTTPHEADER,
    array('Content-Type: application/x-www-form-urlencoded', 'Authorization: Bearer ' . $accessToken)
);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_PUT, http_build_query($data));

$response = curl_exec($ch);
$json = json_decode($response);

if($json->success){
    var_dump($json->data);
}

curl_close($ch);
```

{% endtab %}

{% tab title="Curl" %}

```
curl -X PUT https://public-api.expertfile.com/v2/organization/:corporation/expert/:username/mediaappearance/:id \
    -H "Content-Type: application/json" \
    -H "Authorization: Bearer <ACCESS TOKEN>" \
    -d '{"title":"My Appearance Title", "organization":"My Appearance Name...", "details":"My Appearance Details", "url": "https://location.com", "type":online", "date":  1341892800}'
```

{% endtab %}
{% endtabs %}

## Delete Media Appearances

<mark style="color:red;">`DELETE`</mark> [**/v2/organization/:corporation/expert/:username/mediaappearance/:id**](https://public-api.expertfile.com/v2/organization/:corporation/expert/:username/mediaappearance)

**Headers**

| Name          | Value              |
| ------------- | ------------------ |
| Content-Type  | `application/json` |
| Authorization | `Bearer <token>`   |

**Url**

<table><thead><tr><th width="339.3333333333333">Name</th><th>Type</th><th>Description</th></tr></thead><tbody><tr><td>corporation</td><td>number</td><td>Corporation ID</td></tr><tr><td>username</td><td>string</td><td>Unique username</td></tr><tr><td>id</td><td>number</td><td>Appearance ID</td></tr></tbody></table>

**Response**

{% tabs %}
{% tab title="200" %}

```json
{ 
    data: { 
        deleted: true, 
        id: 1 
    }, 
    success: true 
}
```

{% endtab %}
{% endtabs %}

Code

{% tabs %}
{% tab title="Node" %}

```javascript
const accessToken = `<ACCESS TOKEN>`

fetch('https://public-api.expertfile.com/v2/organization/:corporation/expert/:username/mediaappearance/:id', {
    method: 'DELETE',
    headers: {
        'Content-Type': 'application/x-www-form-urlencoded',
        'Authorization': `Bearer ${accessToken}`
    }
})
.then(response => response.json())
.then(json => {
    const { success, data, error } = json

    if (success) {
        const { id } = data
        console.log('Deleted media id', id)
    }

})
.catch(error => console.error(error));

```

{% endtab %}

{% tab title="PHP" %}

```php
$accessToken = urlencode('<ACCESS TOKEN>');

$url = 'https://public-api.expertfile.com/v2/organization/:corporation/expert/:username/mediaappearance/:id';

$ch = curl_init($url);
curl_setopt(
    $ch,
    CURLOPT_HTTPHEADER,
    array('Content-Type: application/x-www-form-urlencoded', 'Authorization: Bearer ' . $accessToken)
);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_CUSTOMREQUEST, "DELETE");

$response = curl_exec($ch);
$json = json_decode($response);

if($json->success){
    var_dump($json->data);
}

curl_close($ch);
```

{% endtab %}

{% tab title="Curl" %}

```
curl -X DELETE https://public-api.expertfile.com/v2/organization/:corporation/expert/:username/mediaappearance/:id \
    -H "Content-Type: application/json" \
    -H "Authorization: Bearer <ACCESS TOKEN>"
```

{% endtab %}
{% endtabs %}


# Partnerships

CRUD endpoints for a user's partnerships

{% hint style="info" %}
Please note that in all urls & code samples you'll need to replace`:username` and `:corporation` with appropriate values
{% endhint %}

## Get All Partnerships

<mark style="color:green;">`GET`</mark> [**/v2/organization/:corporation/expert/:username/partnership**](https://public-api.expertfile.com/v2/organization/:corporation/expert/:username/partnership/)

**Headers**

| Name          | Value              |
| ------------- | ------------------ |
| Content-Type  | `application/json` |
| Authorization | `Bearer <token>`   |

**Url**

<table><thead><tr><th width="339.3333333333333">Name</th><th>Type</th><th>Description</th></tr></thead><tbody><tr><td>corporation</td><td>number</td><td>Corporation ID</td></tr><tr><td>username</td><td>string</td><td>Unique username</td></tr></tbody></table>

**Response**

{% tabs %}
{% tab title="200" %}

```json
{
  data: [
    {
      id: 1,
      title: 'Partnership title',
      individual: 'Individual Name',
      organization: 'Organization Name',
      url: 'http://www.myurl.com',
      details: 'Partnership details',
      date: 0
    },
  ],
  success: true
}
```

{% endtab %}
{% endtabs %}

Code

{% tabs %}
{% tab title="Node" %}

```javascript
const data = new URLSearchParams();
const accessToken = `<ACCESS TOKEN>`

fetch('https://public-api.expertfile.com/v2/organization/:corporation/expert/:username/partnership', {
    method: 'GET',
    headers: {
        'Content-Type': 'application/x-www-form-urlencoded',
        'Authorization': `Bearer ${accessToken}`
    }
})
.then(response => response.json())
.then(json => {
    const { success, data } = json

    if (success) {
        const partnerships = data;
        console.log('all partnerships', partnerships)
    }

})
.catch(error => console.error(error));
```

{% endtab %}

{% tab title="PHP" %}

```php
$accessToken = urlencode('<ACCESS TOKEN>');
$url = 'https://public-api.expertfile.com/v2/organization/:corporation/expert/:username/partnership';

$ch = curl_init($url);
curl_setopt(
    $ch,
    CURLOPT_HTTPHEADER,
    array('Content-Type: application/x-www-form-urlencoded', 'Authorization: Bearer ' . $accessToken)
);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);

$response = curl_exec($ch);
$json = json_decode($response);

if($json->success){
    var_dump($json->data);
}

curl_close($ch);

```

{% endtab %}

{% tab title="Curl" %}

```
curl https://public-api.expertfile.com/v2/organization/:corporation/expert/:username/partnership \
    -H "Content-Type: application/json" \
    -H "Authorization: Bearer <ACCESS TOKEN>"
```

{% endtab %}
{% endtabs %}

## Get Individual Partnership

<mark style="color:green;">`GET`</mark>[ **/v2/organization/:corporation/expert/:username/partnership/:id**](https://public-api.expertfile.com/v2/organization/:corporation/expert/:username/partnership/:id)

**Headers**

| Name          | Value              |
| ------------- | ------------------ |
| Content-Type  | `application/json` |
| Authorization | `Bearer <token>`   |

**Url**

<table><thead><tr><th width="339.3333333333333">Name</th><th>Type</th><th>Description</th></tr></thead><tbody><tr><td>corporation</td><td>number</td><td>Corporation ID</td></tr><tr><td>username</td><td>string</td><td>Unique username</td></tr><tr><td>id</td><td>number</td><td>Partnership ID</td></tr></tbody></table>

**Response**

{% tabs %}
{% tab title="200" %}

```json
{
  data: [
    {
      id: 1,
      title: 'Partnership title',
      individual: 'Individual Name',
      organization: 'Organization Name',
      url: 'http://www.myurl.com',
      details: 'Partnership details',
      date: 0
    },
  ],
  success: true
}
```

{% endtab %}
{% endtabs %}

Code

{% tabs %}
{% tab title="Node" %}

<pre class="language-javascript" data-full-width="true"><code class="lang-javascript"><strong>const accessToken = `&#x3C;ACCESS TOKEN>`
</strong>
fetch('https://public-api.expertfile.com/v2/organization/:corporation/expert/:username/partnership/:id', {
    method: 'GET',
    headers: {
        'Content-Type': 'application/x-www-form-urlencoded',
        'Authorization': `Bearer ${accessToken}`
    }
})
.then(response => response.json())
.then(json => {
    const { success, data } = json

    if (success) {
        const partnership = data;
        console.log('partnership', partnership)
    }

})
.catch(error => console.error(error));
</code></pre>

{% endtab %}

{% tab title="PHP" %}

```php
$accessToken = urlencode('<ACCESS TOKEN>');
$url = 'https://public-api.expertfile.com/v2/organization/:corporation/expert/:username/partnership/:id';

$ch = curl_init($url);
curl_setopt(
    $ch,
    CURLOPT_HTTPHEADER,
    array('Content-Type: application/x-www-form-urlencoded', 'Authorization: Bearer ' . $accessToken)
);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);

$response = curl_exec($ch);
$json = json_decode($response);

if($json->success){
    var_dump($json->data);
}

curl_close($ch);
```

{% endtab %}

{% tab title="Curl" %}

```
curl -X GET https://public-api.expertfile.com/v2/organization/:corporation/expert/:username/partnership/:id \
    -H "Content-Type: application/json" \
    -H "Authorization: Bearer <ACCESS TOKEN>"     
```

{% endtab %}
{% endtabs %}

## Create Partnership

<mark style="color:blue;">`POST`</mark> [**/v2/organization/:corporation/expert/:username/partnership**](https://public-api.expertfile.com/v2/organization/:corporation/expert/:username/partnership/)

**Headers**

| Name          | Value              |
| ------------- | ------------------ |
| Content-Type  | `application/json` |
| Authorization | `Bearer <token>`   |

**Url**

<table><thead><tr><th width="339.3333333333333">Name</th><th>Type</th><th>Description</th></tr></thead><tbody><tr><td>corporation</td><td>number</td><td>Corporation ID</td></tr><tr><td>username</td><td>string</td><td>Unique username</td></tr></tbody></table>

**Body**

<table><thead><tr><th width="339.3333333333333">Name</th><th>Type</th><th>Description</th></tr></thead><tbody><tr><td>title<mark style="color:red;">*</mark></td><td>string</td><td>Partnership Title</td></tr><tr><td>organization</td><td>string</td><td>Partnership Organization</td></tr><tr><td>details<mark style="color:red;">*</mark></td><td>string</td><td>Partnership Detail</td></tr><tr><td>date</td><td>unix timestamp</td><td>PartnershipDate</td></tr><tr><td>url</td><td>string</td><td>Partnership Url</td></tr><tr><td>individual<mark style="color:red;">*</mark></td><td>string</td><td>Partnership Individual</td></tr></tbody></table>

**Response**

{% tabs %}
{% tab title="200" %}

```json
{ 
    data: { 
        id: 1
    }, 
    success: true 
}
```

{% endtab %}
{% endtabs %}

Code

{% tabs %}
{% tab title="Node" %}

```javascript
const data = new URLSearchParams();
const accessToken = `<ACCESS TOKEN>`

data.append('title', 'Partnership title');
data.append('organization', 'Partnership organization');
data.append('details', 'Partnership details...');
data.append('individual', 'Partnership Individual');
data.append('date', 1702530000);
data.append('url', 'https://myurl.com');

fetch('https://public-api.expertfile.com/v2/organization/:corporation/expert/:username/partnership', {
    method: 'POST',
    headers: {
        'Content-Type': 'application/x-www-form-urlencoded',
        'Authorization': `Bearer ${accessToken}`
    },
    body: data
})
.then(response => response.json())
.then(json => {
    const { success, data, error } = json

    if (success) {
        const { id } = data
        console.log('New partnership id', id)
    }

})
.catch(error => console.error(error));
```

{% endtab %}

{% tab title="PHP" %}

```php
$accessToken = urlencode('<ACCESS TOKEN>');

$url = 'https://public-api.expertfile.com/v2/organization/:corporation/expert/:username/partnership';
$data = ['title' => 'Partnership title', 'organization' => 'Partnership organization', 'details' => 'Partnership details...','individual' => 'Partnership Individual', 'date' => 1702530000, 'url' => 'https://myurl.com'];

$ch = curl_init($url);
curl_setopt(
    $ch,
    CURLOPT_HTTPHEADER,
    array('Content-Type: application/x-www-form-urlencoded', 'Authorization: Bearer ' . $accessToken)
);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_POSTFIELDS, http_build_query($data));

$response = curl_exec($ch);
$json = json_decode($response);

if($json->success){
    var_dump($json->data);
}

curl_close($ch)
```

{% endtab %}

{% tab title="Curl" %}

```
curl -X POST https://public-api.expertfile.com/v2/organization/:corporation/expert/:username/partnership \
    -H "Content-Type: application/json" \
    -H "Authorization: Bearer <ACCESS TOKEN>" \
    -d '{"title": "Partnership title", "organization": "Partnership organization", "details": "Partnership details...", "individual": "Partnership Individual", "date": 1702530000, "url": "https://myurl.com"}'
```

{% endtab %}
{% endtabs %}

## Update Partnership

<mark style="color:blue;">`PUT`</mark> [**/v2/organization/:corporation/expert/:username/partnership/:id**](https://public-api.expertfile.com/v2/organization/:corporation/expert/:username/partnership/:id)

**Headers**

| Name          | Value              |
| ------------- | ------------------ |
| Content-Type  | `application/json` |
| Authorization | `Bearer <token>`   |

**Url**

<table><thead><tr><th width="339.3333333333333">Name</th><th>Type</th><th>Description</th></tr></thead><tbody><tr><td>corporation</td><td>number</td><td>Corporation ID</td></tr><tr><td>username</td><td>string</td><td>Unique username</td></tr><tr><td>id</td><td>number</td><td>Partnership ID</td></tr></tbody></table>

**Body**

<table><thead><tr><th width="339.3333333333333">Name</th><th>Type</th><th>Description</th></tr></thead><tbody><tr><td>title<mark style="color:red;">*</mark></td><td>string</td><td>Partnership Title</td></tr><tr><td>organization</td><td>string</td><td>Partnership Organization</td></tr><tr><td>details<mark style="color:red;">*</mark></td><td>string</td><td>Partnership Detail</td></tr><tr><td>date</td><td>unix timestamp</td><td>PartnershipDate</td></tr><tr><td>url</td><td>string</td><td>Partnership Url</td></tr><tr><td>individual<mark style="color:red;">*</mark></td><td>string</td><td>Partnership Individual</td></tr></tbody></table>

**Response**

{% tabs %}
{% tab title="200" %}

```json
{ 
    data: { 
        id: 1, 
        updated: true 
    }, 
    success: true 
}
```

{% endtab %}
{% endtabs %}

Code

{% tabs %}
{% tab title="Node" %}

```javascript
const data = new URLSearchParams();
const accessToken = `<ACCESS TOKEN>`

data.append('title', 'Partnership title');
data.append('organization', 'Partnership organization');
data.append('details', 'Partnership details...');
data.append('individual', 'Partnership Individual');
data.append('date', 1702530000);
data.append('url', 'https://myurl.com');

fetch('https://public-api.expertfile.com/v2/organization/:corporation/expert/:username/partnership/:id', {
    method: 'PUT',
    headers: {
        'Content-Type': 'application/x-www-form-urlencoded',
        'Authorization': `Bearer ${accessToken}`
    },
    body: data
})
.then(response => response.json())
.then(json => {
    const { success, data, error } = json

    if (success) {
        const { id } = data
        console.log('New patent id', id)
    }

})
.catch(error => console.error(error));

```

{% endtab %}

{% tab title="PHP" %}

```php
$accessToken = urlencode('<ACCESS TOKEN>');

$url = 'https://public-api.expertfile.com/v2/organization/:corporation/expert/:username/partnership/:id';
$data = ['title' => 'Partnership title', 'organization' => 'Partnership organization', 'details' => 'Partnership details...','individual' => 'Partnership Individual', 'date' => 1702530000, 'url' => 'https://myurl.com'];

$ch = curl_init($url);
curl_setopt(
    $ch,
    CURLOPT_HTTPHEADER,
    array('Content-Type: application/x-www-form-urlencoded', 'Authorization: Bearer ' . $accessToken)
);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_PUT, http_build_query($data));

$response = curl_exec($ch);
$json = json_decode($response);

if($json->success){
    var_dump($json->data);
}

curl_close($ch)
```

{% endtab %}

{% tab title="Curl" %}

```
curl -X PUT https://public-api.expertfile.com/v2/organization/:corporation/expert/:username/partnership/:id \
    -H "Content-Type: application/json" \
    -H "Authorization: Bearer <ACCESS TOKEN>" \
    -d '{"title": "Partnership title", "organization": "Partnership organization", "details": "Partnership details...", "individual": "Partnership Individual", "date": 1702530000, "url": "https://myurl.com"}'
```

{% endtab %}
{% endtabs %}

## Delete Partnership

<mark style="color:red;">`DELETE`</mark> [**/v2/organization/:corporation/expert/:username/partnership/:id**](https://public-api.expertfile.com/v2/organization/:corporation/expert/:username/partnership/:id)

**Headers**

| Name          | Value              |
| ------------- | ------------------ |
| Content-Type  | `application/json` |
| Authorization | `Bearer <token>`   |

**Url**

<table><thead><tr><th width="339.3333333333333">Name</th><th>Type</th><th>Description</th></tr></thead><tbody><tr><td>corporation</td><td>number</td><td>Corporation ID</td></tr><tr><td>username</td><td>string</td><td>Unique username</td></tr><tr><td>id</td><td>number</td><td>Partnership ID</td></tr></tbody></table>

**Response**

{% tabs %}
{% tab title="200" %}

```json
{ 
    data: { 
        deleted: true, 
        id: 1 
    }, 
    success: true 
}
```

{% endtab %}
{% endtabs %}

Code

{% tabs %}
{% tab title="Node" %}

```javascript
const accessToken = `<ACCESS TOKEN>`

fetch('https://public-api.expertfile.com/v2/organization/:corporation/expert/:username/partnership/:id', {
    method: 'DELETE',
    headers: {
        'Content-Type': 'application/x-www-form-urlencoded',
        'Authorization': `Bearer ${accessToken}`
    }
})
.then(response => response.json())
.then(json => {
    const { success, data, error } = json

    if (success) {
        const { id } = data
        console.log('Deleted partnership id', id)
    }

})
.catch(error => console.error(error));

```

{% endtab %}

{% tab title="PHP" %}

```php
$accessToken = urlencode('<ACCESS TOKEN>');

$url = 'https://public-api.expertfile.com/v2/organization/:corporation/expert/:username/testimonial/:id';

$ch = curl_init($url);
curl_setopt(
    $ch,
    CURLOPT_HTTPHEADER,
    array('Content-Type: application/x-www-form-urlencoded', 'Authorization: Bearer ' . $accessToken)
);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_CUSTOMREQUEST, "DELETE");

$response = curl_exec($ch);
$json = json_decode($response);

if($json->success){
    var_dump($json->data);
}

curl_close($ch);
```

{% endtab %}

{% tab title="Curl" %}

```
curl -X DELETE https://public-api.expertfile.com/v2/organization/:corporation/expert/:username/testimonial/:id \
    -H "Content-Type: application/json" \
    -H "Authorization: Bearer <ACCESS TOKEN>"
```

{% endtab %}
{% endtabs %}


# Patents

CRUD endpoints for a user's patents

{% hint style="info" %}
Please note that in all urls & code samples you'll need to replace`:username` and `:corporation` with appropriate values
{% endhint %}

## Get All Patents

<mark style="color:green;">`GET`</mark> [**/v2/organization/:corporation/expert/:username/patent**](https://public-api.expertfile.com/v2/organization/:corporation/expert/:username/patent/)

**Headers**

| Name          | Value              |
| ------------- | ------------------ |
| Content-Type  | `application/json` |
| Authorization | `Bearer <token>`   |

**Url**

<table><thead><tr><th width="339.3333333333333">Name</th><th>Type</th><th>Description</th></tr></thead><tbody><tr><td>corporation</td><td>number</td><td>Corporation ID</td></tr><tr><td>username</td><td>string</td><td>Unique username</td></tr></tbody></table>

**Response**

{% tabs %}
{% tab title="200" %}

```json
 {
  data: [
    {
      id: 1,
      title: 'Patent Title',
      detail: 'Patent Details',
      number: '#124',
      date: 0,
      url: 'https://patent.com'
    },
  ],
  success: true
}
```

{% endtab %}
{% endtabs %}

Code

{% tabs %}
{% tab title="Node" %}

```javascript
const data = new URLSearchParams();
const accessToken = `<ACCESS TOKEN>`

fetch('https://public-api.expertfile.com/v2/organization/:corporation/expert/:username/patent', {
    method: 'GET',
    headers: {
        'Content-Type': 'application/x-www-form-urlencoded',
        'Authorization': `Bearer ${accessToken}`
    }
})
.then(response => response.json())
.then(json => {
    const { success, data } = json

    if (success) {
        const patent = data;
        console.log('all patent', patent)
    }

})
.catch(error => console.error(error));
```

{% endtab %}

{% tab title="PHP" %}

```php
$accessToken = urlencode('<ACCESS TOKEN>');
$url = 'https://public-api.expertfile.com/v2/organization/:corporation/expert/:username/patent';

$ch = curl_init($url);
curl_setopt(
    $ch,
    CURLOPT_HTTPHEADER,
    array('Content-Type: application/x-www-form-urlencoded', 'Authorization: Bearer ' . $accessToken)
);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);

$response = curl_exec($ch);
$json = json_decode($response);

if($json->success){
    var_dump($json->data);
}

curl_close($ch);

```

{% endtab %}

{% tab title="Curl" %}

```
curl https://public-api.expertfile.com/v2/organization/:corporation/expert/:username/patent \
    -H "Content-Type: application/json" \
    -H "Authorization: Bearer <ACCESS TOKEN>"
```

{% endtab %}
{% endtabs %}

## Get Individual Patent

<mark style="color:green;">`GET`</mark>[ **/v2/organization/:corporation/expert/:username/patent/:id**](https://public-api.expertfile.com/v2/organization/:corporation/expert/:username/patent/:id)

**Headers**

| Name          | Value              |
| ------------- | ------------------ |
| Content-Type  | `application/json` |
| Authorization | `Bearer <token>`   |

**Url**

<table><thead><tr><th width="339.3333333333333">Name</th><th>Type</th><th>Description</th></tr></thead><tbody><tr><td>corporation</td><td>number</td><td>Corporation ID</td></tr><tr><td>username</td><td>string</td><td>Unique username</td></tr><tr><td>id</td><td>number</td><td>Patent ID</td></tr></tbody></table>

**Response**

{% tabs %}
{% tab title="200" %}

```json
 {
  data: [
    {
      id: 1,
      title: 'Patent Title',
      detail: 'Patent Details',
      number: '#124',
      date: 0,
      url: 'https://patent.com'
    },
  ],
  success: true
}
```

{% endtab %}
{% endtabs %}

Code

{% tabs %}
{% tab title="Node" %}

```javascript
const accessToken = `<ACCESS CODE>`

fetch('https://public-api.expertfile.com/v2/organization/:corporation/expert/:username/patent/:id', {
    method: 'GET',
    headers: {
        'Content-Type': 'application/x-www-form-urlencoded',
        'Authorization': `Bearer ${accessToken}`
    }
})
.then(response => response.json())
.then(json => {
    const { success, data, error } = json

    if (success) {
        console.log('patent', data)
    }

})
.catch(error => console.error(error));
```

{% endtab %}

{% tab title="PHP" %}

```php
$accessToken = urlencode('<ACCESS TOKEN>');
$url = 'https://public-api.expertfile.com/v2/organization/:corporation/expert/:username/patent/:id';

$ch = curl_init($url);
curl_setopt(
    $ch,
    CURLOPT_HTTPHEADER,
    array('Content-Type: application/x-www-form-urlencoded', 'Authorization: Bearer ' . $accessToken)
);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);

$response = curl_exec($ch);
$json = json_decode($response);

if($json->success){
    var_dump($json->data);
}

curl_close($ch);
```

{% endtab %}

{% tab title="Curl" %}

```
curl -X GET https://public-api.expertfile.com/v2/organization/:corporation/expert/:username/patent/:id \
    -H "Content-Type: application/json" \
    -H "Authorization: Bearer <ACCESS TOKEN>"     
```

{% endtab %}
{% endtabs %}

## Create Patent

<mark style="color:blue;">`POST`</mark> [**/v2/organization/:corporation/expert/:username/patent**](https://public-api.expertfile.com/v2/organization/:corporation/expert/:username/patent/)

**Headers**

| Name          | Value              |
| ------------- | ------------------ |
| Content-Type  | `application/json` |
| Authorization | `Bearer <token>`   |

**Url**

<table><thead><tr><th width="339.3333333333333">Name</th><th>Type</th><th>Description</th></tr></thead><tbody><tr><td>corporation</td><td>number</td><td>Corporation ID</td></tr><tr><td>username</td><td>string</td><td>Unique username</td></tr></tbody></table>

**Body**

<table><thead><tr><th width="339.3333333333333">Name</th><th>Type</th><th>Description</th></tr></thead><tbody><tr><td>number<mark style="color:red;">*</mark></td><td>string</td><td>Patent Number</td></tr><tr><td>title<mark style="color:red;">*</mark></td><td>string</td><td>Patent Title</td></tr><tr><td>detail<mark style="color:red;">*</mark></td><td>string</td><td>Patent Detail</td></tr><tr><td>date</td><td>unix timestamp</td><td>Patent Date</td></tr><tr><td>url</td><td>string</td><td>Url of Patent</td></tr></tbody></table>

**Response**

{% tabs %}
{% tab title="200" %}

```json
{ 
    data: { 
        id: 1
    }, 
    success: true 
}
```

{% endtab %}
{% endtabs %}

Code

{% tabs %}
{% tab title="Node" %}

```javascript
const data = new URLSearchParams();
const accessToken = `<ACCESS TOKEN>`

data.append('number', '#1234');
data.append('title', 'Patent Title');
data.append('detail', 'Patent Details');
data.append('date', 1702530000);
data.append('url', 'https://myurl.com');

fetch('https://public-api.expertfile.com/v2/organization/:corporation/expert/:username/patent', {
    method: 'POST',
    headers: {
        'Content-Type': 'application/x-www-form-urlencoded',
        'Authorization': `Bearer ${accessToken}`
    },
    body: data
})
.then(response => response.json())
.then(json => {
    const { success, data, error } = json

    if (success) {
        const { id } = data
        console.log('New patent id', id)
    }

})
.catch(error => console.error(error));
```

{% endtab %}

{% tab title="PHP" %}

```php
$accessToken = urlencode('<ACCESS TOKEN>');

$url = 'https://public-api.expertfile.com/v2/organization/:corporation/expert/:username/patent';
$data = ['number' => '#1234', 'title' => 'Patent Title', 'detail' => 'Patent Details', 'date' => 1702530000, 'url' => 'https://myurl.com'];

$ch = curl_init($url);
curl_setopt(
    $ch,
    CURLOPT_HTTPHEADER,
    array('Content-Type: application/x-www-form-urlencoded', 'Authorization: Bearer ' . $accessToken)
);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_POSTFIELDS, http_build_query($data));

$response = curl_exec($ch);
$json = json_decode($response);

if($json->success){
    var_dump($json->data);
}

curl_close($ch)
```

{% endtab %}

{% tab title="Curl" %}

```
curl -X POST https://public-api.expertfile.com/v2/organization/:corporation/expert/:username/patent \
    -H "Content-Type: application/json" \
    -H "Authorization: Bearer <ACCESS TOKEN>" \
    -d '{"number": "#1234", "title": "Patent Title", "detail": "Patent Details", "date": 1702530000, "url": "https://myurl.com"}'
```

{% endtab %}
{% endtabs %}

## Update Patent

<mark style="color:blue;">`PUT`</mark> [**/v2/organization/:corporation/expert/:username/patent/:id**](https://public-api.expertfile.com/v2/organization/:corporation/expert/:username/patent/:id)

**Headers**

| Name          | Value              |
| ------------- | ------------------ |
| Content-Type  | `application/json` |
| Authorization | `Bearer <token>`   |

**Url**

<table><thead><tr><th width="339.3333333333333">Name</th><th>Type</th><th>Description</th></tr></thead><tbody><tr><td>corporation</td><td>number</td><td>Corporation ID</td></tr><tr><td>username</td><td>string</td><td>Unique username</td></tr><tr><td>id</td><td>number</td><td>Patent ID</td></tr></tbody></table>

**Body**

<table><thead><tr><th width="339.3333333333333">Name</th><th>Type</th><th>Description</th></tr></thead><tbody><tr><td>number<mark style="color:red;">*</mark></td><td>string</td><td>Patent Number</td></tr><tr><td>title<mark style="color:red;">*</mark></td><td>string</td><td>Patent Title</td></tr><tr><td>detail<mark style="color:red;">*</mark></td><td>string</td><td>Patent Detail</td></tr><tr><td>date</td><td>unix timestamp</td><td>Patent Date</td></tr><tr><td>url</td><td>string</td><td>Url of Patent</td></tr></tbody></table>

**Response**

{% tabs %}
{% tab title="200" %}

```json
{ 
    data: { 
        id: 1, 
        updated: true 
    }, 
    success: true 
}
```

{% endtab %}
{% endtabs %}

Code

{% tabs %}
{% tab title="Node" %}

```javascript
const data = new URLSearchParams();
const accessToken = `<ACCESS TOKEN>`

data.append('number', '#1234');
data.append('title', 'Patent Title');
data.append('detail', 'Patent Details');
data.append('date', 1702530000);
data.append('url', 'https://myurl.com');

fetch('https://public-api.expertfile.com/v2/organization/:corporation/expert/:username/patent/:id', {
    method: 'PUT',
    headers: {
        'Content-Type': 'application/x-www-form-urlencoded',
        'Authorization': `Bearer ${accessToken}`
    },
    body: data
})
.then(response => response.json())
.then(json => {
    const { success, data, error } = json

    if (success) {
        const { id } = data
        console.log('New patent id', id)
    }

})
.catch(error => console.error(error));

```

{% endtab %}

{% tab title="PHP" %}

```php
$accessToken = urlencode('<ACCESS TOKEN>');

$url = 'https://public-api.expertfile.com/v2/organization/:corporation/expert/:username/patent/:id';
$data = ['number' => '#1234', 'title' => 'Patent Title', 'detail' => 'Patent Details', 'date' => 1702530000, 'url' => 'https://myurl.com'];

$ch = curl_init($url);
curl_setopt(
    $ch,
    CURLOPT_HTTPHEADER,
    array('Content-Type: application/x-www-form-urlencoded', 'Authorization: Bearer ' . $accessToken)
);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_PUT, http_build_query($data));

$response = curl_exec($ch);
$json = json_decode($response);

if($json->success){
    var_dump($json->data);
}

curl_close($ch)
```

{% endtab %}

{% tab title="Curl" %}

```
curl -X PUT https://public-api.expertfile.com/v2/organization/:corporation/expert/:username/patent/:id \
    -H "Content-Type: application/json" \
    -H "Authorization: Bearer <ACCESS TOKEN>" \
    -d '{"number": "#1234", "title": "Patent Title", "detail": "Patent Details", "date": 1702530000, "url": "https://myurl.com"}'
```

{% endtab %}
{% endtabs %}

## Delete Patent

<mark style="color:red;">`DELETE`</mark> [**/v2/organization/:corporation/expert/:username/patent/:id**](https://public-api.expertfile.com/v2/organization/:corporation/expert/:username/patent/:id)

**Headers**

| Name          | Value              |
| ------------- | ------------------ |
| Content-Type  | `application/json` |
| Authorization | `Bearer <token>`   |

**Url**

<table><thead><tr><th width="339.3333333333333">Name</th><th>Type</th><th>Description</th></tr></thead><tbody><tr><td>corporation</td><td>number</td><td>Corporation ID</td></tr><tr><td>username</td><td>string</td><td>Unique username</td></tr><tr><td>id</td><td>number</td><td>Patent ID</td></tr></tbody></table>

**Response**

{% tabs %}
{% tab title="200" %}

```json
{ 
    data: { 
        deleted: true, 
        id: 1 
    }, 
    success: true 
}
```

{% endtab %}
{% endtabs %}

Code

{% tabs %}
{% tab title="Node" %}

```javascript
const accessToken = `<ACCESS TOKEN>`

fetch('https://public-api.expertfile.com/v2/organization/:corporation/expert/:username/patent/:id', {
    method: 'DELETE',
    headers: {
        'Content-Type': 'application/x-www-form-urlencoded',
        'Authorization': `Bearer ${accessToken}`
    }
})
.then(response => response.json())
.then(json => {
    const { success, data, error } = json

    if (success) {
        const { id } = data
        console.log('Deleted patent id', id)
    }

})
.catch(error => console.error(error));

```

{% endtab %}

{% tab title="PHP" %}

```php
$accessToken = urlencode('<ACCESS TOKEN>');

$url = 'https://public-api.expertfile.com/v2/organization/:corporation/expert/:username/testimonial/:id';

$ch = curl_init($url);
curl_setopt(
    $ch,
    CURLOPT_HTTPHEADER,
    array('Content-Type: application/x-www-form-urlencoded', 'Authorization: Bearer ' . $accessToken)
);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_CUSTOMREQUEST, "DELETE");

$response = curl_exec($ch);
$json = json_decode($response);

if($json->success){
    var_dump($json->data);
}

curl_close($ch);
```

{% endtab %}

{% tab title="Curl" %}

```
curl -X DELETE https://public-api.expertfile.com/v2/organization/:corporation/expert/:username/testimonial/:id \
    -H "Content-Type: application/json" \
    -H "Authorization: Bearer <ACCESS TOKEN>"
```

{% endtab %}
{% endtabs %}


# Research Focus

CRUD endpoints for a user's research focuses

{% hint style="info" %}
Please note that in all urls & code samples you'll need to replace`:username` and `:corporation` with appropriate values
{% endhint %}

## Get All Research Focuses

<mark style="color:green;">`GET`</mark> [**/v2/organization/:corporation/expert/:username/researchfocus**](https://public-api.expertfile.com/v2/organization/:corporation/expert/:username/researchfocus/)

**Headers**

| Name          | Value              |
| ------------- | ------------------ |
| Content-Type  | `application/json` |
| Authorization | `Bearer <token>`   |

**Url**

<table><thead><tr><th width="339.3333333333333">Name</th><th>Type</th><th>Description</th></tr></thead><tbody><tr><td>corporation</td><td>number</td><td>Corporation ID</td></tr><tr><td>username</td><td>string</td><td>Unique username</td></tr></tbody></table>

**Response**

{% tabs %}
{% tab title="200" %}

```json
{
  data: [
    {
      id: 1,
      title: 'Research Focus title',
      subtitle: 'Research Focus subtitle',
      details: 'Details',
      date: 0,
      url: 'https://myurl.com',
      cover_url: 'img_url',
      large_cover_url: 'img_url',
      cover_alt_title: 'Alt Image Title:'
    },
  ],
  success: true
}
```

{% endtab %}
{% endtabs %}

Code

{% tabs %}
{% tab title="Node" %}

```javascript
const accessToken = `<ACCESS TOKEN>`

fetch('https://public-api.expertfile.com/v2/organization/:corporation/expert/:username/researchfocus', {
    method: 'GET',
    headers: {
        'Content-Type': 'application/x-www-form-urlencoded',
        'Authorization': `Bearer ${accessToken}`
    }
})
.then(response => response.json())
.then(json => {
    const { success, data } = json

    if (success) {
        const focuses = data;
        console.log('all focus', focuses)
    }

})
.catch(error => console.error(error));
```

{% endtab %}

{% tab title="PHP" %}

```php
$accessToken = urlencode('<ACCESS TOKEN>');
$url = 'https://public-api.expertfile.com/v2/organization/:corporation/expert/:username/researchfocus';

$ch = curl_init($url);
curl_setopt(
    $ch,
    CURLOPT_HTTPHEADER,
    array('Content-Type: application/x-www-form-urlencoded', 'Authorization: Bearer ' . $accessToken)
);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);

$response = curl_exec($ch);
$json = json_decode($response);

if($json->success){
    var_dump($json->data);
}

curl_close($ch);

```

{% endtab %}

{% tab title="Curl" %}

```
curl https://public-api.expertfile.com/v2/organization/:corporation/expert/:username/researchfocus \
    -H "Content-Type: application/json" \
    -H "Authorization: Bearer <ACCESS TOKEN>"
```

{% endtab %}
{% endtabs %}

## Get Individual Research Focus

<mark style="color:green;">`GET`</mark> [**/v2/organization/:corporation/expert/:username/researchfocus/:id**](https://public-api.expertfile.com/v2/organization/:corporation/expert/:username/researchfocus/:id)

**Headers**

<table><thead><tr><th width="247">Name</th><th>Value</th></tr></thead><tbody><tr><td>Content-Type</td><td><code>application/json</code></td></tr><tr><td>Authorization</td><td><code>Bearer &#x3C;token></code></td></tr></tbody></table>

**Url**

<table><thead><tr><th width="339.3333333333333">Name</th><th>Type</th><th>Description</th></tr></thead><tbody><tr><td>corporation</td><td>number</td><td>Corporation ID</td></tr><tr><td>username</td><td>string</td><td>Unique username</td></tr><tr><td>id</td><td>number</td><td>Research Focus ID</td></tr></tbody></table>

**Response**

{% tabs %}
{% tab title="200" %}

```json
{
  data: [
    {
      id: 1,
      title: 'Research Focus title',
      subtitle: 'Research Focus subtitle',
      details: 'Details',
      date: 0,
      url: 'https://myurl.com',
      cover_url: 'img_url',
      large_cover_url: 'img_url',
      cover_alt_title: 'Alt Image Title:'
    },
  ],
  success: true
}
```

{% endtab %}
{% endtabs %}

Code

{% tabs %}
{% tab title="Node" %}

<pre class="language-javascript"><code class="lang-javascript"><strong>const accessToken = `&#x3C;ACCESS TOKEN>`
</strong>
fetch('https://public-api.expertfile.com/v2/organization/:corporation/expert/:username/reseachfocus/:id', {
    method: 'GET',
    headers: {
        'Content-Type': 'application/x-www-form-urlencoded',
        'Authorization': `Bearer ${accessToken}`
    }
})
.then(response => response.json())
.then(json => {
    const { success, data } = json

    if (success) {
        const focus = data;
        console.log('focus', focus)
    }

})
.catch(error => console.error(error));
</code></pre>

{% endtab %}

{% tab title="PHP" %}

```php
$accessToken = urlencode('<ACCESS TOKEN>');
$url = 'https://public-api.expertfile.com/v2/organization/:corporation/expert/:username/reseachfocus/:id';

$ch = curl_init($url);
curl_setopt(
    $ch,
    CURLOPT_HTTPHEADER,
    array('Content-Type: application/x-www-form-urlencoded', 'Authorization: Bearer ' . $accessToken)
);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);

$response = curl_exec($ch);
$json = json_decode($response);

if($json->success){
    var_dump($json->data);
}

curl_close($ch);
```

{% endtab %}

{% tab title="Curl" %}

```
curl -X GET https://public-api.expertfile.com/v2/organization/:corporation/expert/:username/reseachfocus/:id \
    -H "Content-Type: application/json" \
    -H "Authorization: Bearer <ACCESS TOKEN>"     
```

{% endtab %}
{% endtabs %}

## Create Research Focus

<mark style="color:blue;">`POST`</mark> [**/v2/organization/:corporation/expert/:username/researchfocus**](https://public-api.expertfile.com/v2/organization/:corporation/expert/:username/researchfocus/)

**Headers**

| Name          | Value              |
| ------------- | ------------------ |
| Content-Type  | `application/json` |
| Authorization | `Bearer <token>`   |

**Url**

<table><thead><tr><th width="339.3333333333333">Name</th><th>Type</th><th>Description</th></tr></thead><tbody><tr><td>corporation</td><td>number</td><td>Corporation ID</td></tr><tr><td>username</td><td>string</td><td>Unique username</td></tr></tbody></table>

**Body**

<table><thead><tr><th width="339.3333333333333">Name</th><th>Type</th><th>Description</th></tr></thead><tbody><tr><td>title<mark style="color:red;">*</mark></td><td>string</td><td>Research Focus Title</td></tr><tr><td>details<mark style="color:red;">*</mark></td><td>string</td><td>Research Focus Details</td></tr><tr><td>url</td><td>string</td><td>Research Focus Url</td></tr><tr><td>subtitle</td><td>string</td><td>Research Focus Subtitle</td></tr><tr><td>date</td><td>unix timestamp</td><td>Research Focus Date</td></tr></tbody></table>

**Response**

{% tabs %}
{% tab title="200" %}

```json
{ 
    data: { 
        id: 1
    }, 
    success: true 
}
```

{% endtab %}
{% endtabs %}

Code

{% tabs %}
{% tab title="Node" %}

```javascript
const data = new URLSearchParams();
const accessToken = `<ACCESS TOKEN>`

data.append('title', 'Focus title');
data.append('details', 'Focus details...');
data.append('url', 'https://myurl.com');
data.append('subtitle', 'Focus subtitle');
data.append('date', 1703653200);

fetch('https://public-api.expertfile.com/v2/organization/:corporation/expert/:username/researchfocus', {
    method: 'POST',
    headers: {
        'Content-Type': 'application/x-www-form-urlencoded',
        'Authorization': `Bearer ${accessToken}`
    },
    body: data
})
.then(response => response.json())
.then(json => {
    const { success, data, error } = json

    if (success) {
        const { id } = data
        console.log('New focus id', id)
    }

})
.catch(error => console.error(error));
```

{% endtab %}

{% tab title="PHP" %}

```php
$accessToken = urlencode('<ACCESS TOKEN>');

$url = 'https://public-api.expertfile.com/v2/organization/:corporation/expert/:username/researchfocus';
$data = ['title' => 'Focus title', 'details' => 'Focus details...', 'url' => 'https://myurl.com', 'subtitle' => 'Focus subtitle', 'date' => 1703653200];

$ch = curl_init($url);
curl_setopt(
    $ch,
    CURLOPT_HTTPHEADER,
    array('Content-Type: application/x-www-form-urlencoded', 'Authorization: Bearer ' . $accessToken)
);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_POSTFIELDS, http_build_query($data));

$response = curl_exec($ch);
$json = json_decode($response);

if($json->success){
    var_dump($json->data);
}

curl_close($ch)
```

{% endtab %}

{% tab title="Curl" %}

```
curl -X POST https://public-api.expertfile.com/v2/organization/:corporation/expert/:username/researchfocus \
    -H "Content-Type: application/json" \
    -H "Authorization: Bearer <ACCESS TOKEN>" \
    -d '{"title": "Focus title", "details": "Focus details...", "url": "https://myurl.com", "subtitle": "Focus subtitle", "date":1703653200}'
```

{% endtab %}
{% endtabs %}

## Update Research Focus

<mark style="color:blue;">`PUT`</mark> [**/v2/organization/:corporation/expert/:username/researchfocus/:id**](https://public-api.expertfile.com/v2/organization/:corporation/expert/:username/researchfocus/:id)

**Headers**

| Name          | Value              |
| ------------- | ------------------ |
| Content-Type  | `application/json` |
| Authorization | `Bearer <token>`   |

**Url**

<table><thead><tr><th width="339.3333333333333">Name</th><th>Type</th><th>Description</th></tr></thead><tbody><tr><td>corporation</td><td>number</td><td>Corporation ID</td></tr><tr><td>username</td><td>string</td><td>Unique username</td></tr><tr><td>id</td><td>number</td><td>Research Focus ID</td></tr></tbody></table>

**Body**

<table><thead><tr><th width="339.3333333333333">Name</th><th>Type</th><th>Description</th></tr></thead><tbody><tr><td>title<mark style="color:red;">*</mark></td><td>string</td><td>Research Focus Title</td></tr><tr><td>details<mark style="color:red;">*</mark></td><td>string</td><td>Research Focus Details</td></tr><tr><td>url</td><td>string</td><td>Research Focus Url</td></tr><tr><td>subtitle</td><td>string</td><td>Research Focus Subtitle</td></tr><tr><td>date</td><td>unix timestamp</td><td>Research Focus Date</td></tr></tbody></table>

**Response**

{% tabs %}
{% tab title="200" %}

```json
{ 
    data: { 
        id: 1, 
        updated: true 
    }, 
    success: true 
}
```

{% endtab %}
{% endtabs %}

Code

{% tabs %}
{% tab title="Node" %}

```javascript
const data = new URLSearchParams();
const accessToken = `<ACCESS TOKEN>`

data.append('title', 'Focus title');
data.append('details', 'Focus details...');
data.append('url', 'https://myurl.com');
data.append('subtitle', 'Focus subtitle');
data.append('date', 1703653200);

fetch('https://public-api.expertfile.com/v2/organization/:corporation/expert/:username/researchfocus/:id', {
    method: 'PUT',
    headers: {
        'Content-Type': 'application/x-www-form-urlencoded',
        'Authorization': `Bearer ${accessToken}`
    },
    body: data
})
.then(response => response.json())
.then(json => {
    const { success, data, error } = json

    if (success) {
        const { id } = data
        console.log('New focus id', id)
    }

})
.catch(error => console.error(error));

```

{% endtab %}

{% tab title="PHP" %}

```php
$accessToken = urlencode('<ACCESS TOKEN>');

$url = 'https://public-api.expertfile.com/v2/organization/:corporation/expert/:username/researchfocus/:id';
$data = ['title' => 'Focus title', 'details' => 'Focus details...', 'url' => 'https://myurl.com', 'subtitle' => 'Focus subtitle', 'date' => 1703653200];

$ch = curl_init($url);
curl_setopt(
    $ch,
    CURLOPT_HTTPHEADER,
    array('Content-Type: application/x-www-form-urlencoded', 'Authorization: Bearer ' . $accessToken)
);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_PUT, http_build_query($data));

$response = curl_exec($ch);
$json = json_decode($response);

if($json->success){
    var_dump($json->data);
}

curl_close($ch)
```

{% endtab %}

{% tab title="Curl" %}

```
curl -X PUT https://public-api.expertfile.com/v2/organization/:corporation/expert/:username/researchfocus/:id \
    -H "Content-Type: application/json" \
    -H "Authorization: Bearer <ACCESS TOKEN>" \
    -d '{"title": "Focus title", "details": "Focus details...", "url": "https://myurl.com", "subtitle": "Focus subtitle", "date":1703653200}'
```

{% endtab %}
{% endtabs %}

## Delete Research Focus

<mark style="color:red;">`DELETE`</mark> [**/v2/organization/:corporation/expert/:username/researchfocus/:id**](https://public-api.expertfile.com/v2/organization/:corporation/expert/:username/researchfocus/:id)

**Headers**

| Name          | Value              |
| ------------- | ------------------ |
| Content-Type  | `application/json` |
| Authorization | `Bearer <token>`   |

**Url**

<table><thead><tr><th width="339.3333333333333">Name</th><th>Type</th><th>Description</th></tr></thead><tbody><tr><td>corporation</td><td>number</td><td>Corporation ID</td></tr><tr><td>username</td><td>string</td><td>Unique username</td></tr><tr><td>id</td><td>number</td><td>Research Focus ID</td></tr></tbody></table>

**Response**

{% tabs %}
{% tab title="200" %}

```json
{ 
    data: { 
        deleted: true, 
        id: 1 
    }, 
    success: true 
}
```

{% endtab %}
{% endtabs %}

Code

{% tabs %}
{% tab title="Node" %}

```javascript
const accessToken = `<ACCESS TOKEN>`

fetch('https://public-api.expertfile.com/v2/organization/:corporation/expert/:username/researchfocus/:id', {
    method: 'DELETE',
    headers: {
        'Content-Type': 'application/x-www-form-urlencoded',
        'Authorization': `Bearer ${accessToken}`
    }
})
.then(response => response.json())
.then(json => {
    const { success, data, error } = json

    if (success) {
        const { id } = data
        console.log('Deleted research focus id', id)
    }

})
.catch(error => console.error(error));

```

{% endtab %}

{% tab title="PHP" %}

```php
$accessToken = urlencode('<ACCESS TOKEN>');

$url = 'https://public-api.expertfile.com/v2/organization/:corporation/expert/:username/researchfocus/:id';

$ch = curl_init($url);
curl_setopt(
    $ch,
    CURLOPT_HTTPHEADER,
    array('Content-Type: application/x-www-form-urlencoded', 'Authorization: Bearer ' . $accessToken)
);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_CUSTOMREQUEST, "DELETE");

$response = curl_exec($ch);
$json = json_decode($response);

if($json->success){
    var_dump($json->data);
}

curl_close($ch);
```

{% endtab %}

{% tab title="Curl" %}

```
curl -X DELETE https://public-api.expertfile.com/v2/organization/:corporation/expert/:username/researchfocus/:id \
    -H "Content-Type: application/json" \
    -H "Authorization: Bearer <ACCESS TOKEN>"
```

{% endtab %}
{% endtabs %}


# Research Grants

CRUD endpoints for a user's research grants

{% hint style="info" %}
Please note that in all urls & code samples you'll need to replace`:username` and `:corporation` with appropriate values
{% endhint %}

## Get All Research Grants

<mark style="color:green;">`GET`</mark> [**/v2/organization/:corporation/expert/:username/researchgrant**](https://public-api.expertfile.com/v2/organization/:corporation/expert/:username/researchgrant/)

**Headers**

| Name          | Value              |
| ------------- | ------------------ |
| Content-Type  | `application/json` |
| Authorization | `Bearer <token>`   |

**Url**

<table><thead><tr><th width="339.3333333333333">Name</th><th>Type</th><th>Description</th></tr></thead><tbody><tr><td>corporation</td><td>number</td><td>Corporation ID</td></tr><tr><td>username</td><td>string</td><td>Unique username</td></tr></tbody></table>

**Response**

{% tabs %}
{% tab title="200" %}

```json
 {
  data: [
    {
      id: 1,
      title: 'Research Grant Title',
      organization: 'Organization',
      url: 'https://grant.com',
      details: 'Details',
      date: 0,
      amount: '10',
      currency: '$'
    },
  ],
  success: true
}
```

{% endtab %}
{% endtabs %}

Code

{% tabs %}
{% tab title="Node" %}

```javascript
const data = new URLSearchParams();
const accessToken = `<ACCESS TOKEN>`

fetch('https://public-api.expertfile.com/v2/organization/:corporation/expert/:username/researchgrant', {
    method: 'GET',
    headers: {
        'Content-Type': 'application/x-www-form-urlencoded',
        'Authorization': `Bearer ${accessToken}`
    }
})
.then(response => response.json())
.then(json => {
    const { success, data } = json

    if (success) {
        const grants = data;
        console.log('all grants', grants)
    }

})
.catch(error => console.error(error));
```

{% endtab %}

{% tab title="PHP" %}

```php
$accessToken = urlencode('<ACCESS TOKEN>');
$url = 'https://public-api.expertfile.com/v2/organization/:corporation/expert/:username/researchgrant';

$ch = curl_init($url);
curl_setopt(
    $ch,
    CURLOPT_HTTPHEADER,
    array('Content-Type: application/x-www-form-urlencoded', 'Authorization: Bearer ' . $accessToken)
);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);

$response = curl_exec($ch);
$json = json_decode($response);

if($json->success){
    var_dump($json->data);
}

curl_close($ch);

```

{% endtab %}

{% tab title="Curl" %}

```
curl https://public-api.expertfile.com/v2/organization/:corporation/expert/:username/researchgrant \
    -H "Content-Type: application/json" \
    -H "Authorization: Bearer <ACCESS TOKEN>"
```

{% endtab %}
{% endtabs %}

## Get Individual Research Grant

<mark style="color:green;">`GET`</mark> [**/v2/organization/:corporation/expert/:username/researchgrant/:id**](https://public-api.expertfile.com/v2/organization/:corporation/expert/:username/researchgrant/:id)

**Headers**

| Name          | Value              |
| ------------- | ------------------ |
| Content-Type  | `application/json` |
| Authorization | `Bearer <token>`   |

**Url**

<table><thead><tr><th width="339.3333333333333">Name</th><th>Type</th><th>Description</th></tr></thead><tbody><tr><td>corporation</td><td>number</td><td>Corporation ID</td></tr><tr><td>username</td><td>string</td><td>Unique username</td></tr><tr><td>id</td><td>number</td><td>Research Grant ID</td></tr></tbody></table>

**Response**

{% tabs %}
{% tab title="200" %}

```json
 {
  data: [
    {
      id: 1,
      title: 'Research Grant Title',
      organization: 'Organization',
      url: 'https://grant.com',
      details: 'Details',
      date: 0,
      amount: '10',
      currency: '$'
    },
  ],
  success: true
}
```

{% endtab %}
{% endtabs %}

Code

{% tabs %}
{% tab title="Node" %}

```javascript
const accessToken = `<ACCESS CODE>`

fetch('https://public-api.expertfile.com/v2/organization/:corporation/expert/:username/researchgrant/:id', {
    method: 'GET',
    headers: {
        'Content-Type': 'application/x-www-form-urlencoded',
        'Authorization': `Bearer ${accessToken}`
    }
})
.then(response => response.json())
.then(json => {
    const { success, data, error } = json

    if (success) {
        console.log('grant', data)
    }

})
.catch(error => console.error(error));
```

{% endtab %}

{% tab title="PHP" %}

```php
$accessToken = urlencode('<ACCESS TOKEN>');
$url = 'https://public-api.expertfile.com/v2/organization/:corporation/expert/:username/researchgrant/:id';

$ch = curl_init($url);
curl_setopt(
    $ch,
    CURLOPT_HTTPHEADER,
    array('Content-Type: application/x-www-form-urlencoded', 'Authorization: Bearer ' . $accessToken)
);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);

$response = curl_exec($ch);
$json = json_decode($response);

if($json->success){
    var_dump($json->data);
}

curl_close($ch);
```

{% endtab %}

{% tab title="Curl" %}

```
curl -X GET https://public-api.expertfile.com/v2/organization/:corporation/expert/:username/researchgrant/:id \
    -H "Content-Type: application/json" \
    -H "Authorization: Bearer <ACCESS TOKEN>"     
```

{% endtab %}
{% endtabs %}

## Create Research Grant

<mark style="color:blue;">`POST`</mark> [**/v2/organization/:corporation/expert/:username/researchgrant**](https://public-api.expertfile.com/v2/organization/:corporation/expert/:username/researchgrant/)

**Headers**

| Name          | Value              |
| ------------- | ------------------ |
| Content-Type  | `application/json` |
| Authorization | `Bearer <token>`   |

**Url**

<table><thead><tr><th width="339.3333333333333">Name</th><th>Type</th><th>Description</th></tr></thead><tbody><tr><td>corporation</td><td>number</td><td>Corporation ID</td></tr><tr><td>username</td><td>string</td><td>Unique username</td></tr></tbody></table>

**Body**

<table><thead><tr><th width="339.3333333333333">Name</th><th>Type</th><th>Description</th></tr></thead><tbody><tr><td>title<mark style="color:red;">*</mark></td><td>string</td><td>Grant Title</td></tr><tr><td>organization<mark style="color:red;">*</mark></td><td>string</td><td>Grant Organization</td></tr><tr><td>details<mark style="color:red;">*</mark></td><td>string</td><td>Grant Detail</td></tr><tr><td>date</td><td>unix timestamp</td><td>Grant Date</td></tr><tr><td>url</td><td>string</td><td>Grant Url</td></tr><tr><td>amount</td><td>string</td><td>Grant Amount</td></tr><tr><td>currency</td><td>string</td><td>Grant Currency</td></tr></tbody></table>

**Response**

{% tabs %}
{% tab title="200" %}

```json
{ 
    data: { 
        id: 1
    }, 
    success: true 
}
```

{% endtab %}
{% endtabs %}

Code

{% tabs %}
{% tab title="Node" %}

```javascript
const data = new URLSearchParams();
const accessToken = `<ACCESS TOKEN>`

data.append('title', 'Grant title');
data.append('organization', 'Grant organization');
data.append('details', 'Grant details...');
data.append('amount', '100');
data.append('currency', '$');
data.append('date', 1702530000);
data.append('url', 'https://myurl.com');

fetch('https://public-api.expertfile.com/v2/organization/:corporation/expert/:username/researchgrant', {
    method: 'POST',
    headers: {
        'Content-Type': 'application/x-www-form-urlencoded',
        'Authorization': `Bearer ${accessToken}`
    },
    body: data
})
.then(response => response.json())
.then(json => {
    const { success, data, error } = json

    if (success) {
        const { id } = data
        console.log('New grant id', id)
    }

})
.catch(error => console.error(error));
```

{% endtab %}

{% tab title="PHP" %}

```php
$accessToken = urlencode('<ACCESS TOKEN>');

$url = 'https://public-api.expertfile.com/v2/organization/:corporation/expert/:username/researchgrant';
$data = ['title' => 'Grant title', 'organization' => 'Grant organization', 'details' => 'Grant details...','amount' => '100','currency' => '$', 'date' => 1702530000, 'url' => 'https://myurl.com'];

$ch = curl_init($url);
curl_setopt(
    $ch,
    CURLOPT_HTTPHEADER,
    array('Content-Type: application/x-www-form-urlencoded', 'Authorization: Bearer ' . $accessToken)
);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_POSTFIELDS, http_build_query($data));

$response = curl_exec($ch);
$json = json_decode($response);

if($json->success){
    var_dump($json->data);
}

curl_close($ch)
```

{% endtab %}

{% tab title="Curl" %}

```
curl -X POST https://public-api.expertfile.com/v2/organization/:corporation/expert/:username/researchgrant \
    -H "Content-Type: application/json" \
    -H "Authorization: Bearer <ACCESS TOKEN>" \
    -d '{"title": "Grant title", "organization": "Grant organization", "details": "Grant details...", "amount": "100", "currency": "$", "date": 1702530000, "url": "https://myurl.com"}'
```

{% endtab %}
{% endtabs %}

## Update Research Grant

<mark style="color:blue;">`PUT`</mark>[ **/v2/organization/:corporation/expert/:username/researchgrant/:id**](https://public-api.expertfile.com/v2/organization/:corporation/expert/:username/researchgrant/:id)

**Headers**

| Name          | Value              |
| ------------- | ------------------ |
| Content-Type  | `application/json` |
| Authorization | `Bearer <token>`   |

**Url**

<table><thead><tr><th width="339.3333333333333">Name</th><th>Type</th><th>Description</th></tr></thead><tbody><tr><td>corporation</td><td>number</td><td>Corporation ID</td></tr><tr><td>username</td><td>string</td><td>Unique username</td></tr><tr><td>id</td><td>number</td><td>Research Grant ID</td></tr></tbody></table>

**Body**

<table><thead><tr><th width="339.3333333333333">Name</th><th>Type</th><th>Description</th></tr></thead><tbody><tr><td>title<mark style="color:red;">*</mark></td><td>string</td><td>Grant Title</td></tr><tr><td>organization<mark style="color:red;">*</mark></td><td>string</td><td>Grant Organization</td></tr><tr><td>details<mark style="color:red;">*</mark></td><td>string</td><td>Grant Detail</td></tr><tr><td>date</td><td>unix timestamp</td><td>Grant Date</td></tr><tr><td>url</td><td>string</td><td>Grant Url</td></tr><tr><td>amount</td><td>string</td><td>Grant Amount</td></tr><tr><td>currency</td><td>string</td><td>Grant Currency</td></tr></tbody></table>

**Response**

{% tabs %}
{% tab title="200" %}

```json
{ 
    data: { 
        id: 1, 
        updated: true 
    }, 
    success: true 
}
```

{% endtab %}
{% endtabs %}

Code

{% tabs %}
{% tab title="Node" %}

```javascript
const data = new URLSearchParams();
const accessToken = `<ACCESS TOKEN>`

data.append('title', 'Grant title');
data.append('organization', 'Grant organization');
data.append('details', 'Grant details...');
data.append('amount', '100');
data.append('currency', '$');
data.append('date', 1702530000);
data.append('url', 'https://myurl.com');

fetch('https://public-api.expertfile.com/v2/organization/:corporation/expert/:username/researchgrant/:id', {
    method: 'PUT',
    headers: {
        'Content-Type': 'application/x-www-form-urlencoded',
        'Authorization': `Bearer ${accessToken}`
    },
    body: data
})
.then(response => response.json())
.then(json => {
    const { success, data, error } = json

    if (success) {
        const { id } = data
        console.log('New patent id', id)
    }

})
.catch(error => console.error(error));

```

{% endtab %}

{% tab title="PHP" %}

```php
$accessToken = urlencode('<ACCESS TOKEN>');

$url = 'https://public-api.expertfile.com/v2/organization/:corporation/expert/:username/researchgrant/:id';
$data = ['title' => 'Grant title', 'organization' => 'Grant organization', 'details' => 'Grant details...','amount' => '100','currency' => '$', 'date' => 1702530000, 'url' => 'https://myurl.com'];

$ch = curl_init($url);
curl_setopt(
    $ch,
    CURLOPT_HTTPHEADER,
    array('Content-Type: application/x-www-form-urlencoded', 'Authorization: Bearer ' . $accessToken)
);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_PUT, http_build_query($data));

$response = curl_exec($ch);
$json = json_decode($response);

if($json->success){
    var_dump($json->data);
}

curl_close($ch)
```

{% endtab %}

{% tab title="Curl" %}

```
curl -X PUT https://public-api.expertfile.com/v2/organization/:corporation/expert/:username/researchgrant/:id \
    -H "Content-Type: application/json" \
    -H "Authorization: Bearer <ACCESS TOKEN>" \
    -d '{"title": "Grant title", "organization": "Grant organization", "details": "Grant details...", "amount": "100", "currency": "$", "date": 1702530000, "url": "https://myurl.com"}'
```

{% endtab %}
{% endtabs %}

## Delete Research Grant

<mark style="color:red;">`DELETE`</mark> [**/v2/organization/:corporation/expert/:username/researchgrant/:id**](https://public-api.expertfile.com/v2/organization/:corporation/expert/:username/researchgrant/:id)

**Headers**

| Name          | Value              |
| ------------- | ------------------ |
| Content-Type  | `application/json` |
| Authorization | `Bearer <token>`   |

**Url**

<table><thead><tr><th width="339.3333333333333">Name</th><th>Type</th><th>Description</th></tr></thead><tbody><tr><td>corporation</td><td>number</td><td>Corporation ID</td></tr><tr><td>username</td><td>string</td><td>Unique username</td></tr><tr><td>id</td><td>number</td><td>Research Grant ID</td></tr></tbody></table>

**Response**

{% tabs %}
{% tab title="200" %}

```json
{ 
    data: { 
        deleted: true, 
        id: 1 
    }, 
    success: true 
}
```

{% endtab %}
{% endtabs %}

Code

{% tabs %}
{% tab title="Node" %}

```javascript
const accessToken = `<ACCESS TOKEN>`

fetch('https://public-api.expertfile.com/v2/organization/:corporation/expert/:username/researchgrant/:id', {
    method: 'DELETE',
    headers: {
        'Content-Type': 'application/x-www-form-urlencoded',
        'Authorization': `Bearer ${accessToken}`
    }
})
.then(response => response.json())
.then(json => {
    const { success, data, error } = json

    if (success) {
        const { id } = data
        console.log('Deleted grant id', id)
    }

})
.catch(error => console.error(error));

```

{% endtab %}

{% tab title="PHP" %}

```php
$accessToken = urlencode('<ACCESS TOKEN>');

$url = 'https://public-api.expertfile.com/v2/organization/:corporation/expert/:username/testimonial/:id';

$ch = curl_init($url);
curl_setopt(
    $ch,
    CURLOPT_HTTPHEADER,
    array('Content-Type: application/x-www-form-urlencoded', 'Authorization: Bearer ' . $accessToken)
);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_CUSTOMREQUEST, "DELETE");

$response = curl_exec($ch);
$json = json_decode($response);

if($json->success){
    var_dump($json->data);
}

curl_close($ch);
```

{% endtab %}

{% tab title="Curl" %}

```
curl -X DELETE https://public-api.expertfile.com/v2/organization/:corporation/expert/:username/testimonial/:id \
    -H "Content-Type: application/json" \
    -H "Authorization: Bearer <ACCESS TOKEN>"
```

{% endtab %}
{% endtabs %}


# Sample Talks

CRUD endpoints for a user's sample talks

{% hint style="info" %}
Please note that in all urls & code samples you'll need to replace`:username` and `:corporation` with appropriate values
{% endhint %}

## Get All Sample Talks

<mark style="color:green;">`GET`</mark> [**/v2/organization/:corporation/expert/:username/sampletalk**](https://public-api.expertfile.com/v2/organization/:corporation/expert/:username/sampletalk)

**Headers**

| Name          | Value              |
| ------------- | ------------------ |
| Content-Type  | `application/json` |
| Authorization | `Bearer <token>`   |

**Url**

<table><thead><tr><th width="339.3333333333333">Name</th><th>Type</th><th>Description</th></tr></thead><tbody><tr><td>corporation</td><td>number</td><td>Corporation ID</td></tr><tr><td>username</td><td>string</td><td>Unique username</td></tr></tbody></table>

**Response**

{% tabs %}
{% tab title="200" %}

```json
 {
  data: [
    {
      id: 1,
      title: "talk title",
      description: "talk description"
    }
  ],
  success: true
}
```

{% endtab %}
{% endtabs %}

Code

{% tabs %}
{% tab title="Node" %}

```javascript
const accessToken = `<ACCESS TOKEN>`

fetch('https://public-api.expertfile.com/v2/organization/:corporation/expert/:username/sampletalk', {
    method: 'GET',
    headers: {
        'Content-Type': 'application/x-www-form-urlencoded',
        'Authorization': `Bearer ${accessToken}`
    }
})
.then(response => response.json())
.then(json => {
    const { success, data } = json

    if (success) {
        const talks = data;
        console.log('all talks', talks)
    }

})
.catch(error => console.error(error));
```

{% endtab %}

{% tab title="PHP" %}

```php
$accessToken = urlencode('<ACCESS TOKEN>');
$url = 'https://public-api.expertfile.com/v2/organization/:corporation/expert/:username/sampletalk';

$ch = curl_init($url);
curl_setopt(
    $ch,
    CURLOPT_HTTPHEADER,
    array('Content-Type: application/x-www-form-urlencoded', 'Authorization: Bearer ' . $accessToken)
);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);

$response = curl_exec($ch);
$json = json_decode($response);

if($json->success){
    var_dump($json->data);
}

curl_close($ch);

```

{% endtab %}

{% tab title="Curl" %}

```
curl https://public-api.expertfile.com/v2/organization/:corporation/expert/:username/sampletalk \
    -H "Content-Type: application/json" \
    -H "Authorization: Bearer <ACCESS TOKEN>"
```

{% endtab %}
{% endtabs %}

## Get Individual Sample Talk

<mark style="color:green;">`GET`</mark> [**/v2/organization/:corporation/expert/:username/link/:id**](https://public-api.expertfile.com/v2/organization/:corporation/expert/:username/link/:id)

**Headers**

| Name          | Value              |
| ------------- | ------------------ |
| Content-Type  | `application/json` |
| Authorization | `Bearer <token>`   |

**Url**

<table><thead><tr><th width="339.3333333333333">Name</th><th>Type</th><th>Description</th></tr></thead><tbody><tr><td>corporation</td><td>number</td><td>Corporation ID</td></tr><tr><td>username</td><td>string</td><td>Unique username</td></tr><tr><td>id</td><td>number</td><td>Sample Talk ID</td></tr></tbody></table>

**Response**

{% tabs %}
{% tab title="200" %}

```json
{
  data: [
    {
      id: 1,
      title: "talk title",
      description: "talk description"
    }
  ],
  success: true
}
```

{% endtab %}
{% endtabs %}

Code

{% tabs %}
{% tab title="Node" %}

```javascript
const accessToken = `<ACCESS CODE>`

fetch('https://public-api.expertfile.com/v2/organization/:corporation/expert/:username/sampletalk/:id', {
    method: 'GET',
    headers: {
        'Content-Type': 'application/x-www-form-urlencoded',
        'Authorization': `Bearer ${accessToken}`
    }
})
.then(response => response.json())
.then(json => {
    const { success, data, error } = json

    if (success) {
        console.log('talk', data)
    }

})
.catch(error => console.error(error));
```

{% endtab %}

{% tab title="PHP" %}

```php
$accessToken = urlencode('<ACCESS TOKEN>');
$url = 'https://public-api.expertfile.com/v2/organization/:corporation/expert/:username/sampletalk/:id';

$ch = curl_init($url);
curl_setopt(
    $ch,
    CURLOPT_HTTPHEADER,
    array('Content-Type: application/x-www-form-urlencoded', 'Authorization: Bearer ' . $accessToken)
);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);

$response = curl_exec($ch);
$json = json_decode($response);

if($json->success){
    var_dump($json->data);
}

curl_close($ch);
```

{% endtab %}

{% tab title="Curl" %}

```
curl -X GET https://public-api.expertfile.com/v2/organization/:corporation/expert/:username/sampletalk/:id \
    -H "Content-Type: application/json" \
    -H "Authorization: Bearer <ACCESS TOKEN>"     
```

{% endtab %}
{% endtabs %}

## Create Sample Talk

<mark style="color:blue;">`POST`</mark> [**/v2/organization/:corporation/expert/:username/sampletalk**](https://public-api.expertfile.com/v2/organization/:corporation/expert/:username/sampletalk)

**Headers**

| Name          | Value              |
| ------------- | ------------------ |
| Content-Type  | `application/json` |
| Authorization | `Bearer <token>`   |

**Url**

<table><thead><tr><th width="339.3333333333333">Name</th><th>Type</th><th>Description</th></tr></thead><tbody><tr><td>corporation</td><td>number</td><td>Corporation ID</td></tr><tr><td>username</td><td>string</td><td>Unique username</td></tr></tbody></table>

**Body**

<table><thead><tr><th width="339.3333333333333">Name</th><th>Type</th><th>Description</th></tr></thead><tbody><tr><td>title<mark style="color:red;">*</mark></td><td>string</td><td>Sample Talk Title</td></tr><tr><td>description<mark style="color:red;">*</mark></td><td>string</td><td>Sample Talk Description</td></tr></tbody></table>

**Response**

{% tabs %}
{% tab title="200" %}

```json
{ 
    data: { 
        id: 1
    }, 
    success: true 
}
```

{% endtab %}
{% endtabs %}

Code

{% tabs %}
{% tab title="Node" %}

```javascript
const data = new URLSearchParams();
const accessToken = `<ACCESS TOKEN>`

data.append('title', 'My Talk Idea');
data.append('description', 'My talk is going to be about...');

fetch('https://public-api.expertfile.com/v2/organization/:corporation/expert/:username/sampletalk', {
    method: 'POST',
    headers: {
        'Content-Type': 'application/x-www-form-urlencoded',
        'Authorization': `Bearer ${accessToken}`
    },
    body: data
})
.then(response => response.json())
.then(json => {
    const { success, data, error } = json

    if (success) {
        const { id } = data
        console.log('New talk id', id)
    }

})
.catch(error => console.error(error));

```

{% endtab %}

{% tab title="PHP" %}

```php
$accessToken = urlencode('<ACCESS TOKEN>');

$url = 'https://public-api.expertfile.com/v2/organization/:corporation/expert/:username/sampletalk';
$data = ['title' => 'My Talk Idea', 'description' => 'My talk is going to be about...'];

$ch = curl_init($url);
curl_setopt(
    $ch,
    CURLOPT_HTTPHEADER,
    array('Content-Type: application/x-www-form-urlencoded', 'Authorization: Bearer ' . $accessToken)
);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_POSTFIELDS, http_build_query($data));

$response = curl_exec($ch);
$json = json_decode($response);

if($json->success){
    var_dump($json->data);
}

curl_close($ch);
```

{% endtab %}

{% tab title="Curl" %}

```
curl -X POST https://public-api.expertfile.com/v2/organization/:corporation/expert/:username/sampletalk \
    -H "Content-Type: application/json" \
    -H "Authorization: Bearer <ACCESS TOKEN>" \
    -d '{"title":"My Talk Idea", "description":"My talk is going to be about..."}'
```

{% endtab %}
{% endtabs %}

## Update Sample Talk

<mark style="color:blue;">`PUT`</mark> [**/v2/organization/:corporation/expert/:username/sampletalk/:id**](https://public-api.expertfile.com/v2/organization/:corporation/expert/:username/sampletalk/:id)

**Headers**

| Name          | Value              |
| ------------- | ------------------ |
| Content-Type  | `application/json` |
| Authorization | `Bearer <token>`   |

**Url**

<table><thead><tr><th width="339.3333333333333">Name</th><th>Type</th><th>Description</th></tr></thead><tbody><tr><td>corporation</td><td>number</td><td>Corporation ID</td></tr><tr><td>username</td><td>string</td><td>Unique username</td></tr><tr><td>id</td><td>number</td><td>Sample Talk ID</td></tr></tbody></table>

**Body**

<table><thead><tr><th width="339.3333333333333">Name</th><th>Type</th><th>Description</th></tr></thead><tbody><tr><td>title<mark style="color:red;">*</mark></td><td>string</td><td>Sample Talk Title</td></tr><tr><td>description<mark style="color:red;">*</mark></td><td>string</td><td>Sample Talk Description</td></tr></tbody></table>

**Response**

{% tabs %}
{% tab title="200" %}

```json
{ 
    data: { 
        id: 1, 
        updated: true 
    }, 
    success: true 
}
```

{% endtab %}
{% endtabs %}

Code

{% tabs %}
{% tab title="Node" %}

```javascript
const data = new URLSearchParams();
const accessToken = `<ACCESS TOKEN>`

data.append('title', 'My Talk Idea');
data.append('description', 'My talk is going to be about...');

fetch('https://public-api.expertfile.com/v2/organization/:corporation/expert/:username/sampletalk/:id', {
    method: 'PUT',
    headers: {
        'Content-Type': 'application/x-www-form-urlencoded',
        'Authorization': `Bearer ${accessToken}`
    },
    body: data
})
.then(response => response.json())
.then(json => {
    const { success, data, error } = json

    if (success) {
        const { id } = data
        console.log('Updated talk id', id)
    }

})
.catch(error => console.error(error));

```

{% endtab %}

{% tab title="PHP" %}

```php
$accessToken = urlencode('<ACCESS TOKEN>');

$url = 'https://public-api.expertfile.com/v2/organization/:corporation/expert/:username/sampletalk/:id';
$data = ['title' => 'My Talk Idea', 'description' => 'My talk is going to be about...'];

$ch = curl_init($url);
curl_setopt(
    $ch,
    CURLOPT_HTTPHEADER,
    array('Content-Type: application/x-www-form-urlencoded', 'Authorization: Bearer ' . $accessToken)
);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_PUT, http_build_query($data));

$response = curl_exec($ch);
$json = json_decode($response);

if($json->success){
    var_dump($json->data);
}

curl_close($ch);
```

{% endtab %}

{% tab title="Curl" %}

```
curl -X PUT https://public-api.expertfile.com/v2/organization/:corporation/expert/:username/sampletalk/:id \
    -H "Content-Type: application/json" \
    -H "Authorization: Bearer <ACCESS TOKEN>" \
    -d '{"title":"My Talk Idea", "description":"My talk is going to be about..."}'
```

{% endtab %}
{% endtabs %}

## Delete Sample Talk

<mark style="color:red;">`DELETE`</mark> [**/v2/organization/:corporation/expert/:username/sampletalk/:id**](https://public-api.expertfile.com/v2/organization/:corporation/expert/:username/sampletalk/:id)

**Headers**

| Name          | Value              |
| ------------- | ------------------ |
| Content-Type  | `application/json` |
| Authorization | `Bearer <token>`   |

**Url**

<table><thead><tr><th width="339.3333333333333">Name</th><th>Type</th><th>Description</th></tr></thead><tbody><tr><td>corporation</td><td>number</td><td>Corporation ID</td></tr><tr><td>username</td><td>string</td><td>Unique username</td></tr><tr><td>id</td><td>number</td><td>Sample Talk ID</td></tr></tbody></table>

**Response**

{% tabs %}
{% tab title="200" %}

```json
{ 
    data: { 
        deleted: true, 
        id: 1 
    }, 
    success: true 
}
```

{% endtab %}
{% endtabs %}

Code

{% tabs %}
{% tab title="Node" %}

```javascript
const accessToken = `<ACCESS TOKEN>`

fetch('https://public-api.expertfile.com/v2/organization/:corporation/expert/:username/sampletalk/:id', {
    method: 'DELETE',
    headers: {
        'Content-Type': 'application/x-www-form-urlencoded',
        'Authorization': `Bearer ${accessToken}`
    }
})
.then(response => response.json())
.then(json => {
    const { success, data, error } = json

    if (success) {
        const { id } = data
        console.log('Deleted talk id', id)
    }

})
.catch(error => console.error(error));

```

{% endtab %}

{% tab title="PHP" %}

```php
$accessToken = urlencode('<ACCESS TOKEN>');

$url = 'https://public-api.expertfile.com/v2/organization/:corporation/expert/:username/sampletalk/:id';

$ch = curl_init($url);
curl_setopt(
    $ch,
    CURLOPT_HTTPHEADER,
    array('Content-Type: application/x-www-form-urlencoded', 'Authorization: Bearer ' . $accessToken)
);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_CUSTOMREQUEST, "DELETE");

$response = curl_exec($ch);
$json = json_decode($response);

if($json->success){
    var_dump($json->data);
}

curl_close($ch);
```

{% endtab %}

{% tab title="Curl" %}

```
curl -X DELETE https://public-api.expertfile.com/v2/organization/:corporation/expert/:username/sampletalk/:id \
    -H "Content-Type: application/json" \
    -H "Authorization: Bearer <ACCESS TOKEN>"
```

{% endtab %}
{% endtabs %}


# Social

Get or create/update the a user's social urls

{% hint style="info" %}
Please note that in all urls & code samples you'll need to replace`:username` and `:corporation` with appropriate values
{% endhint %}

## Get Socials

<mark style="color:green;">`GET`</mark>[ **/v2/organization/:corporation/expert/:username/social**](https://public-api.expertfile.com/v2/organization/:corporation/expert/:username/social/)

**Headers**

| Name          | Value              |
| ------------- | ------------------ |
| Content-Type  | `application/json` |
| Authorization | `Bearer <token>`   |

**Url**

<table><thead><tr><th width="339.3333333333333">Name</th><th>Type</th><th>Description</th></tr></thead><tbody><tr><td>corporation</td><td>number</td><td>Corporation ID</td></tr><tr><td>username</td><td>string</td><td>Unique username</td></tr></tbody></table>

**Response**

{% tabs %}
{% tab title="200" %}

```json
 {
  data: [
    {
      twitter: '',
      facebook: '',
      linkedin: '',
      stackexchange: '',
      github: '',
      flickr: '',
      pinterest: '',
      instagram: '',
      tumblr: '',
      youtube: '',
      generic: ''
    }
  ],
  success: true
}
```

{% endtab %}
{% endtabs %}

Code

{% tabs %}
{% tab title="Node" %}

```javascript
const accessToken = `<ACCESS TOKEN>`

fetch('https://public-api.expertfile.com/v2/organization/:corporation/expert/:username/social', {
    method: 'GET',
    headers: {
        'Content-Type': 'application/x-www-form-urlencoded',
        'Authorization': `Bearer ${accessToken}`
    }
})
.then(response => response.json())
.then(json => {
    const { success, data } = json

    if (success) {
        const social = data[0]
        console.log('social', social)
    }

})
.catch(error => console.error(error));
```

{% endtab %}

{% tab title="PHP" %}

```php
$accessToken = urlencode('<ACCESS TOKEN>');
$url = 'https://public-api.expertfile.com/v2/organization/:corporation/expert/:username/social';

$ch = curl_init($url);
curl_setopt(
    $ch,
    CURLOPT_HTTPHEADER,
    array('Content-Type: application/x-www-form-urlencoded', 'Authorization: Bearer ' . $accessToken)
);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);

$response = curl_exec($ch);
$json = json_decode($response);

if($json->success){
    echo $json->data[0]->biography;
}

curl_close($ch);
```

{% endtab %}

{% tab title="Curl" %}

```
curl https://public-api.expertfile.com/v2/organization/:corporation/expert/:username/social \
    -H "Content-Type: application/json" \
    -H "Authorization: Bearer <ACCESS TOKEN>"

```

{% endtab %}
{% endtabs %}

## Update Social

<mark style="color:blue;">`POST`</mark> [**/v2/organization/:corporation/expert/:username/social**](https://public-api.expertfile.com/v2/organization/:corporation/expert/:username/social/)

**Headers**

| Name          | Value              |
| ------------- | ------------------ |
| Content-Type  | `application/json` |
| Authorization | `Bearer <token>`   |

**Url**

<table><thead><tr><th width="339.3333333333333">Name</th><th>Type</th><th>Description</th></tr></thead><tbody><tr><td>corporation</td><td>number</td><td>Corporation ID</td></tr><tr><td>username</td><td>string</td><td>Unique username</td></tr></tbody></table>

**Body**

| Name          | Type   | Description          |
| ------------- | ------ | -------------------- |
| twitter       | string | X Url                |
| facebook      | string | Facebook Url         |
| linkedin      | string | LinkedIn Url         |
| stackexchange | string | StackExchange Url    |
| github        | string | Github Url           |
| pinterest     | string | Pinterest Url        |
| instagram     | string | Instagram Url        |
| tumblr        | string | Tumblr Url           |
| youtube       | string | YouTube Url          |
| generic       | string | Personal Website Url |

**Response**

{% tabs %}
{% tab title="200" %}

```json
{ 
    data: { 
        id: null 
    }, 
    success: true 
}
```

{% endtab %}
{% endtabs %}

Code

{% tabs %}
{% tab title="Node" %}

```javascript
const data = new URLSearchParams();
const accessToken = `<ACCESS TOKEN>`

data.append('twitter', 'https://twitter/yourusername')
data.append('facebook', '')
data.append('linkedin', '')
data.append('stackexchange', '')
data.append('github', '')
data.append('flickr', '')
data.append('pinterest', '')
data.append('instagram', '')
data.append('tumblr', '')
data.append('youtube', '')
data.append('generic', '')

fetch('https://public-api.expertfile.com/v2/organization/:corporation/expert/:username/social', {
    method: 'POST',
    headers: {
        'Content-Type': 'application/x-www-form-urlencoded',
        'Authorization': `Bearer ${accessToken}`
    },
    body: data
})
.then(response => response.json())
.then(json => {
    const { success, data } = json

    if (success) {
        const { id } = data
    }

})
.catch(error => console.error(error));

```

{% endtab %}

{% tab title="PHP" %}

```php
$accessToken = urlencode('<ACCESS TOKEN>');

$url = 'https://public-api.expertfile.com/v2/organization/:corporation/expert/:username/social';
$data = ['twitter' => 'https://twitter/yourusername', 'facebook' => '', 'linkedin' => '', 'stackexchange' => '', 'github' => '', 'flickr' => '', 'pinterest' => '', 'instagram' => '', 'tumblr' => '', 'youtube' => '', 'generic' => ''];

$ch = curl_init($url);
curl_setopt(
    $ch,
    CURLOPT_HTTPHEADER,
    array('Content-Type: application/x-www-form-urlencoded', 'Authorization: Bearer ' . $accessToken)
);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_POSTFIELDS, http_build_query($data));

$response = curl_exec($ch);
$json = json_decode($response);

if($json->success){
    var_dump($json->data);
}

curl_close($ch);
```

{% endtab %}

{% tab title="Curl" %}

```
curl -X POST https://public-api.expertfile.com/v2/organization/:corporation/expert/:username/social \
    -H "Content-Type: application/json" \
    -H "Authorization: Bearer <ACCESS TOKEN>" \
    -d '{"twitter": "https://twitter/yourusername", "facebook: "", "linkedin: "", "stackexchange: "", "github: "", "flickr: "", "pinterest: "", "instagram: "", "tumblr: "", "youtube: "", "generic: ""}'
```

{% endtab %}
{% endtabs %}


# Tagline

Get or create/update the a user's tagline field

{% hint style="info" %}
Please note that in all urls & code samples you'll need to replace`:username` and `:corporation` with appropriate values
{% endhint %}

## Get Tagline

<mark style="color:green;">`GET`</mark> [**/v2/organization/:corporation/expert/:username/tagline**](https://public-api.expertfile.com/v2/organization/:corporation/expert/:username/tagline)

**Headers**

| Name          | Value              |
| ------------- | ------------------ |
| Content-Type  | `application/json` |
| Authorization | `Bearer <token>`   |

**Url**

<table><thead><tr><th width="339.3333333333333">Name</th><th>Type</th><th>Description</th></tr></thead><tbody><tr><td>corporation</td><td>number</td><td>Corporation ID</td></tr><tr><td>username</td><td>string</td><td>Unique username</td></tr></tbody></table>

**Response**

{% tabs %}
{% tab title="200" %}

```json
 {
  data: [
    {
      tagline: 'Tagline text for expert here.'
    }
  ],
  success: true
}
```

{% endtab %}
{% endtabs %}

Code

{% tabs %}
{% tab title="Node" %}

<pre class="language-javascript"><code class="lang-javascript">const data = new URLSearchParams();
<strong>const accessToken = `&#x3C;ACCESS TOKEN>`
</strong>
fetch('https://public-api.expertfile.com/v2/organization/:corporation/expert/:username/tagline', {
    method: 'GET',
    headers: {
        'Content-Type': 'application/x-www-form-urlencoded',
        'Authorization': `Bearer ${accessToken}`
    }
})
.then(response => response.json())
.then(json => {
    const { success, data } = json

    if (success) {
        const { tagline } = data[0]
        console.log('tagline', tagline)
    }

})
.catch(error => console.error(error));

</code></pre>

{% endtab %}

{% tab title="PHP" %}

```php
$accessToken = urlencode('<ACCESS TOKEN>');
$url = 'https://public-api.expertfile.com/v2/organization/:corporation/expert/:username/tagline';

$ch = curl_init($url);
curl_setopt(
    $ch,
    CURLOPT_HTTPHEADER,
    array('Content-Type: application/x-www-form-urlencoded', 'Authorization: Bearer ' . $accessToken)
);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);

$response = curl_exec($ch);
$json = json_decode($response);

if($json->success){
    echo $json->data[0]->tagline;
}

curl_close($ch);

```

{% endtab %}

{% tab title="Curl" %}

```
curl https://public-api.expertfile.com/v2/organization/:corporation/expert/:username/tagline \
    -H "Content-Type: application/json" \
    -H "Authorization: Bearer <ACCESS TOKEN>"
```

{% endtab %}
{% endtabs %}

## Update Tagline

<mark style="color:blue;">`POST`</mark> [**/v2/organization/:corporation/expert/:username/tagline**](https://public-api.expertfile.com/v2/organization/:corporation/expert/:username/tagline)

**Headers**

| Name          | Value              |
| ------------- | ------------------ |
| Content-Type  | `application/json` |
| Authorization | `Bearer <token>`   |

**Url**

<table><thead><tr><th width="339.3333333333333">Name</th><th>Type</th><th>Description</th></tr></thead><tbody><tr><td>corporation</td><td>number</td><td>Corporation ID</td></tr><tr><td>username</td><td>string</td><td>Unique username</td></tr></tbody></table>

**Body**

| Name                                      | Type   | Description        |
| ----------------------------------------- | ------ | ------------------ |
| tagline<mark style="color:red;">\*</mark> | string | Content of tagline |

**Response**

{% tabs %}
{% tab title="200" %}

```json
{ 
    data: { 
        id: null 
    }, 
    success: true 
}
```

{% endtab %}
{% endtabs %}

Code

{% tabs %}
{% tab title="Node" %}

```javascript
const data = new URLSearchParams();
const accessToken = `<ACCESS TOKEN>`

data.append('tagline', 'Your tagline text');

fetch('https://public-api.expertfile.com/v2/organization/:corporation/expert/:username/tagline', {
    method: 'POST',
    headers: {
        'Content-Type': 'application/x-www-form-urlencoded',
        'Authorization': `Bearer ${accessToken}`
    },
    body: data
})
.then(response => response.json())
.then(json => {
    const { success, data } = json

    if (success) {
        const { id } = data
    }

})
.catch(error => console.error(error));
```

{% endtab %}

{% tab title="PHP" %}

```php
$accessToken = urlencode('<ACCESS TOKEN>');

$url = 'https://public-api.expertfile.com/v2/organization/:corporation/expert/:username/tagline';
$data = ['tagline' => 'Your tagline text'];

$ch = curl_init($url);
curl_setopt(
    $ch,
    CURLOPT_HTTPHEADER,
    array('Content-Type: application/x-www-form-urlencoded', 'Authorization: Bearer ' . $accessToken)
);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_POSTFIELDS, http_build_query($data));

$response = curl_exec($ch);
$json = json_decode($response);

if($json->success){
    var_dump($json->data);
}

curl_close($ch);
```

{% endtab %}

{% tab title="Curl" %}

```
curl -X POST https://public-api.expertfile.com/v2/organization/:corporation/expert/:username/tagline \
    -H "Content-Type: application/json" \
    -H "Authorization: Bearer <ACCESS TOKEN>" \
    -d '{"tagline":"Your tagline text"}'  
```

{% endtab %}
{% endtabs %}


# Tags

CRUD endpoints for a user's tags

{% hint style="info" %}
Please note that in all urls & code samples you'll need to replace`:username` and `:corporation` with appropriate values
{% endhint %}

## Get All Tags

<mark style="color:green;">`GET`</mark> [**/v2/organization/:corporation/expert/:username/tag**](https://public-api.expertfile.com/v2/organization/:corporation/expert/:username/tag/)

**Headers**

| Name          | Value              |
| ------------- | ------------------ |
| Content-Type  | `application/json` |
| Authorization | `Bearer <token>`   |

**Url**

<table><thead><tr><th width="339.3333333333333">Name</th><th>Type</th><th>Description</th></tr></thead><tbody><tr><td>corporation</td><td>number</td><td>Corporation ID</td></tr><tr><td>username</td><td>string</td><td>Unique username</td></tr></tbody></table>

**Response**

{% tabs %}
{% tab title="200" %}

```json
 {
  data: [
    {
      id: 1,
      content_tag_id: 1,
      tag: "tag name"
    }
  ],
  success: true
}
```

{% endtab %}
{% endtabs %}

Code

{% tabs %}
{% tab title="Node" %}

```javascript
const accessToken = `<ACCESS TOKEN>`

fetch('https://public-api.expertfile.com/v2/organization/:corporation/expert/:username/tag', {
    method: 'GET',
    headers: {
        'Content-Type': 'application/x-www-form-urlencoded',
        'Authorization': `Bearer ${accessToken}`
    }
})
.then(response => response.json())
.then(json => {
    const { success, data } = json

    if (success) {
        const tag = data
        console.log('tag', tag)
    }

})
.catch(error => console.error(error));
```

{% endtab %}

{% tab title="PHP" %}

```php
$accessToken = urlencode('<ACCESS TOKEN>');
$url = 'https://public-api.expertfile.com/v2/organization/:corporation/expert/:username/tag';

$ch = curl_init($url);
curl_setopt(
    $ch,
    CURLOPT_HTTPHEADER,
    array('Content-Type: application/x-www-form-urlencoded', 'Authorization: Bearer ' . $accessToken)
);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);

$response = curl_exec($ch);
$json = json_decode($response);

if($json->success){
    var_dump($json->data);
}

curl_close($ch);

```

{% endtab %}

{% tab title="Curl" %}

```
curl https://public-api.expertfile.com/v2/organization/:corporation/expert/:username/tag \
    -H "Content-Type: application/json" \
    -H "Authorization: Bearer <ACCESS TOKEN>"
```

{% endtab %}
{% endtabs %}

## Get Individual Tag

<mark style="color:green;">`GET`</mark> [**/v2/organization/:corporation/expert/:username/tag/:id**](https://public-api.expertfile.com/v2/organization/:corporation/expert/:username/topic/:id)

**Headers**

| Name          | Value              |
| ------------- | ------------------ |
| Content-Type  | `application/json` |
| Authorization | `Bearer <token>`   |

**Url**

<table><thead><tr><th width="339.3333333333333">Name</th><th>Type</th><th>Description</th></tr></thead><tbody><tr><td>corporation</td><td>number</td><td>Corporation ID</td></tr><tr><td>username</td><td>string</td><td>Unique username</td></tr><tr><td>id</td><td>number</td><td>Tag ID</td></tr></tbody></table>

**Response**

{% tabs %}
{% tab title="200" %}

```json
{
  data: [
    {
      id: 1,
      content_tag_id: 1,
      tag: "tag name"
    }
  ],
  success: true
}
```

{% endtab %}
{% endtabs %}

Code

{% tabs %}
{% tab title="Node" %}

```javascript
const accessToken = `<ACCESS CODE>`

fetch('https://public-api.expertfile.com/v2/organization/:corporation/expert/:username/tag/:id', {
    method: 'GET',
    headers: {
        'Content-Type': 'application/x-www-form-urlencoded',
        'Authorization': `Bearer ${accessToken}`
    }
})
.then(response => response.json())
.then(json => {
    const { success, data } = json

    if (success) {
        const tag = data
        console.log('tag', tag[0])
    }

})
.catch(error => console.error(error));
```

{% endtab %}

{% tab title="PHP" %}

```php
$accessToken = urlencode('<ACCESS TOKEN>');
$url = 'https://public-api.expertfile.com/v2/organization/:corporation/expert/:username/tag/:id';

$ch = curl_init($url);
curl_setopt(
    $ch,
    CURLOPT_HTTPHEADER,
    array('Content-Type: application/x-www-form-urlencoded', 'Authorization: Bearer ' . $accessToken)
);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);

$response = curl_exec($ch);
$json = json_decode($response);

if($json->success){
    var_dump($json->data);
}

curl_close($ch);
```

{% endtab %}

{% tab title="Curl" %}

```
curl -X GET https://public-api.expertfile.com/v2/organization/:corporation/expert/:username/tag/:id \
    -H "Content-Type: application/json" \
    -H "Authorization: Bearer <ACCESS TOKEN>"     
```

{% endtab %}
{% endtabs %}

## Create Tag

<mark style="color:blue;">`POST`</mark>[ **/v2/organization/:corporation/expert/:username/tag**](https://public-api.expertfile.com/v2/organization/:corporation/expert/:username/topic/:)

**Headers**

| Name          | Value              |
| ------------- | ------------------ |
| Content-Type  | `application/json` |
| Authorization | `Bearer <token>`   |

**Url**

<table><thead><tr><th width="339.3333333333333">Name</th><th>Type</th><th>Description</th></tr></thead><tbody><tr><td>corporation</td><td>number</td><td>Corporation ID</td></tr><tr><td>username</td><td>string</td><td>Unique username</td></tr></tbody></table>

**Body**

<table><thead><tr><th width="339.3333333333333">Name</th><th>Type</th><th>Description</th></tr></thead><tbody><tr><td>name<mark style="color:red;">*</mark></td><td>string</td><td>Tag Name</td></tr></tbody></table>

**Response**

{% tabs %}
{% tab title="200" %}

```json
{ 
    data: { 
        id: 1
    }, 
    success: true 
}
```

{% endtab %}
{% endtabs %}

**Code**

{% tabs %}
{% tab title="Node" %}

```javascript
const data = new URLSearchParams();
const accessToken = `<ACCESS TOKEN>`

data.append('name', 'Test');

fetch('https://public-api.expertfile.com/v2/organization/:corporation/expert/:username/tag', {
    method: 'POST',
    headers: {
        'Content-Type': 'application/x-www-form-urlencoded',
        'Authorization': `Bearer ${accessToken}`
    },
    body: data
})
.then(response => response.json())
.then(json => {
    const { success, data, error } = json

    if (success) {
        const { id } = data
        console.log('New tag id', id)
    }

})
.catch(error => console.error(error));

```

{% endtab %}

{% tab title="PHP" %}

```php
$accessToken = urlencode('<ACCESS TOKEN>');

$url = 'https://public-api.expertfile.com/v2/organization/:corporation/expert/:username/tag';
$data = ['name' => 'Test'];

$ch = curl_init($url);
curl_setopt(
    $ch,
    CURLOPT_HTTPHEADER,
    array('Content-Type: application/x-www-form-urlencoded', 'Authorization: Bearer ' . $accessToken)
);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_POSTFIELDS, http_build_query($data));

$response = curl_exec($ch);
$json = json_decode($response);

if($json->success){
    var_dump($json->data);
}

curl_close($ch);
```

{% endtab %}

{% tab title="Curl" %}

```
curl -X POST https://public-api.expertfile.com/v2/organization/:corporation/expert/:username/tag \
    -H "Content-Type: application/json" \
    -H "Authorization: Bearer <ACCESS TOKEN>" \
    -d '{"name":"Test"}'
```

{% endtab %}
{% endtabs %}

## Delete Tag

<mark style="color:red;">`DELETE`</mark>[**/v2/organization/:corporation/expert/:username/tag/:id**](https://public-api.expertfile.com/v2/organization/:corporation/expert/:username/topic/:id)

**Headers**

| Name          | Value              |
| ------------- | ------------------ |
| Content-Type  | `application/json` |
| Authorization | `Bearer <token>`   |

**Url**

<table><thead><tr><th width="339.3333333333333">Name</th><th>Type</th><th>Description</th></tr></thead><tbody><tr><td>corporation</td><td>number</td><td>Corporation ID</td></tr><tr><td>username</td><td>string</td><td>Unique username</td></tr><tr><td>id</td><td>number</td><td>Tag ID</td></tr></tbody></table>

**Response**

{% tabs %}
{% tab title="200" %}

```json
{ 
    data: { 
        deleted: true, 
        id: 1
    }, 
    success: true 
}
```

{% endtab %}
{% endtabs %}

Code

{% tabs %}
{% tab title="Node" %}

```javascript
const accessToken = `<ACCESS TOKEN>`

fetch('https://public-api.expertfile.com/v2/organization/:corporation/expert/:username/tag/:id', {
    method: 'DELETE',
    headers: {
        'Content-Type': 'application/x-www-form-urlencoded',
        'Authorization': `Bearer ${accessToken}`
    }
})
.then(response => response.json())
.then(json => {
    const { success, data, error } = json

    if (success) {
        const { id } = data
        console.log('Deleted tag id', id)
    }

})
.catch(error => console.error(error));

```

{% endtab %}

{% tab title="PHP" %}

```php
$accessToken = urlencode('<ACCESS TOKEN>');

$url = 'https://public-api.expertfile.com/v2/organization/:corporation/expert/:username/tag/:id';

$ch = curl_init($url);
curl_setopt(
    $ch,
    CURLOPT_HTTPHEADER,
    array('Content-Type: application/x-www-form-urlencoded', 'Authorization: Bearer ' . $accessToken)
);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_CUSTOMREQUEST, "DELETE");

$response = curl_exec($ch);
$json = json_decode($response);

if($json->success){
    var_dump($json->data);
}

curl_close($ch);
```

{% endtab %}

{% tab title="Curl" %}

```
curl -X DELETE https://public-api.expertfile.com/v2/organization/:corporation/expert/:username/tag/:id \
    -H "Content-Type: application/json" \
    -H "Authorization: Bearer <ACCESS TOKEN>"
```

{% endtab %}
{% endtabs %}


# Testimonials

CRUD endpoints for a user's testimonial

{% hint style="info" %}
Please note that in all urls & code samples you'll need to replace`:username` and `:corporation` with appropriate values
{% endhint %}

## Get All Testimonials

<mark style="color:green;">`GET`</mark> [**/v2/organization/:corporation/expert/:username/testimonial**](https://public-api.expertfile.com/v2/organization/:corporation/expert/:username/testimonial)

**Headers**

| Name          | Value              |
| ------------- | ------------------ |
| Content-Type  | `application/json` |
| Authorization | `Bearer <token>`   |

**Url**

<table><thead><tr><th width="339.3333333333333">Name</th><th>Type</th><th>Description</th></tr></thead><tbody><tr><td>corporation</td><td>number</td><td>Corporation ID</td></tr><tr><td>username</td><td>string</td><td>Unique username</td></tr></tbody></table>

**Response**

{% tabs %}
{% tab title="200" %}

```json
 {
  data: [
    {
      id: 1,
      name: '',
      title: '',
      company: '',
      url: '',
      recommendation: ''
    },
  ],
  success: true
}
```

{% endtab %}
{% endtabs %}

Code

{% tabs %}
{% tab title="Node" %}

```javascript
const data = new URLSearchParams();
const accessToken = `<ACCESS TOKEN>`

fetch('https://public-api.expertfile.com/v2/organization/:corporation/expert/:username/testimonial', {
    method: 'GET',
    headers: {
        'Content-Type': 'application/x-www-form-urlencoded',
        'Authorization': `Bearer ${accessToken}`
    }
})
.then(response => response.json())
.then(json => {
    const { success, data } = json

    if (success) {
        const testimonial = data;
        console.log('all testimonial', testimonial)
    }

})
.catch(error => console.error(error));
```

{% endtab %}

{% tab title="PHP" %}

```php
$accessToken = urlencode('<ACCESS TOKEN>');
$url = 'https://public-api.expertfile.com/v2/organization/:corporation/expert/:username/testimonial';

$ch = curl_init($url);
curl_setopt(
    $ch,
    CURLOPT_HTTPHEADER,
    array('Content-Type: application/x-www-form-urlencoded', 'Authorization: Bearer ' . $accessToken)
);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);

$response = curl_exec($ch);
$json = json_decode($response);

if($json->success){
    var_dump($json->data);
}

curl_close($ch);

```

{% endtab %}

{% tab title="Curl" %}

```
curl https://public-api.expertfile.com/v2/organization/:corporation/expert/:username/testimonial \
    -H "Content-Type: application/json" \
    -H "Authorization: Bearer <ACCESS TOKEN>"
```

{% endtab %}
{% endtabs %}

## Get Individual Testimonial

<mark style="color:green;">`GET`</mark> [**/v2/organization/:corporation/expert/:username/testimonial/:id**](https://public-api.expertfile.com/v2/organization/:corporation/expert/:username/testimonial/:id)

**Headers**

| Name          | Value              |
| ------------- | ------------------ |
| Content-Type  | `application/json` |
| Authorization | `Bearer <token>`   |

**Url**

<table><thead><tr><th width="339.3333333333333">Name</th><th>Type</th><th>Description</th></tr></thead><tbody><tr><td>corporation</td><td>number</td><td>Corporation ID</td></tr><tr><td>username</td><td>string</td><td>Unique username</td></tr><tr><td>id</td><td>number</td><td>Testimonial ID</td></tr></tbody></table>

**Response**

{% tabs %}
{% tab title="200" %}

```json
 {
  data: [
    {
      id: 1,
      name: '',
      title: '',
      company: '',
      url: '',
      recommendation: '',
    },
  ],
  success: true
}
```

{% endtab %}
{% endtabs %}

Code

{% tabs %}
{% tab title="Node" %}

```javascript
const accessToken = `<ACCESS CODE>`

fetch('https://public-api.expertfile.com/v2/organization/:corporation/expert/:username/testimonial/:id', {
    method: 'GET',
    headers: {
        'Content-Type': 'application/x-www-form-urlencoded',
        'Authorization': `Bearer ${accessToken}`
    }
})
.then(response => response.json())
.then(json => {
    const { success, data, error } = json

    if (success) {
        console.log('testimonial', data)
    }

})
.catch(error => console.error(error));
```

{% endtab %}

{% tab title="PHP" %}

```php
$accessToken = urlencode('<ACCESS TOKEN>');
$url = 'https://public-api.expertfile.com/v2/organization/:corporation/expert/:username/testimonial/:id';

$ch = curl_init($url);
curl_setopt(
    $ch,
    CURLOPT_HTTPHEADER,
    array('Content-Type: application/x-www-form-urlencoded', 'Authorization: Bearer ' . $accessToken)
);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);

$response = curl_exec($ch);
$json = json_decode($response);

if($json->success){
    var_dump($json->data);
}

curl_close($ch);
```

{% endtab %}

{% tab title="Curl" %}

```
curl -X GET https://public-api.expertfile.com/v2/organization/:corporation/expert/:username/testimonial/:id \
    -H "Content-Type: application/json" \
    -H "Authorization: Bearer <ACCESS TOKEN>"     
```

{% endtab %}
{% endtabs %}

## Create Testimonial

<mark style="color:blue;">`POST`</mark> [**/v2/organization/:corporation/expert/:username/testimonial**](https://public-api.expertfile.com/v2/organization/:corporation/expert/:username/testimonial)

**Headers**

| Name          | Value              |
| ------------- | ------------------ |
| Content-Type  | `application/json` |
| Authorization | `Bearer <token>`   |

**Url**

<table><thead><tr><th width="339.3333333333333">Name</th><th>Type</th><th>Description</th></tr></thead><tbody><tr><td>corporation</td><td>number</td><td>Corporation ID</td></tr><tr><td>username</td><td>string</td><td>Unique username</td></tr></tbody></table>

**Body**

<table><thead><tr><th width="339.3333333333333">Name</th><th>Type</th><th>Description</th></tr></thead><tbody><tr><td>name<mark style="color:red;">*</mark></td><td>string</td><td>Name of Person</td></tr><tr><td>title<mark style="color:red;">*</mark></td><td>string</td><td>Title of Person</td></tr><tr><td>company<mark style="color:red;">*</mark></td><td>string</td><td>Company of Person</td></tr><tr><td>recommendation<mark style="color:red;">*</mark></td><td>string</td><td>Recommendation Text</td></tr><tr><td>url</td><td>string</td><td>Url of Person's Company</td></tr></tbody></table>

**Response**

{% tabs %}
{% tab title="200" %}

```json
{ 
    data: { 
        id: 1
    }, 
    success: true 
}
```

{% endtab %}
{% endtabs %}

Code

{% tabs %}
{% tab title="Node" %}

<pre class="language-javascript"><code class="lang-javascript">const data = new URLSearchParams();
const accessToken = `&#x3C;ACCESS TOKEN>`

<strong>data.append('name', 'Name of Recommender');
</strong>data.append('title', 'Title of Recommender');
data.append('company', 'Company of Recommender');
data.append('recommendation', 'This is my recommendation')
data.append('url', 'https://myurl.com')

fetch('https://public-api.expertfile.com/v2/organization/:corporation/expert/:username/testimonial', {
    method: 'POST',
    headers: {
        'Content-Type': 'application/x-www-form-urlencoded',
        'Authorization': `Bearer ${accessToken}`
    },
    body: data
})
.then(response => response.json())
.then(json => {
    const { success, data, error } = json

    if (success) {
        const { id } = data
        console.log('New testimonial id', id)
    }

})
.catch(error => console.error(error));
</code></pre>

{% endtab %}

{% tab title="PHP" %}

```php
$accessToken = urlencode('<ACCESS TOKEN>');

$url = 'https://public-api.expertfile.com/v2/organization/:corporation/expert/:username/testimonial';
$data = ['name' => 'Name of Recommender', 'title' => 'Title of Recommender', 'company' => 'Company of Recommender', 'recommendation' => 'This is my recommendation', 'url' => 'https://myurl.com'];

$ch = curl_init($url);
curl_setopt(
    $ch,
    CURLOPT_HTTPHEADER,
    array('Content-Type: application/x-www-form-urlencoded', 'Authorization: Bearer ' . $accessToken)
);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_POSTFIELDS, http_build_query($data));

$response = curl_exec($ch);
$json = json_decode($response);

if($json->success){
    var_dump($json->data);
}

curl_close($ch)
```

{% endtab %}

{% tab title="Curl" %}

```
curl -X POST https://public-api.expertfile.com/v2/organization/:corporation/expert/:username/testimonial \
    -H "Content-Type: application/json" \
    -H "Authorization: Bearer <ACCESS TOKEN>" \
    -d '{"name": "Name of Recommender", "title": "Title of Recommender", "company": "Company of Recommender", "recommendation": "This is my recommendation", "url": "https://myurl.com"}'
```

{% endtab %}
{% endtabs %}

## Update Testimonial

<mark style="color:blue;">`PUT`</mark> [**/v2/organization/:corporation/expert/:username/testimonial/:id**](https://public-api.expertfile.com/v2/organization/:corporation/expert/:username/testimonial/:id)

**Headers**

| Name          | Value              |
| ------------- | ------------------ |
| Content-Type  | `application/json` |
| Authorization | `Bearer <token>`   |

**Url**

<table><thead><tr><th width="339.3333333333333">Name</th><th>Type</th><th>Description</th></tr></thead><tbody><tr><td>corporation</td><td>number</td><td>Corporation ID</td></tr><tr><td>username</td><td>string</td><td>Unique username</td></tr><tr><td>id</td><td>number</td><td>Testimonial ID</td></tr></tbody></table>

**Body**

<table><thead><tr><th width="339.3333333333333">Name</th><th>Type</th><th>Description</th></tr></thead><tbody><tr><td>name<mark style="color:red;">*</mark></td><td>string</td><td>Name of Person</td></tr><tr><td>title<mark style="color:red;">*</mark></td><td>string</td><td>Title of Person</td></tr><tr><td>company<mark style="color:red;">*</mark></td><td>string</td><td>Company of Person</td></tr><tr><td>recommendation<mark style="color:red;">*</mark></td><td>string</td><td>Recommendation Text</td></tr><tr><td>url</td><td>string</td><td>Url of Person's Company</td></tr></tbody></table>

**Response**

{% tabs %}
{% tab title="200" %}

```json
{ 
    data: { 
        id: 1, 
        updated: true 
    }, 
    success: true 
}
```

{% endtab %}
{% endtabs %}

Code

{% tabs %}
{% tab title="Node" %}

```javascript
const data = new URLSearchParams();
const accessToken = `<ACCESS TOKEN>`

data.append('name', 'Name of Recommender');
data.append('title', 'Title of Recommender');
data.append('company', 'Company of Recommender');
data.append('recommendation', 'This is my recommendation')
data.append('url', 'https://myurl.com')

fetch('https://public-api.expertfile.com/v2/organization/:corporation/expert/:username/testimonial/:id', {
    method: 'PUT',
    headers: {
        'Content-Type': 'application/x-www-form-urlencoded',
        'Authorization': `Bearer ${accessToken}`
    },
    body: data
})
.then(response => response.json())
.then(json => {
    const { success, data, error } = json

    if (success) {
        const { id } = data
        console.log('New testimonial id', id)
    }

})
.catch(error => console.error(error));

```

{% endtab %}

{% tab title="PHP" %}

```php
$accessToken = urlencode('<ACCESS TOKEN>');

$url = 'https://public-api.expertfile.com/v2/organization/:corporation/expert/:username/testimonial/:id';
$data = ['name' => 'Name of Recommender', 'title' => 'Title of Recommender', 'company' => 'Company of Recommender', 'recommendation' => 'This is my recommendation', 'url' => 'https://myurl.com'];

$ch = curl_init($url);
curl_setopt(
    $ch,
    CURLOPT_HTTPHEADER,
    array('Content-Type: application/x-www-form-urlencoded', 'Authorization: Bearer ' . $accessToken)
);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_PUT, http_build_query($data));

$response = curl_exec($ch);
$json = json_decode($response);

if($json->success){
    var_dump($json->data);
}

curl_close($ch)
```

{% endtab %}

{% tab title="Curl" %}

```
curl -X PUT https://public-api.expertfile.com/v2/organization/:corporation/expert/:username/testimonial/:id \
    -H "Content-Type: application/json" \
    -H "Authorization: Bearer <ACCESS TOKEN>" \
    -d '{"name": "Name of Recommender", "title": "Title of Recommender", "company": "Company of Recommender", "recommendation": "This is my recommendation", "url": "https://myurl.com"}'
```

{% endtab %}
{% endtabs %}

## Delete Testimonial

<mark style="color:red;">`DELETE`</mark> [**/v2/organization/:corporation/expert/:username/testimonial/:id**](https://public-api.expertfile.com/v2/organization/:corporation/expert/:username/testimonial)

**Headers**

| Name          | Value              |
| ------------- | ------------------ |
| Content-Type  | `application/json` |
| Authorization | `Bearer <token>`   |

**Url**

<table><thead><tr><th width="339.3333333333333">Name</th><th>Type</th><th>Description</th></tr></thead><tbody><tr><td>corporation</td><td>number</td><td>Corporation ID</td></tr><tr><td>username</td><td>string</td><td>Unique username</td></tr><tr><td>id</td><td>number</td><td>Testimonial ID</td></tr></tbody></table>

**Response**

{% tabs %}
{% tab title="200" %}

```json
{ 
    data: { 
        deleted: true, 
        id: 1 
    }, 
    success: true 
}
```

{% endtab %}
{% endtabs %}

Code

{% tabs %}
{% tab title="Node" %}

```javascript
const accessToken = `<ACCESS TOKEN>`

fetch('https://public-api.expertfile.com/v2/organization/:corporation/expert/:username/testimonial/:id', {
    method: 'DELETE',
    headers: {
        'Content-Type': 'application/x-www-form-urlencoded',
        'Authorization': `Bearer ${accessToken}`
    }
})
.then(response => response.json())
.then(json => {
    const { success, data, error } = json

    if (success) {
        const { id } = data
        console.log('Deleted testimonial id', id)
    }

})
.catch(error => console.error(error));

```

{% endtab %}

{% tab title="PHP" %}

```php
$accessToken = urlencode('<ACCESS TOKEN>');

$url = 'https://public-api.expertfile.com/v2/organization/:corporation/expert/:username/testimonial/:id';

$ch = curl_init($url);
curl_setopt(
    $ch,
    CURLOPT_HTTPHEADER,
    array('Content-Type: application/x-www-form-urlencoded', 'Authorization: Bearer ' . $accessToken)
);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_CUSTOMREQUEST, "DELETE");

$response = curl_exec($ch);
$json = json_decode($response);

if($json->success){
    var_dump($json->data);
}

curl_close($ch);
```

{% endtab %}

{% tab title="Curl" %}

```
curl -X DELETE https://public-api.expertfile.com/v2/organization/:corporation/expert/:username/testimonial/:id \
    -H "Content-Type: application/json" \
    -H "Authorization: Bearer <ACCESS TOKEN>"
```

{% endtab %}
{% endtabs %}


# Topics

CRUD endpoints for a user's topics

{% hint style="info" %}
Please note that in all urls & code samples you'll need to replace`:username` and `:corporation` with appropriate values
{% endhint %}

## Get All Topics

<mark style="color:green;">`GET`</mark>[ **/v2/organization/:corporation/expert/:username/topic**](https://public-api.expertfile.com/v2/organization/:corporation/expert/:username/topic/)

**Headers**

| Name          | Value              |
| ------------- | ------------------ |
| Content-Type  | `application/json` |
| Authorization | `Bearer <token>`   |

**Url**

<table><thead><tr><th width="339.3333333333333">Name</th><th>Type</th><th>Description</th></tr></thead><tbody><tr><td>corporation</td><td>number</td><td>Corporation ID</td></tr><tr><td>username</td><td>string</td><td>Unique username</td></tr></tbody></table>

**Response**

{% tabs %}
{% tab title="200" %}

```json
 {
  data: [
    {
      id: 1,
      name: "topic name"
    }
  ],
  success: true
}
```

{% endtab %}
{% endtabs %}

Code

{% tabs %}
{% tab title="Node" %}

```javascript
const accessToken = `<ACCESS TOKEN>`

fetch('https://public-api.expertfile.com/v2/organization/:corporation/expert/:username/topic', {
    method: 'GET',
    headers: {
        'Content-Type': 'application/x-www-form-urlencoded',
        'Authorization': `Bearer ${accessToken}`
    }
})
.then(response => response.json())
.then(json => {
    const { success, data } = json

    if (success) {
        const topic = data
        console.log('topic', topic)
    }

})
.catch(error => console.error(error));
```

{% endtab %}

{% tab title="PHP" %}

```php
$accessToken = urlencode('<ACCESS TOKEN>');
$url = 'https://public-api.expertfile.com/v2/organization/:corporation/expert/:username/topic';

$ch = curl_init($url);
curl_setopt(
    $ch,
    CURLOPT_HTTPHEADER,
    array('Content-Type: application/x-www-form-urlencoded', 'Authorization: Bearer ' . $accessToken)
);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);

$response = curl_exec($ch);
$json = json_decode($response);

if($json->success){
    var_dump($json->data);
}

curl_close($ch);

```

{% endtab %}

{% tab title="Curl" %}

```
curl https://public-api.expertfile.com/v2/organization/:corporation/expert/:username/topic \
    -H "Content-Type: application/json" \
    -H "Authorization: Bearer <ACCESS TOKEN>"
```

{% endtab %}
{% endtabs %}

## Get Individual Topic

<mark style="color:green;">`GET`</mark> [**/v2/organization/:corporation/expert/:username/topic/:id**](https://public-api.expertfile.com/v2/organization/:corporation/expert/:username/topic/:id)

**Headers**

| Name          | Value              |
| ------------- | ------------------ |
| Content-Type  | `application/json` |
| Authorization | `Bearer <token>`   |

**Url**

<table><thead><tr><th width="339.3333333333333">Name</th><th>Type</th><th>Description</th></tr></thead><tbody><tr><td>corporation</td><td>number</td><td>Corporation ID</td></tr><tr><td>username</td><td>string</td><td>Unique username</td></tr><tr><td>id</td><td>number</td><td>Topic ID</td></tr></tbody></table>

**Response**

{% tabs %}
{% tab title="200" %}

```json
{
  data: [
    {
      id: 1,
      name: "topic name"
    }
  ],
  success: true
}
```

{% endtab %}
{% endtabs %}

Code

{% tabs %}
{% tab title="Node" %}

```javascript
const accessToken = `<ACCESS CODE>`

fetch('https://public-api.expertfile.com/v2/organization/:corporation/expert/:username/topic/:id', {
    method: 'GET',
    headers: {
        'Content-Type': 'application/x-www-form-urlencoded',
        'Authorization': `Bearer ${accessToken}`
    }
})
.then(response => response.json())
.then(json => {
    const { success, data } = json

    if (success) {
        const topic = data
        console.log('topic', topic[0])
    }

})
.catch(error => console.error(error));
```

{% endtab %}

{% tab title="PHP" %}

```php
$accessToken = urlencode('<ACCESS TOKEN>');
$url = 'https://public-api.expertfile.com/v2/organization/:corporation/expert/:username/industry/:id';

$ch = curl_init($url);
curl_setopt(
    $ch,
    CURLOPT_HTTPHEADER,
    array('Content-Type: application/x-www-form-urlencoded', 'Authorization: Bearer ' . $accessToken)
);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);

$response = curl_exec($ch);
$json = json_decode($response);

if($json->success){
    var_dump($json->data);
}

curl_close($ch);
```

{% endtab %}

{% tab title="Curl" %}

```
curl -X GET https://public-api.expertfile.com/v2/organization/:corporation/expert/:username/industry/:id \
    -H "Content-Type: application/json" \
    -H "Authorization: Bearer <ACCESS TOKEN>"     
```

{% endtab %}
{% endtabs %}

## Create Topic

<mark style="color:blue;">`POST`</mark> [**/v2/organization/:corporation/expert/:username/topic**](https://public-api.expertfile.com/v2/organization/:corporation/expert/:username/topic)

**Headers**

| Name          | Value              |
| ------------- | ------------------ |
| Content-Type  | `application/json` |
| Authorization | `Bearer <token>`   |

**Url**

<table><thead><tr><th width="339.3333333333333">Name</th><th>Type</th><th>Description</th></tr></thead><tbody><tr><td>corporation</td><td>number</td><td>Corporation ID</td></tr><tr><td>username</td><td>string</td><td>Unique username</td></tr></tbody></table>

**Body**

<table><thead><tr><th width="339.3333333333333">Name</th><th>Type</th><th>Description</th></tr></thead><tbody><tr><td>name<mark style="color:red;">*</mark></td><td>string</td><td>Topic Name</td></tr></tbody></table>

**Response**

{% tabs %}
{% tab title="200" %}

```json
{ 
    data: { 
        id: 1
    }, 
    success: true 
}
```

{% endtab %}
{% endtabs %}

**Code**

{% tabs %}
{% tab title="Node" %}

```javascript
const data = new URLSearchParams();
const accessToken = `<ACCESS TOKEN>`

data.append('name', 'AI');

fetch('https://public-api.expertfile.com/v2/organization/:corporation/expert/:username/topic', {
    method: 'POST',
    headers: {
        'Content-Type': 'application/x-www-form-urlencoded',
        'Authorization': `Bearer ${accessToken}`
    },
    body: data
})
.then(response => response.json())
.then(json => {
    const { success, data, error } = json

    if (success) {
        const { id } = data
        console.log('New topic id', id)
    }

})
.catch(error => console.error(error));

```

{% endtab %}

{% tab title="PHP" %}

```php
$accessToken = urlencode('<ACCESS TOKEN>');

$url = 'https://public-api.expertfile.com/v2/organization/:corporation/expert/:username/topic';
$data = ['name' => 'AI'];

$ch = curl_init($url);
curl_setopt(
    $ch,
    CURLOPT_HTTPHEADER,
    array('Content-Type: application/x-www-form-urlencoded', 'Authorization: Bearer ' . $accessToken)
);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_POSTFIELDS, http_build_query($data));

$response = curl_exec($ch);
$json = json_decode($response);

if($json->success){
    var_dump($json->data);
}

curl_close($ch);
```

{% endtab %}

{% tab title="Curl" %}

```
curl -X POST https://public-api.expertfile.com/v2/organization/:corporation/expert/:username/topic \
    -H "Content-Type: application/json" \
    -H "Authorization: Bearer <ACCESS TOKEN>" \
    -d '{"name":"AI"}'
```

{% endtab %}
{% endtabs %}

## Delete Topic

<mark style="color:red;">`DELETE`</mark>[**/v2/organization/:corporation/expert/:username/topic/:id**](https://public-api.expertfile.com/v2/organization/:corporation/expert/:username/topic/:id)

**Headers**

| Name          | Value              |
| ------------- | ------------------ |
| Content-Type  | `application/json` |
| Authorization | `Bearer <token>`   |

**Url**

<table><thead><tr><th width="339.3333333333333">Name</th><th>Type</th><th>Description</th></tr></thead><tbody><tr><td>corporation</td><td>number</td><td>Corporation ID</td></tr><tr><td>username</td><td>string</td><td>Unique username</td></tr><tr><td>id</td><td>number</td><td>Topic ID</td></tr></tbody></table>

**Response**

{% tabs %}
{% tab title="200" %}

```json
{ 
    data: { 
        deleted: true, 
        id: 1
    }, 
    success: true 
}
```

{% endtab %}
{% endtabs %}

Code

{% tabs %}
{% tab title="Node" %}

```javascript
const accessToken = `<ACCESS TOKEN>`

fetch('https://public-api.expertfile.com/v2/organization/:corporation/expert/:username/topic/:id', {
    method: 'DELETE',
    headers: {
        'Content-Type': 'application/x-www-form-urlencoded',
        'Authorization': `Bearer ${accessToken}`
    }
})
.then(response => response.json())
.then(json => {
    const { success, data, error } = json

    if (success) {
        const { id } = data
        console.log('Deleted topic id', id)
    }

})
.catch(error => console.error(error));

```

{% endtab %}

{% tab title="PHP" %}

```php
$accessToken = urlencode('<ACCESS TOKEN>');

$url = 'https://public-api.expertfile.com/v2/organization/:corporation/expert/:username/topic/:id';

$ch = curl_init($url);
curl_setopt(
    $ch,
    CURLOPT_HTTPHEADER,
    array('Content-Type: application/x-www-form-urlencoded', 'Authorization: Bearer ' . $accessToken)
);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_CUSTOMREQUEST, "DELETE");

$response = curl_exec($ch);
$json = json_decode($response);

if($json->success){
    var_dump($json->data);
}

curl_close($ch);
```

{% endtab %}

{% tab title="Curl" %}

```
curl -X DELETE https://public-api.expertfile.com/v2/organization/:corporation/expert/:username/topic/:id \
    -H "Content-Type: application/json" \
    -H "Authorization: Bearer <ACCESS TOKEN>"
```

{% endtab %}
{% endtabs %}


# SEO/Meta Data

Get all the SEO meta data for an expert's profile page

{% hint style="info" %}
Please note that in all urls & code samples you'll need to replace`:username` and `:corporation` with appropriate values
{% endhint %}

## Get SEO

<mark style="color:green;">`GET`</mark> [**/v2/organization/:corporation/expert/:username/seo**](https://public-api.expertfile.com/v2/organization/:corporation/expert/:username/seo)

**Headers**

| Name          | Value              |
| ------------- | ------------------ |
| Content-Type  | `application/json` |
| Authorization | `Bearer <token>`   |

**Url**

<table><thead><tr><th width="339.3333333333333">Name</th><th>Type</th><th>Description</th></tr></thead><tbody><tr><td>corporation</td><td>number</td><td>Corporation ID</td></tr><tr><td>username</td><td>string</td><td>Unique username</td></tr></tbody></table>

**Response**

{% tabs %}
{% tab title="200" %}

```json
 {
  data: [
    {
      title: '',
      description: '',
      keywords: '',
      canonical: '',
      schema: ''
    }
  ],
  success: true
}
```

{% endtab %}
{% endtabs %}

Code

{% tabs %}
{% tab title="Node" %}

```javascript
const accessToken = `<ACCESS TOKEN>`

fetch('https://public-api.expertfile.com/v2/organization/:corporation/expert/:username/seo', {
    method: 'GET',
    headers: {
        'Content-Type': 'application/x-www-form-urlencoded',
        'Authorization': `Bearer ${accessToken}`
    }
})
.then(response => response.json())
.then(json => {
    const { success, data } = json

    if (success) {
        const seo = data[0]
        console.log('seo', seo)
    }

})
.catch(error => console.error(error));
```

{% endtab %}

{% tab title="PHP" %}

```php
$accessToken = urlencode('<ACCESS TOKEN>');
$url = 'https://public-api.expertfile.com/v2/organization/:corporation/expert/:username/seo';

$ch = curl_init($url);
curl_setopt(
    $ch,
    CURLOPT_HTTPHEADER,
    array('Content-Type: application/x-www-form-urlencoded', 'Authorization: Bearer ' . $accessToken)
);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);

$response = curl_exec($ch);
$json = json_decode($response);

if($json->success){
    var_dump($json->data);
}

curl_close($ch);
```

{% endtab %}

{% tab title="Curl" %}

```
curl https://public-api.expertfile.com/v2/organization/:corporation/expert/:username/seo \
    -H "Content-Type: application/json" \
    -H "Authorization: Bearer <ACCESS TOKEN>"

```

{% endtab %}
{% endtabs %}


# Staff

Once you've created an access token you can explore the search endpoint. To show an experts full profile you can use the expert endpoint. Within this section, you'll notice you can work with individual profile fields. If you're just looking to make a complete profile, you'll only require the `employee/staff` endpoint.

You can also create your own forms and submit inquiry details to ExpertFile using the inquiry endpoint.

### Generate a Token:

{% content-ref url="/pages/BYd1G0wKUbajbfmWWW79" %}
[Authentication](/reference/api-reference/authentication)
{% endcontent-ref %}

### Explore the Employee/Staff Listing/Search endpoint:

{% content-ref url="/pages/rmViuu94FO8HgRBMN5c6" %}
[Staff Directories/Search](/reference/api-reference/staff/staff-directories-search)
{% endcontent-ref %}

### Full profile data:

{% content-ref url="/pages/PzW8AElXvN8JlVMUsaiK" %}
[Staff Profiles](/reference/api-reference/staff/staff-profiles)
{% endcontent-ref %}

### Adding Analytics tracking to your pages:

{% content-ref url="/pages/B8RUWa1icG9Xs3ADG2IM" %}
[Tracking Code (Analytics)](/reference/tracking-code-analytics)
{% endcontent-ref %}


# Staff Directories/Search

You can return just staff profiles or both staff and expert. Specify staff or employee will return staff of both user types.

{% hint style="info" %}
Remember to change **:corporation** with your corporation id(found in the integrations section of the dashboard).
{% endhint %}

## Listing Employees Or Staff

<mark style="color:green;">`GET`</mark> [**`/v2/organization/:corporation/:type`**](https://public-api.expertfile.com/v2/organization/:corporation/:type)

**Headers**

| Name          | Value              |
| ------------- | ------------------ |
| Content-Type  | `application/json` |
| Authorization | `Bearer <token>`   |

**Url**

<table><thead><tr><th width="339.3333333333333">Name</th><th>Type</th><th>Description</th></tr></thead><tbody><tr><td>corporation</td><td>number</td><td>Corporation ID</td></tr><tr><td>username</td><td>string</td><td>Unique username</td></tr><tr><td>type</td><td>string</td><td>staff/employee</td></tr><tr><td>q</td><td>string</td><td>Keyword search term</td></tr><tr><td>access</td><td>string</td><td>public/private/all</td></tr><tr><td>status</td><td>string</td><td>published/unpublished/all</td></tr><tr><td>page_size</td><td>number</td><td>Size of page</td></tr><tr><td>page_from</td><td>number</td><td>Starting point</td></tr><tr><td>categories</td><td>string</td><td>Filter by categories. Array of categories(i.e. ["cat1","cat2"])</td></tr><tr><td>tags</td><td>string</td><td>Filter by tags. Array of tags(i.e. ["tag1","tag2"])</td></tr><tr><td>sort</td><td>string</td><td>Sorting order(name/featured)</td></tr><tr><td>searchfield</td><td>string</td><td>Fullname to query only name field.</td></tr></tbody></table>

**Response**

{% tabs %}
{% tab title="200" %}

```json
{
  data: {
    employees|staff: [],
    total: 10
  },
  success: true
}  
```

{% endtab %}
{% endtabs %}

**Code**

{% tabs %}
{% tab title="Node" %}

```javascript
const accessToken = `<ACCESS TOKEN>`

fetch('https://public-api.expertfile.com/v2/organization/:corporation/employee', {
    method: 'GET',
    headers: {
        'Content-Type': 'application/x-www-form-urlencoded',
        'Authorization': `Bearer ${accessToken}`
    }
})
.then(response => response.json())
.then(json => {
    const { success, data } = json

    if (success) {
        const { employees, total } = data;
        console.log('Employees', employees, total);
    }

})
.catch(error => console.error(error));
```

{% endtab %}

{% tab title="PHP" %}

```php
$accessToken = urlencode('<ACCESS TOKEN>');
$url = 'https://public-api.expertfile.com/v2/organization/:corporation/employee';

$ch = curl_init($url);
curl_setopt(
    $ch,
    CURLOPT_HTTPHEADER,
    array('Content-Type: application/x-www-form-urlencoded', 'Authorization: Bearer ' . $accessToken)
);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);

$response = curl_exec($ch);
$json = json_decode($response);

if($json->success){
    var_dump($json->data);
}

curl_close($ch);

```

{% endtab %}

{% tab title="Curl" %}

```
curl https://public-api.expertfile.com/v2/organization/:corporation/employee \
    -H "Content-Type: application/json" \
    -H "Authorization: Bearer <ACCESS TOKEN>"
```

{% endtab %}
{% endtabs %}

## Applying Category Filter to Employees or Staff

<mark style="color:green;">`GET`</mark> [**/v2/organization/:corporation/:type**](https://public-api.expertfile.com/v2/organization/:corporation/:type)

**Headers**

| Name          | Value              |
| ------------- | ------------------ |
| Content-Type  | `application/json` |
| Authorization | `Bearer <token>`   |

**Url**

<table><thead><tr><th width="339.3333333333333">Name</th><th>Type</th><th>Description</th></tr></thead><tbody><tr><td>corporation</td><td>number</td><td>Corporation ID</td></tr><tr><td>type</td><td>string</td><td>staff/employee</td></tr><tr><td>categories</td><td>string</td><td>Filter by categories. Array of categories(i.e. ["cat1","cat2"])</td></tr></tbody></table>

**Response**

{% tabs %}
{% tab title="200" %}

```json
{
  data: {
    employees|staff: [],
    total: 10
  },
  success: true
}  
```

{% endtab %}
{% endtabs %}

**Code**

{% tabs %}
{% tab title="Node" %}

```javascript
const accessToken = `<ACCESS TOKEN>`

const params = {
    categories: JSON.stringify(['Advisors', 'Featured'])
};

const qs = new URLSearchParams(params).toString()

const path = `https://public-api.expertfile.com/v2/organization/:corporation/employee${qs ? '?' + qs : ''}`
fetch(path, {
    method: 'GET',
    headers: {
        'Content-Type': 'application/x-www-form-urlencoded',
        'Authorization': `Bearer ${accessToken}`
    }
})
.then(response => response.json())
.then(json => {
    const { success, data } = json

    if (success) {
        const { employees, total } = data;
        console.log('Employees', employees, total);
    }

})
.catch(error => console.error(error));
```

{% endtab %}

{% tab title="PHP" %}

```php
$accessToken = urlencode('<ACCESS CODE>');
$parameters = array(
    'categories' => json_encode(['Advisors', 'Featured'])
);

$url = 'https://public-api.expertfile.com/v2/organization/:corporation/expert?' . http_build_query($parameters);

$ch = curl_init($url);
curl_setopt(
    $ch,
    CURLOPT_HTTPHEADER,
    array('Content-Type: application/x-www-form-urlencoded', 'Authorization: Bearer ' . $accessToken)
);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);

$response = curl_exec($ch);
$json = json_decode($response);

if($json->success){
    var_dump($json->data);
}

curl_close($ch);
```

{% endtab %}

{% tab title="Curl" %}

```
curl --GET \
--data-urlencode 'categories=["Advisors","Featured"]' \
https://public-api.expertfile.com/v2/organization/:corporation/expert \
-H "Content-Type: application/json" \
-H "Authorization: Bearer <ACCESS CODE>"
```

{% endtab %}
{% endtabs %}


# Staff Profiles

{% hint style="info" %}
Please note that in all urls & code samples you'll need to replace`:username` and `:corporation` with appropriate values
{% endhint %}

## Get Individual Staff

<mark style="color:green;">`GET`</mark>[ **/v2/organization/:corporation/staff/:username**](https://public-api.expertfile.com/v2/organization/:corporation/staff/:username)

**Headers**

| Name          | Value              |
| ------------- | ------------------ |
| Content-Type  | `application/json` |
| Authorization | `Bearer <token>`   |

**Url**

<table><thead><tr><th width="339.3333333333333">Name</th><th>Type</th><th>Description</th></tr></thead><tbody><tr><td>corporation</td><td>number</td><td>Corporation ID</td></tr><tr><td>username</td><td>string</td><td>Unique username</td></tr></tbody></table>

**Response**

{% tabs %}
{% tab title="200" %}

```json
 {
  data: {
    avatar: [],
    account: [],
    biography: [],
    category: [],
    corporationprofile: [],
    education: [],
    language: [],
    link: [],
    profiletype: [],
    tag: [],
    tagline: []
  },
  success: true
}
```

{% endtab %}
{% endtabs %}

Code

{% tabs %}
{% tab title="Node" %}

```javascript
const accessToken = `<ACCESS TOKEN>`

fetch('https://public-api.expertfile.com/v2/organization/:corporation/staff/:username', {
    method: 'GET',
    headers: {
        'Content-Type': 'application/x-www-form-urlencoded',
        'Authorization': `Bearer ${accessToken}`
    }
})
.then(response => response.json())
.then(json => {
    const { success, data } = json

    if (success) {
        const profile = data;
        console.log('profile', profile)
    }

})
.catch(error => console.error(error));
```

{% endtab %}

{% tab title="PHP" %}

```php
$accessToken = urlencode('<ACCESS TOKEN>');
$url = 'https://public-api.expertfile.com/v2/organization/:corporation/expert/:username';

$ch = curl_init($url);
curl_setopt(
    $ch,
    CURLOPT_HTTPHEADER,
    array('Content-Type: application/x-www-form-urlencoded', 'Authorization: Bearer ' . $accessToken)
);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);

$response = curl_exec($ch);
$json = json_decode($response);

if($json->success){
    var_dump($json->data);
}

curl_close($ch);
```

{% endtab %}

{% tab title="Curl" %}

```
curl https://public-api.expertfile.com/v2/organization/:corporation/expert/:username
    -H "Content-Type: application/json" \
    -H "Authorization: Bearer <ACCESS TOKEN>"
```

{% endtab %}
{% endtabs %}

## Create Staff

<mark style="color:blue;">`POST`</mark> [**/v2/organization/:corporation/staff**](https://public-api.expertfile.com/v2/organization/:corporation/expert/:username)

**Headers**

| Name          | Value              |
| ------------- | ------------------ |
| Content-Type  | `application/json` |
| Authorization | `Bearer <token>`   |

**Url**

<table><thead><tr><th width="339.3333333333333">Name</th><th>Type</th><th>Description</th></tr></thead><tbody><tr><td>corporation</td><td>number</td><td>Corporation ID</td></tr><tr><td>username</td><td>string</td><td>Unique username</td></tr></tbody></table>

**Body**

<table><thead><tr><th width="339.3333333333333">Name</th><th>Type</th><th>Description</th></tr></thead><tbody><tr><td>firstname<mark style="color:red;"><strong>*</strong></mark></td><td>string</td><td>First Name</td></tr><tr><td>lastname<mark style="color:red;"><strong>*</strong></mark></td><td>string</td><td>Last Name</td></tr><tr><td>job_title<mark style="color:red;"><strong>*</strong></mark></td><td>string</td><td>Job</td></tr><tr><td>email<mark style="color:red;"><strong>*</strong></mark></td><td>string</td><td>Email</td></tr><tr><td>company<mark style="color:red;"><strong>*</strong></mark></td><td>string</td><td>Company</td></tr><tr><td>department</td><td>string</td><td>Department</td></tr><tr><td>phone_number</td><td>string</td><td>Phone #</td></tr><tr><td>phone_number_extension</td><td>string</td><td>Phone extension</td></tr><tr><td>location_city</td><td>string</td><td>City</td></tr><tr><td>location_state</td><td>string</td><td>State/Province<br>See full list <a href="/reference/helpers#state-province-codes"><em><strong>here</strong></em></a></td></tr><tr><td>location_country</td><td>string</td><td>Country<br>See full list <a href="/reference/helpers#country-codes"><em><strong>here</strong></em></a></td></tr><tr><td>location_postal</td><td>string</td><td>ZIP/Postal Code</td></tr><tr><td>location_address</td><td>string</td><td>Address</td></tr><tr><td>location_building</td><td>string</td><td>Building</td></tr><tr><td>location_room</td><td>string</td><td>Room #</td></tr></tbody></table>

**Response**

{% tabs %}
{% tab title="200" %}

```json
 {
  data: {
    username: '<USERNAME>', 
    inserted: true
  },
  success: true
}
```

{% endtab %}
{% endtabs %}

Code

{% tabs %}
{% tab title="Node" %}

```javascript
const data = new URLSearchParams();
const accessToken = `<ACCESS TOKEN>`

data.append('firstname', 'Testfirstname');
data.append('lastname', 'Testlastname');
data.append('job_title', 'Job title');
data.append('email', 'testfromstaffapi@testing.com');
data.append('company', 'Testcompany');
data.append('department', 'Testdepartment');
data.append('phone_number', 'Testphone');
data.append('phone_number_extension', 'Testext');
data.append('location_city', 'Testcity');
data.append('location_state', 'ON');
data.append('location_country', 'CA');
data.append('location_postal', 'Testpostal');
data.append('location_address', 'Testaddress');
data.append('location_building', 'Testbuilding');
data.append('location_room', 'Testroom');

fetch('https://public-api.expertfile.com/v2/organization/:corporation/staff', {
    method: 'POST',
    headers: {
        'Content-Type': 'application/x-www-form-urlencoded',
        'Authorization': `Bearer ${accessToken}`
    },
    body: data
})
.then(response => response.json())
.then(json => {
    const { success, data, error } = json

    if (success) {
        const { username } = data
        console.log('New username', username)
    }

})
.catch(error => console.error(error));
```

{% endtab %}

{% tab title="PHP" %}

```php
$accessToken = urlencode('<ACCESS TOKEN>');

$url = 'https://public-api.expertfile.com/v2/organization/:corporation/staff';
$data = [
'firstname' => 'Testfirstname',
'lastname' => 'Testlastname',
'job_title' => 'Job title',
'email' => 'testfromapi@testing.com',
'company' => 'Testcompany',
'department' => 'Testdepartment',
'phone_number' => 'Testphone',
'phone_number_extension' => 'Testext',
'location_city' => 'Testcity',
'location_state' => 'ON',
'location_country' => 'CA',
'location_postal' => 'Testpostal',
'location_address' => 'Testaddress',
'location_building' => 'Testbuilding',
'location_room' => 'Testroom'
];

$ch = curl_init($url);
curl_setopt(
    $ch,
    CURLOPT_HTTPHEADER,
    array('Content-Type: application/x-www-form-urlencoded', 'Authorization: Bearer ' . $accessToken)
);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_POSTFIELDS, http_build_query($data));

$response = curl_exec($ch);
$json = json_decode($response);

if($json->success){
    var_dump($json->data);
}

curl_close($ch);
```

{% endtab %}

{% tab title="Curl" %}

```
curl -X POST https://public-api.expertfile.com/v2/organization/:corporation/staff \
    -H "Content-Type: application/json" \
    -H "Authorization: Bearer <ACCESS TOKEN>" \
    -d '{"firstname": "Testfirstname","lastname": "Testlastname","job_title": "Job title","email": "testfromapi@testing.com","company": "Testcompany","department": "Testdepartment","phone_number": "Testphone","phone_number_extension": "Testext","location_city": "Testcity","location_state": "ON","location_country": "CA","location_postal": "Testpostal","location_address": "Testaddress","location_building": "Testbuilding", "location_room": "Testroom"}'
```

{% endtab %}
{% endtabs %}

## Update Staff

<mark style="color:blue;">`PUT`</mark> [**/v2/organization/:corporation/staff/:username**](https://public-api.expertfile.com/v2/organization/:corporation/expert/:username)

**Headers**

| Name          | Value              |
| ------------- | ------------------ |
| Content-Type  | `application/json` |
| Authorization | `Bearer <token>`   |

**Url**

<table><thead><tr><th width="339.3333333333333">Name</th><th>Type</th><th>Description</th></tr></thead><tbody><tr><td>corporation</td><td>number</td><td>Corporation ID</td></tr><tr><td>username</td><td>string</td><td>Unique username</td></tr></tbody></table>

**Body**

<table><thead><tr><th width="339.3333333333333">Name</th><th>Type</th><th>Description</th></tr></thead><tbody><tr><td>firstname</td><td>string</td><td>First Name</td></tr><tr><td>lastname</td><td>string</td><td>Last Name</td></tr><tr><td>job_title</td><td>string</td><td>Job</td></tr><tr><td>email</td><td>string</td><td>Email</td></tr><tr><td>company</td><td>string</td><td>Company</td></tr><tr><td>department</td><td>string</td><td>Department</td></tr><tr><td>phone_number</td><td>string</td><td>Phone #</td></tr><tr><td>phone_number_extension</td><td>string</td><td>Phone extension</td></tr><tr><td>location_city</td><td>string</td><td>City</td></tr><tr><td>location_state</td><td>string</td><td>State/Province<br>See full list <a href="/reference/helpers#state-province-codes"><em><strong>here</strong></em></a></td></tr><tr><td>location_country</td><td>string</td><td>Country<br>See full list <a href="/reference/helpers#country-codes"><em><strong>here</strong></em></a></td></tr><tr><td>location_postal</td><td>string</td><td>ZIP/Postal Code</td></tr><tr><td>location_address</td><td>string</td><td>Address</td></tr><tr><td>location_building</td><td>string</td><td>Building</td></tr><tr><td>location_room</td><td>string</td><td>Room # </td></tr><tr><td>is_published</td><td>number</td><td>Published(1 or 0)</td></tr><tr><td>is_private</td><td>number</td><td>Private(1 or 0)</td></tr></tbody></table>

**Response**

{% tabs %}
{% tab title="200" %}

```json
 {
  data: {
    username: '<USERNAME>', 
    updated: true
  },
  success: true
}
```

{% endtab %}
{% endtabs %}

Code

{% tabs %}
{% tab title="Node" %}

```javascript
const data = new URLSearchParams();
const accessToken = `<ACCESS TOKEN>`

data.append('firstname', 'Testfirstname');
data.append('lastname', 'Testlastname');
data.append('job_title', 'Job title');
data.append('email', 'testfromapi@testing.com');
data.append('company', 'Testcompany');
data.append('department', 'Testdepartment');
data.append('phone_number', 'Testphone');
data.append('phone_number_extension', 'Testext');
data.append('location_city', 'Testcity');
data.append('location_state', 'ON');
data.append('location_country', 'CA');
data.append('location_postal', 'Testpostal');
data.append('location_address', 'Testaddress');
data.append('location_building', 'Testbuilding');
data.append('location_room', 'Testroom');
data.append('is_published', '1');
data.append('is_private', '0');

fetch('https://public-api.expertfile.com/v2/organization/:corporation/staff/:username', {
    method: 'PUT',
    headers: {
        'Content-Type': 'application/x-www-form-urlencoded',
        'Authorization': `Bearer ${accessToken}`
    },
    body: data
})
.then(response => response.json())
.then(json => {
    const { success, data, error } = json

    if (success) {
        const { username } = data
        console.log('Updated username', username)
    }

})
.catch(error => console.error(error));
```

{% endtab %}

{% tab title="PHP" %}

```php
$accessToken = urlencode('<ACCESS TOKEN>');

$url = 'https://public-api.expertfile.com/v2/organization/:corporation/staff/:username';
$data = [
'firstname' => 'Testfirstname',
'lastname' => 'Testlastname',
'job_title' => 'Job title',
'email' => 'testfromapi@testing.com',
'company' => 'Testcompany',
'department' => 'Testdepartment',
'phone_number' => 'Testphone',
'phone_number_extension' => 'Testext',
'location_city' => 'Testcity',
'location_state' => 'ON',
'location_country' => 'CA',
'location_postal' => 'Testpostal',
'location_address' => 'Testaddress',
'location_building' => 'Testbuilding',
'location_room' => 'Testroom',
'is_published' => '1',
'is_private' => '0'
];

$ch = curl_init($url);
curl_setopt(
    $ch,
    CURLOPT_HTTPHEADER,
    array('Content-Type: application/x-www-form-urlencoded', 'Authorization: Bearer ' . $accessToken)
);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_PUT, http_build_query($data));

$response = curl_exec($ch);
$json = json_decode($response);

if($json->success){
    var_dump($json->data);
}

curl_close($ch);
```

{% endtab %}

{% tab title="Curl" %}

```
curl -X PUT https://public-api.expertfile.com/v2/organization/:corporation/staff/:username \
    -H "Content-Type: application/json" \
    -H "Authorization: Bearer <ACCESS TOKEN>" \
    -d '{"firstname": "Testfirstname","lastname": "Testlastname","job_title": "Job title","email": "testfromapi@testing.com","company": "Testcompany","department": "Testdepartment","phone_number": "Testphone","phone_number_extension": "Testext","location_city": "Testcity","location_state": "ON","location_country": "CA","location_postal": "Testpostal","location_address": "Testaddress","location_building": "Testbuilding", "location_room": "Testroom", "is_published": "1" "is_private": "0"}'
```

{% endtab %}
{% endtabs %}

## Delete Staff

<mark style="color:red;">`DELETE`</mark>[ **/v2/organization/:corporation/staff/:username**](https://public-api.expertfile.com/v2/organization/:corporation/staff/:username)

**Headers**

| Name          | Value              |
| ------------- | ------------------ |
| Content-Type  | `application/json` |
| Authorization | `Bearer <token>`   |

**Url**

<table><thead><tr><th width="339.3333333333333">Name</th><th>Type</th><th>Description</th></tr></thead><tbody><tr><td>corporation</td><td>number</td><td>Corporation ID</td></tr><tr><td>username</td><td>string</td><td>Unique username</td></tr></tbody></table>

**Response**

{% tabs %}
{% tab title="200" %}

```json
{ 
    data: { 
        deleted: true, 
        username: '<USERNAME>', 
    }, 
    success: true 
}
```

{% endtab %}
{% endtabs %}

**Code**

{% tabs %}
{% tab title="Node" %}

```javascript
const accessToken = `<ACCESS TOKEN>`

fetch('https://public-api.expertfile.com/v2/organization/:corporation/staff/:username', {
    method: 'DELETE',
    headers: {
        'Content-Type': 'application/x-www-form-urlencoded',
        'Authorization': `Bearer ${accessToken}`
    }
})
.then(response => response.json())
.then(json => {
    const { success, data, error } = json

    if (success) {
        const { username } = data
        console.log('Deleted username', username)
    }

})
.catch(error => console.error(error));
```

{% endtab %}

{% tab title="PHP" %}

```php
$accessToken = urlencode('<ACCESS TOKEN>');

$url = 'https://public-api.expertfile.com/v2/organization/:corporation/staff/:username';

$ch = curl_init($url);
curl_setopt(
    $ch,
    CURLOPT_HTTPHEADER,
    array('Content-Type: application/x-www-form-urlencoded', 'Authorization: Bearer ' . $accessToken)
);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_CUSTOMREQUEST, "DELETE");

$response = curl_exec($ch);
$json = json_decode($response);

if($json->success){
    var_dump($json->data);
}

curl_close($ch);
```

{% endtab %}

{% tab title="Curl" %}

```
curl -X DELETE https://public-api.expertfile.com/v2/organization/:corporation/staff/:username \
    -H "Content-Type: application/json" \
    -H "Authorization: Bearer <ACCESS TOKEN>"
```

{% endtab %}
{% endtabs %}


# Biography

Get or create/update the a user's biography field

{% hint style="info" %}
Please note that in all urls & code samples you'll need to replace`:username` and `:corporation` with appropriate values
{% endhint %}

## Get Biography

<mark style="color:green;">`GET`</mark> [**/v2/organization/:corporation/staff/:username/biography**](https://public-api.expertfile.com/v2/organization/:corporation/staff/:username/biography)

**Headers**

| Name          | Value              |
| ------------- | ------------------ |
| Content-Type  | `application/json` |
| Authorization | `Bearer <token>`   |

**Url**

<table><thead><tr><th width="339.3333333333333">Name</th><th>Type</th><th>Description</th></tr></thead><tbody><tr><td>corporation</td><td>number</td><td>Corporation ID</td></tr><tr><td>username</td><td>string</td><td>Unique username</td></tr></tbody></table>

**Response**

{% tabs %}
{% tab title="200" %}

```json
 {
  data: [
    {
      biography: 'Biography text for expert here.'
    }
  ],
  success: true
}
```

{% endtab %}
{% endtabs %}

Code

{% tabs %}
{% tab title="Node" %}

```javascript
const accessToken = `<ACCESS TOKEN>`

fetch('https://public-api.expertfile.com/v2/organization/:corporation/staff/:username/biography', {
    method: 'GET',
    headers: {
        'Content-Type': 'application/x-www-form-urlencoded',
        'Authorization': `Bearer ${accessToken}`
    }
})
.then(response => response.json())
.then(json => {
    const { success, data } = json

    if (success) {
        const { biography } = data[0]
        console.log('biography', biography)
    }

})
.catch(error => console.error(error));
```

{% endtab %}

{% tab title="PHP" %}

```php
$accessToken = urlencode('<ACCESS TOKEN>');
$url = 'https://public-api.expertfile.com/v2/organization/:corporation/staff/:username/biography';

$ch = curl_init($url);
curl_setopt(
    $ch,
    CURLOPT_HTTPHEADER,
    array('Content-Type: application/x-www-form-urlencoded', 'Authorization: Bearer ' . $accessToken)
);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);

$response = curl_exec($ch);
$json = json_decode($response);

if($json->success){
    echo $json->data[0]->biography;
}

curl_close($ch);
```

{% endtab %}

{% tab title="Curl" %}

```
curl https://public-api.expertfile.com/v2/organization/:corporation/staff/:username/biography \
    -H "Content-Type: application/json" \
    -H "Authorization: Bearer <ACCESS TOKEN>"

```

{% endtab %}
{% endtabs %}

## Update Biography

<mark style="color:blue;">`POST`</mark> [**/v2/organization/:corporation/staff/:username/biography**](https://public-api.expertfile.com/v2/organization/:corporation/staff/:username/biography)

**Headers**

| Name          | Value              |
| ------------- | ------------------ |
| Content-Type  | `application/json` |
| Authorization | `Bearer <token>`   |

**Url**

<table><thead><tr><th width="339.3333333333333">Name</th><th>Type</th><th>Description</th></tr></thead><tbody><tr><td>corporation</td><td>number</td><td>Corporation ID</td></tr><tr><td>username</td><td>string</td><td>Unique username</td></tr></tbody></table>

**Body**

| Name                                          | Type   | Description                                                                                   |
| --------------------------------------------- | ------ | --------------------------------------------------------------------------------------------- |
| description<mark style="color:red;">\*</mark> | string | <p>Content of biography<br><mark style="color:purple;"><strong>\*optional</strong></mark></p> |

**Response**

{% tabs %}
{% tab title="200" %}

```json
{ 
    data: { 
        id: null 
    }, 
    success: true 
}
```

{% endtab %}
{% endtabs %}

Code

{% tabs %}
{% tab title="Node" %}

```javascript
const data = new URLSearchParams();
const accessToken = `<ACCESS TOKEN>`

data.append('description', 'Your biography text');

fetch('https://public-api.expertfile.com/v2/organization/:corporation/staff/:username/biography', {
    method: 'POST',
    headers: {
        'Content-Type': 'application/x-www-form-urlencoded',
        'Authorization': `Bearer ${accessToken}`
    },
    body: data
})
.then(response => response.json())
.then(json => {
    const { success, data } = json

    if (success) {
        const { id } = data
    }

})
.catch(error => console.error(error));

```

{% endtab %}

{% tab title="PHP" %}

```php
$accessToken = urlencode('<ACCESS TOKEN>');

$url = 'https://public-api.expertfile.com/v2/organization/:corporation/staff/:username/biography';
$data = ['description' => 'Your biography text'];

$ch = curl_init($url);
curl_setopt(
    $ch,
    CURLOPT_HTTPHEADER,
    array('Content-Type: application/x-www-form-urlencoded', 'Authorization: Bearer ' . $accessToken)
);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_POSTFIELDS, http_build_query($data));

$response = curl_exec($ch);
$json = json_decode($response);

if($json->success){
    var_dump($json->data);
}

curl_close($ch);
```

{% endtab %}

{% tab title="Curl" %}

```
curl -X POST https://public-api.expertfile.com/v2/organization/:corporation/staff/:username/biography \
    -H "Content-Type: application/json" \
    -H "Authorization: Bearer <ACCESS TOKEN>" \
    -d '{"description":"Your biography text"}'
```

{% endtab %}
{% endtabs %}


# Categories

CRUD endpoints for a user's categories

{% hint style="info" %}
Please note that in all urls & code samples you'll need to replace`:username` and `:corporation` with appropriate values
{% endhint %}

## Get All Categories

<mark style="color:green;">`GET`</mark>[ **/v2/organization/:corporation/staff/:username/category**](https://public-api.expertfile.com/v2/organization/:corporation/staff/:username/category)

**Headers**

| Name          | Value              |
| ------------- | ------------------ |
| Content-Type  | `application/json` |
| Authorization | `Bearer <token>`   |

**Url**

<table><thead><tr><th width="339.3333333333333">Name</th><th>Type</th><th>Description</th></tr></thead><tbody><tr><td>corporation</td><td>number</td><td>Corporation ID</td></tr><tr><td>username</td><td>string</td><td>Unique username</td></tr></tbody></table>

**Response**

{% tabs %}
{% tab title="200" %}

```json
 {
  data: [
    {
      id: 1,
      category_id: 1,
      category: "category name"
    }
  ],
  success: true
}
```

{% endtab %}
{% endtabs %}

Code

{% tabs %}
{% tab title="Node" %}

```javascript
const accessToken = `<ACCESS TOKEN>`

fetch('https://public-api.expertfile.com/v2/organization/:corporation/staff/:username/category', {
    method: 'GET',
    headers: {
        'Content-Type': 'application/x-www-form-urlencoded',
        'Authorization': `Bearer ${accessToken}`
    }
})
.then(response => response.json())
.then(json => {
    const { success, data } = json

    if (success) {
        const category = data
        console.log('category', category)
    }

})
.catch(error => console.error(error));
```

{% endtab %}

{% tab title="PHP" %}

```php
$accessToken = urlencode('<ACCESS TOKEN>');
$url = 'https://public-api.expertfile.com/v2/organization/:corporation/staff/:username/category';

$ch = curl_init($url);
curl_setopt(
    $ch,
    CURLOPT_HTTPHEADER,
    array('Content-Type: application/x-www-form-urlencoded', 'Authorization: Bearer ' . $accessToken)
);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);

$response = curl_exec($ch);
$json = json_decode($response);

if($json->success){
    var_dump($json->data);
}

curl_close($ch);

```

{% endtab %}

{% tab title="Curl" %}

```
curl https://public-api.expertfile.com/v2/organi
zation/:corporation/staff/:username/category \
    -H "Content-Type: application/json" \
    -H "Authorization: Bearer <ACCESS TOKEN>"
```

{% endtab %}
{% endtabs %}

## Get Individual Category

<mark style="color:green;">`GET`</mark> [**/v2/organization/:corporation/staff/:username/category/:id**](https://public-api.expertfile.com/v2/organization/:corporation/staff/:username/category/:id)

**Headers**

| Name          | Value              |
| ------------- | ------------------ |
| Content-Type  | `application/json` |
| Authorization | `Bearer <token>`   |

**Url**

<table><thead><tr><th width="339.3333333333333">Name</th><th>Type</th><th>Description</th></tr></thead><tbody><tr><td>corporation</td><td>number</td><td>Corporation ID</td></tr><tr><td>username</td><td>string</td><td>Unique username</td></tr><tr><td>id</td><td>number</td><td>Category ID</td></tr></tbody></table>

**Response**

{% tabs %}
{% tab title="200" %}

```json
{
  data: [
    {
      id: 1,
      category_id: 1,
      category: "category name"
    }
  ],
  success: true
}
```

{% endtab %}
{% endtabs %}

Code

{% tabs %}
{% tab title="Node" %}

```javascript
const accessToken = `<ACCESS CODE>`

fetch('https://public-api.expertfile.com/v2/organization/:corporation/staff/:username/category/:id', {
    method: 'GET',
    headers: {
        'Content-Type': 'application/x-www-form-urlencoded',
        'Authorization': `Bearer ${accessToken}`
    }
})
.then(response => response.json())
.then(json => {
    const { success, data } = json

    if (success) {
        const category = data
        console.log('category', category[0])
    }

})
.catch(error => console.error(error));
```

{% endtab %}

{% tab title="PHP" %}

```php
$accessToken = urlencode('<ACCESS TOKEN>');
$url = 'https://public-api.expertfile.com/v2/organization/:corporation/staff/:username/category/:id';

$ch = curl_init($url);
curl_setopt(
    $ch,
    CURLOPT_HTTPHEADER,
    array('Content-Type: application/x-www-form-urlencoded', 'Authorization: Bearer ' . $accessToken)
);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);

$response = curl_exec($ch);
$json = json_decode($response);

if($json->success){
    var_dump($json->data);
}

curl_close($ch);
```

{% endtab %}

{% tab title="Curl" %}

```
curl -X GET https://public-api.expertfile.com/v2/organization/:corporation/staff/:username/category/:id \
    -H "Content-Type: application/json" \
    -H "Authorization: Bearer <ACCESS TOKEN>"     
```

{% endtab %}
{% endtabs %}

## Create Category

<mark style="color:blue;">`POST`</mark> [**/v2/organization/:corporation/staff/:username/category**](https://public-api.expertfile.com/v2/organization/:corporation/staff/:username/category)

**Headers**

| Name          | Value              |
| ------------- | ------------------ |
| Content-Type  | `application/json` |
| Authorization | `Bearer <token>`   |

**Url**

<table><thead><tr><th width="339.3333333333333">Name</th><th>Type</th><th>Description</th></tr></thead><tbody><tr><td>corporation</td><td>number</td><td>Corporation ID</td></tr><tr><td>username</td><td>string</td><td>Unique username</td></tr></tbody></table>

**Body**

<table><thead><tr><th width="339.3333333333333">Name</th><th>Type</th><th>Description</th></tr></thead><tbody><tr><td>name<mark style="color:red;">*</mark></td><td>string</td><td>Category Name</td></tr></tbody></table>

**Response**

{% tabs %}
{% tab title="200" %}

```json
{ 
    data: { 
        id: 1
    }, 
    success: true 
}
```

{% endtab %}
{% endtabs %}

**Code**

{% tabs %}
{% tab title="Node" %}

```javascript
const data = new URLSearchParams();
const accessToken = `<ACCESS TOKEN>`

data.append('name', 'Test');

fetch('https://public-api.expertfile.com/v2/organization/:corporation/staff/:username/category', {
    method: 'POST',
    headers: {
        'Content-Type': 'application/x-www-form-urlencoded',
        'Authorization': `Bearer ${accessToken}`
    },
    body: data
})
.then(response => response.json())
.then(json => {
    const { success, data, error } = json

    if (success) {
        const { id } = data
        console.log('New category id', id)
    }

})
.catch(error => console.error(error));

```

{% endtab %}

{% tab title="PHP" %}

```php
$accessToken = urlencode('<ACCESS TOKEN>');

$url = 'https://public-api.expertfile.com/v2/organization/:corporation/staff/:username/category';
$data = ['name' => 'Test'];

$ch = curl_init($url);
curl_setopt(
    $ch,
    CURLOPT_HTTPHEADER,
    array('Content-Type: application/x-www-form-urlencoded', 'Authorization: Bearer ' . $accessToken)
);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_POSTFIELDS, http_build_query($data));

$response = curl_exec($ch);
$json = json_decode($response);

if($json->success){
    var_dump($json->data);
}

curl_close($ch);
```

{% endtab %}

{% tab title="Curl" %}

```
curl -X POST https://public-api.expertfile.com/v2/organization/:corporation/staff/:username/category \
    -H "Content-Type: application/json" \
    -H "Authorization: Bearer <ACCESS TOKEN>" \
    -d '{"name":"Test"}'
```

{% endtab %}
{% endtabs %}

## Delete Category

<mark style="color:red;">`DELETE`</mark>[**/v2/organization/:corporation/staff/:username/category/:id**](https://public-api.expertfile.com/v2/organization/:corporation/staff/:username/category/:id)

**Headers**

| Name          | Value              |
| ------------- | ------------------ |
| Content-Type  | `application/json` |
| Authorization | `Bearer <token>`   |

**Url**

<table><thead><tr><th width="339.3333333333333">Name</th><th>Type</th><th>Description</th></tr></thead><tbody><tr><td>corporation</td><td>number</td><td>Corporation ID</td></tr><tr><td>username</td><td>string</td><td>Unique username</td></tr><tr><td>id</td><td>number</td><td>Category ID</td></tr></tbody></table>

**Response**

{% tabs %}
{% tab title="200" %}

```json
{ 
    data: { 
        deleted: true, 
        id: 1
    }, 
    success: true 
}
```

{% endtab %}
{% endtabs %}

Code

{% tabs %}
{% tab title="Node" %}

```javascript
const accessToken = `<ACCESS TOKEN>`

fetch('https://public-api.expertfile.com/v2/organization/:corporation/staff/:username/category/:id', {
    method: 'DELETE',
    headers: {
        'Content-Type': 'application/x-www-form-urlencoded',
        'Authorization': `Bearer ${accessToken}`
    }
})
.then(response => response.json())
.then(json => {
    const { success, data, error } = json

    if (success) {
        const { id } = data
        console.log('Deleted category id', id)
    }

})
.catch(error => console.error(error));

```

{% endtab %}

{% tab title="PHP" %}

```php
$accessToken = urlencode('<ACCESS TOKEN>');

$url = 'https://public-api.expertfile.com/v2/organization/:corporation/staff/:username/category/:id';

$ch = curl_init($url);
curl_setopt(
    $ch,
    CURLOPT_HTTPHEADER,
    array('Content-Type: application/x-www-form-urlencoded', 'Authorization: Bearer ' . $accessToken)
);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_CUSTOMREQUEST, "DELETE");

$response = curl_exec($ch);
$json = json_decode($response);

if($json->success){
    var_dump($json->data);
}

curl_close($ch);
```

{% endtab %}

{% tab title="Curl" %}

```
curl -X DELETE https://public-api.expertfile.com/v2/organization/:corporation/staff/:username/category/:id \
    -H "Content-Type: application/json" \
    -H "Authorization: Bearer <ACCESS TOKEN>"
```

{% endtab %}
{% endtabs %}


# Education

CRUD endpoints for a user's education

{% hint style="info" %}
Please note that in all urls & code samples you'll need to replace`:username` and `:corporation` with appropriate values
{% endhint %}

## Get All Education

<mark style="color:green;">`GET`</mark> [**/v2/organization/:corporation/staff/:username/education**](https://public-api.expertfile.com/v2/organization/:corporation/expert/:username/education)

**Headers**

| Name          | Value              |
| ------------- | ------------------ |
| Content-Type  | `application/json` |
| Authorization | `Bearer <token>`   |

**Url**

<table><thead><tr><th width="339.3333333333333">Name</th><th>Type</th><th>Description</th></tr></thead><tbody><tr><td>corporation</td><td>number</td><td>Corporation ID</td></tr><tr><td>username</td><td>string</td><td>Unique username</td></tr></tbody></table>

**Response**

{% tabs %}
{% tab title="200" %}

```json
 {
  data: [
    {
      id: 1,
      institution: "Instituion Name",
      degree: 'Degree Name',
      description: 'Description',
      major: 'Major',
      date: 2000
    },
  ],
  success: true
}
```

{% endtab %}
{% endtabs %}

Code

{% tabs %}
{% tab title="Node" %}

```javascript
const accessToken = `<ACCESS CODE>`

fetch('https://public-api.expertfile.com/v2/organization/:corporation/staff/:username/education', {
    method: 'GET',
    headers: {
        'Content-Type': 'application/x-www-form-urlencoded',
        'Authorization': `Bearer ${accessToken}`
    }
})
.then(response => response.json())
.then(json => {
    const { success, data } = json

    if (success) {
        const education = data;
        console.log('all education', education)
    }

})
.catch(error => console.error(error));
```

{% endtab %}

{% tab title="PHP" %}

```php
$accessToken = urlencode('<ACCESS TOKEN>');
$url = 'https://public-api.expertfile.com/v2/organization/:corporation/staff/:username/education';

$ch = curl_init($url);
curl_setopt(
    $ch,
    CURLOPT_HTTPHEADER,
    array('Content-Type: application/x-www-form-urlencoded', 'Authorization: Bearer ' . $accessToken)
);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);

$response = curl_exec($ch);
$json = json_decode($response);

if($json->success){
    var_dump($json->data);
}

curl_close($ch);

```

{% endtab %}

{% tab title="Curl" %}

```
curl https://public-api.expertfile.com/v2/organization/:corporation/staff/:username/education \
    -H "Content-Type: application/json" \
    -H "Authorization: Bearer <ACCESS TOKEN>"
```

{% endtab %}
{% endtabs %}

## Get Individual Education

<mark style="color:green;">`GET`</mark> [**/v2/organization/:corporation/staff/:username/education/:id**](https://public-api.expertfile.com/v2/organization/:corporation/expert/:username/education/:id)

**Headers**

| Name          | Value              |
| ------------- | ------------------ |
| Content-Type  | `application/json` |
| Authorization | `Bearer <token>`   |

**Url**

<table><thead><tr><th width="339.3333333333333">Name</th><th>Type</th><th>Description</th></tr></thead><tbody><tr><td>corporation</td><td>number</td><td>Corporation ID</td></tr><tr><td>username</td><td>string</td><td>Unique username</td></tr><tr><td>id</td><td>number</td><td>Education ID</td></tr></tbody></table>

**Response**

{% tabs %}
{% tab title="200" %}

```json
 {
  data: [
    {
      id: 1,
      institution: "Instituion Name",
      degree: 'Degree Name',
      description: 'Description',
      major: 'Major',
      date: 2000
    },
  ],
  success: true
}
```

{% endtab %}
{% endtabs %}

Code

{% tabs %}
{% tab title="Node" %}

```javascript
const accessToken = `<ACCESS CODE>`

fetch('https://public-api.expertfile.com/v2/organization/:corporation/staff/:username/education/:id', {
    method: 'GET',
    headers: {
        'Content-Type': 'application/x-www-form-urlencoded',
        'Authorization': `Bearer ${accessToken}`
    }
})
.then(response => response.json())
.then(json => {
    const { success, data, error } = json

    if (success) {
        console.log('education', data)
    }

})
.catch(error => console.error(error));
```

{% endtab %}

{% tab title="PHP" %}

```php
$accessToken = urlencode('<ACCESS TOKEN>');
$url = 'https://public-api.expertfile.com/v2/organization/:corporation/staff/:username/education/:id';

$ch = curl_init($url);
curl_setopt(
    $ch,
    CURLOPT_HTTPHEADER,
    array('Content-Type: application/x-www-form-urlencoded', 'Authorization: Bearer ' . $accessToken)
);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);

$response = curl_exec($ch);
$json = json_decode($response);

if($json->success){
    var_dump($json->data);
}

curl_close($ch);
```

{% endtab %}

{% tab title="Curl" %}

```
curl -X GET https://public-api.expertfile.com/v2/organization/:corporation/staff/:username/education/:id \
    -H "Content-Type: application/json" \
    -H "Authorization: Bearer <ACCESS TOKEN>"     
```

{% endtab %}
{% endtabs %}

## Create Education

<mark style="color:blue;">`POST`</mark> [**/v2/organization/:corporation/staff/:username/education**](https://public-api.expertfile.com/v2/organization/:corporation/expert/:username/education/:id)

**Headers**

| Name          | Value              |
| ------------- | ------------------ |
| Content-Type  | `application/json` |
| Authorization | `Bearer <token>`   |

**Url**

<table><thead><tr><th width="339.3333333333333">Name</th><th>Type</th><th>Description</th></tr></thead><tbody><tr><td>corporation</td><td>number</td><td>Corporation ID</td></tr><tr><td>username</td><td>string</td><td>Unique username</td></tr></tbody></table>

**Body**

<table><thead><tr><th width="339.3333333333333">Name</th><th>Type</th><th>Description</th></tr></thead><tbody><tr><td>institution<mark style="color:red;">*</mark></td><td>string</td><td>Institution Name</td></tr><tr><td>degree<mark style="color:red;">*</mark></td><td>string</td><td>Degree Name</td></tr><tr><td>major</td><td>string</td><td>Major</td></tr><tr><td>description</td><td>string</td><td>Description</td></tr><tr><td>date</td><td>string</td><td>Graduation date(i.e. '2004')</td></tr></tbody></table>

**Response**

{% tabs %}
{% tab title="200" %}

```json
{ 
    data: { 
        id: 1
    }, 
    success: true 
}
```

{% endtab %}
{% endtabs %}

**Code**

{% tabs %}
{% tab title="Node" %}

```javascript
const data = new URLSearchParams();
const accessToken = `<ACCESS TOKEN>`

data.append('institution', 'University Name');
data.append('degree', 'BSc.');
data.append('major', 'Mathematics');
data.append('description', 'Some additional info. on my degree')
data.append('date', '2004')

fetch('https://public-api.expertfile.com/v2/organization/:corporation/staff/:username/education', {
    method: 'POST',
    headers: {
        'Content-Type': 'application/x-www-form-urlencoded',
        'Authorization': `Bearer ${accessToken}`
    },
    body: data
})
.then(response => response.json())
.then(json => {
    const { success, data, error } = json

    if (success) {
        const { id } = data
        console.log('New education id', id)
    }

})
.catch(error => console.error(error));
```

{% endtab %}

{% tab title="PHP" %}

```php
$accessToken = urlencode('<ACCESS TOKEN>');

$url = 'https://public-api.expertfile.com/v2/organization/:corporation/staff/:username/education';
$data = ['institution' => 'University Name', 'degree' => 'BSc.', 'major' => 'Mathematics', 'description' => 'Some additional info. on my degree', 'date' => '2004'];

$ch = curl_init($url);
curl_setopt(
    $ch,
    CURLOPT_HTTPHEADER,
    array('Content-Type: application/x-www-form-urlencoded', 'Authorization: Bearer ' . $accessToken)
);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_POSTFIELDS, http_build_query($data));

$response = curl_exec($ch);
$json = json_decode($response);

if($json->success){
    var_dump($json->data);
}

curl_close($ch)
```

{% endtab %}

{% tab title="Curl" %}

```
curl -X POST https://public-api.expertfile.com/v2/organization/:corporation/staff/:username/education \
    -H "Content-Type: application/json" \
    -H "Authorization: Bearer <ACCESS TOKEN>" \
    -d '{"institution": "University Name", "degree": "BSc.", "major": "Mathematics", "description": "Some additional info. on my degree", "date":  "2004"}'
```

{% endtab %}
{% endtabs %}

## Update Education

<mark style="color:blue;">`PUT`</mark> [**/v2/organization/:corporation/staff/:username/education/:id**](https://public-api.expertfile.com/v2/organization/:corporation/expert/:username/education/:id)

**Headers**

| Name          | Value              |
| ------------- | ------------------ |
| Content-Type  | `application/json` |
| Authorization | `Bearer <token>`   |

**Url**

<table><thead><tr><th width="339.3333333333333">Name</th><th>Type</th><th>Description</th></tr></thead><tbody><tr><td>corporation</td><td>number</td><td>Corporation ID</td></tr><tr><td>username</td><td>string</td><td>Unique username</td></tr><tr><td>id</td><td>number</td><td>Education ID</td></tr></tbody></table>

**Body**

<table><thead><tr><th width="339.3333333333333">Name</th><th>Type</th><th>Description</th></tr></thead><tbody><tr><td>institution<mark style="color:red;">*</mark></td><td>string</td><td>Institution Name</td></tr><tr><td>degree<mark style="color:red;">*</mark></td><td>string</td><td>Degree Name</td></tr><tr><td>major</td><td>string</td><td>Major</td></tr><tr><td>description</td><td>string</td><td>Description</td></tr><tr><td>date</td><td>string</td><td>Graduation date(i.e. '2004')</td></tr></tbody></table>

**Response**

{% tabs %}
{% tab title="200" %}

```json
{ 
    data: { 
        id: 1, 
        updated: true 
    }, 
    success: true 
}
```

{% endtab %}
{% endtabs %}

Code

{% tabs %}
{% tab title="Node" %}

```javascript
const data = new URLSearchParams();
const accessToken = `<ACCESS TOKEN>`

data.append('institution', 'University Name');
data.append('degree', 'BSc.');
data.append('major', 'Mathematics');
data.append('description', 'Some additional info. on my degree')
data.append('date', '2004')

fetch('https://public-api.expertfile.com/v2/organization/:corporation/staff/:username/education/:id', {
    method: 'PUT',
    headers: {
        'Content-Type': 'application/x-www-form-urlencoded',
        'Authorization': `Bearer ${accessToken}`
    },
    body: data
})
.then(response => response.json())
.then(json => {
    const { success, data, error } = json

    if (success) {
        const { id } = data
        console.log('New education id', id)
    }

})
.catch(error => console.error(error));

```

{% endtab %}

{% tab title="PHP" %}

```php
$accessToken = urlencode('<ACCESS TOKEN>');

$url = 'https://public-api.expertfile.com/v2/organization/:corporation/staff/:username/education/:id';
$data = ['institution' => 'University Name', 'degree' => 'BSc.', 'major' => 'Mathematics', 'description' => 'Some additional info. on my degree', 'date' => '2004'];

$ch = curl_init($url);
curl_setopt(
    $ch,
    CURLOPT_HTTPHEADER,
    array('Content-Type: application/x-www-form-urlencoded', 'Authorization: Bearer ' . $accessToken)
);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_PUT, http_build_query($data));

$response = curl_exec($ch);
$json = json_decode($response);

if($json->success){
    var_dump($json->data);
}

curl_close($ch)
```

{% endtab %}

{% tab title="Curl" %}

```
curl -X PUT https://public-api.expertfile.com/v2/organization/:corporation/staff/:username/education/:id \
    -H "Content-Type: application/json" \
    -H "Authorization: Bearer <ACCESS TOKEN>" \
    -d '{"institution": "University Name", "degree": "BSc.", "major": "Mathematics", "description": "Some additional info. on my degree", "date":  "2004"}'
```

{% endtab %}
{% endtabs %}

## Delete Education

<mark style="color:red;">`DELETE`</mark> [**/v2/organization/:corporation/expert/:username/education/:id**](https://public-api.expertfile.com/v2/organization/:corporation/expert/:username/education/:id)

**Headers**

| Name          | Value              |
| ------------- | ------------------ |
| Content-Type  | `application/json` |
| Authorization | `Bearer <token>`   |

**Url**

<table><thead><tr><th width="339.3333333333333">Name</th><th>Type</th><th>Description</th></tr></thead><tbody><tr><td>corporation</td><td>number</td><td>Corporation ID</td></tr><tr><td>username</td><td>string</td><td>Unique username</td></tr><tr><td>id</td><td>number</td><td>Education ID</td></tr></tbody></table>

**Response**

{% tabs %}
{% tab title="200" %}

```json
{ 
    data: { 
        deleted: true, 
        id: 1 
    }, 
    success: true 
}
```

{% endtab %}
{% endtabs %}

Code

{% tabs %}
{% tab title="Node" %}

```javascript
const accessToken = `<ACCESS TOKEN>`

fetch('https://public-api.expertfile.com/v2/organization/:corporation/staff/:username/education/:id', {
    method: 'DELETE',
    headers: {
        'Content-Type': 'application/x-www-form-urlencoded',
        'Authorization': `Bearer ${accessToken}`
    }
})
.then(response => response.json())
.then(json => {
    const { success, data, error } = json

    if (success) {
        const { id } = data
        console.log('Deleted education id', id)
    }

})
.catch(error => console.error(error));

```

{% endtab %}

{% tab title="PHP" %}

```php
$accessToken = urlencode('<ACCESS TOKEN>');

$url = 'https://public-api.expertfile.com/v2/organization/:corporation/staff/:username/education/:id';

$ch = curl_init($url);
curl_setopt(
    $ch,
    CURLOPT_HTTPHEADER,
    array('Content-Type: application/x-www-form-urlencoded', 'Authorization: Bearer ' . $accessToken)
);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_CUSTOMREQUEST, "DELETE");

$response = curl_exec($ch);
$json = json_decode($response);

if($json->success){
    var_dump($json->data);
}

curl_close($ch);
```

{% endtab %}

{% tab title="Curl" %}

```
curl -X DELETE https://public-api.expertfile.com/v2/organization/:corporation/staff/:username/education/:id \
    -H "Content-Type: application/json" \
    -H "Authorization: Bearer <ACCESS TOKEN>"
```

{% endtab %}
{% endtabs %}


# Languages

CRUD endpoints for a user's languages

{% hint style="info" %}
Please note that in all urls & code samples you'll need to replace`:username` and `:corporation` with appropriate values
{% endhint %}

## Get All Languages

<mark style="color:green;">`GET`</mark>[ **/v2/organization/:corporation/staff/:username/language**](https://public-api.expertfile.com/v2/organization/:corporation/expert/:username/language)

**Headers**

| Name          | Value              |
| ------------- | ------------------ |
| Content-Type  | `application/json` |
| Authorization | `Bearer <token>`   |

**Url**

<table><thead><tr><th width="339.3333333333333">Name</th><th>Type</th><th>Description</th></tr></thead><tbody><tr><td>corporation</td><td>number</td><td>Corporation ID</td></tr><tr><td>username</td><td>string</td><td>Unique username</td></tr></tbody></table>

**Response**

{% tabs %}
{% tab title="200" %}

```json
 {
  data: [
    {
      id: 1,
      name: "langauge"
    }
  ],
  success: true
}
```

{% endtab %}
{% endtabs %}

Code

{% tabs %}
{% tab title="Node" %}

```javascript
const accessToken = `<ACCESS TOKEN>`

fetch('https://public-api.expertfile.com/v2/organization/:corporation/staff/:username/language', {
    method: 'GET',
    headers: {
        'Content-Type': 'application/x-www-form-urlencoded',
        'Authorization': `Bearer ${accessToken}`
    }
})
.then(response => response.json())
.then(json => {
    const { success, data } = json

    if (success) {
        const language = data
        console.log('language', language)
    }

})
.catch(error => console.error(error));
```

{% endtab %}

{% tab title="PHP" %}

```php
$accessToken = urlencode('<ACCESS TOKEN>');
$url = 'https://public-api.expertfile.com/v2/organization/:corporation/staff/:username/language';

$ch = curl_init($url);
curl_setopt(
    $ch,
    CURLOPT_HTTPHEADER,
    array('Content-Type: application/x-www-form-urlencoded', 'Authorization: Bearer ' . $accessToken)
);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);

$response = curl_exec($ch);
$json = json_decode($response);

if($json->success){
    var_dump($json->data);
}

curl_close($ch);

```

{% endtab %}

{% tab title="Curl" %}

```
curl https://public-api.expertfile.com/v2/organization/:corporation/staff/:username/language \
    -H "Content-Type: application/json" \
    -H "Authorization: Bearer <ACCESS TOKEN>"
```

{% endtab %}
{% endtabs %}

## Get Individual Language

<mark style="color:green;">`GET`</mark>[ **/v2/organization/:corporation/staff/:username/language/:id**](https://public-api.expertfile.com/v2/organization/:corporation/staff/:username/language/:id)

**Headers**

| Name          | Value              |
| ------------- | ------------------ |
| Content-Type  | `application/json` |
| Authorization | `Bearer <token>`   |

**Url**

<table><thead><tr><th width="339.3333333333333">Name</th><th>Type</th><th>Description</th></tr></thead><tbody><tr><td>corporation</td><td>number</td><td>Corporation ID</td></tr><tr><td>username</td><td>string</td><td>Unique username</td></tr><tr><td>id</td><td>number</td><td>Language ID</td></tr></tbody></table>

**Response**

{% tabs %}
{% tab title="200" %}

```json
{
  data: [
    {
      id: 1,
      name: "language"
    }
  ],
  success: true
}
```

{% endtab %}
{% endtabs %}

Code

{% tabs %}
{% tab title="Node" %}

```javascript
const accessToken = `<ACCESS CODE>`

fetch('https://public-api.expertfile.com/v2/organization/:corporation/staff/:username/language/:id', {
    method: 'GET',
    headers: {
        'Content-Type': 'application/x-www-form-urlencoded',
        'Authorization': `Bearer ${accessToken}`
    }
})
.then(response => response.json())
.then(json => {
    const { success, data } = json

    if (success) {
        const language = data
        console.log('language', language[0])
    }

})
.catch(error => console.error(error));
```

{% endtab %}

{% tab title="PHP" %}

```php
$accessToken = urlencode('<ACCESS TOKEN>');
$url = 'https://public-api.expertfile.com/v2/organization/:corporation/staff/:username/language/:id';

$ch = curl_init($url);
curl_setopt(
    $ch,
    CURLOPT_HTTPHEADER,
    array('Content-Type: application/x-www-form-urlencoded', 'Authorization: Bearer ' . $accessToken)
);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);

$response = curl_exec($ch);
$json = json_decode($response);

if($json->success){
    var_dump($json->data);
}

curl_close($ch);
```

{% endtab %}

{% tab title="Curl" %}

```
curl -X GET https://public-api.expertfile.com/v2/organization/:corporation/staff/:username/language/:id \
    -H "Content-Type: application/json" \
    -H "Authorization: Bearer <ACCESS TOKEN>"     
```

{% endtab %}
{% endtabs %}

## Create Language

<mark style="color:blue;">`POST`</mark> [**/v2/organization/:corporation/staff/:username/language**](https://public-api.expertfile.com/v2/organization/:corporation/staff/:username/language/)

**Headers**

| Name          | Value              |
| ------------- | ------------------ |
| Content-Type  | `application/json` |
| Authorization | `Bearer <token>`   |

**Url**

<table><thead><tr><th width="339.3333333333333">Name</th><th>Type</th><th>Description</th></tr></thead><tbody><tr><td>corporation</td><td>number</td><td>Corporation ID</td></tr><tr><td>username</td><td>string</td><td>Unique username</td></tr></tbody></table>

**Body**

<table><thead><tr><th width="339.3333333333333">Name</th><th>Type</th><th>Description</th></tr></thead><tbody><tr><td>name<mark style="color:red;">*</mark></td><td>string</td><td>Language Name</td></tr></tbody></table>

**Response**

{% tabs %}
{% tab title="200" %}

```json
{ 
    data: { 
        id: 1
    }, 
    success: true 
}
```

{% endtab %}
{% endtabs %}

Code

{% tabs %}
{% tab title="Node" %}

```javascript
const data = new URLSearchParams();
const accessToken = `<ACCESS TOKEN>`

data.append('name', 'Spanish');

fetch('https://public-api.expertfile.com/v2/organization/:corporation/staff/:username/language', {
    method: 'POST',
    headers: {
        'Content-Type': 'application/x-www-form-urlencoded',
        'Authorization': `Bearer ${accessToken}`
    },
    body: data
})
.then(response => response.json())
.then(json => {
    const { success, data, error } = json

    if (success) {
        const { id } = data
        console.log('New language id', id)
    }

})
.catch(error => console.error(error));

```

{% endtab %}

{% tab title="PHP" %}

```php
$accessToken = urlencode('<ACCESS TOKEN>');

$url = 'https://public-api.expertfile.com/v2/organization/:corporation/staff/:username/language';
$data = ['name' => 'Spanish'];

$ch = curl_init($url);
curl_setopt(
    $ch,
    CURLOPT_HTTPHEADER,
    array('Content-Type: application/x-www-form-urlencoded', 'Authorization: Bearer ' . $accessToken)
);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_POSTFIELDS, http_build_query($data));

$response = curl_exec($ch);
$json = json_decode($response);

if($json->success){
    var_dump($json->data);
}

curl_close($ch);
```

{% endtab %}

{% tab title="Curl" %}

```
curl -X POST https://public-api.expertfile.com/v2/organization/:corporation/staff/:username/language \
    -H "Content-Type: application/json" \
    -H "Authorization: Bearer <ACCESS TOKEN>" \
    -d '{"name":"Spanish"}'
```

{% endtab %}
{% endtabs %}

## Update Language

<mark style="color:blue;">`PUT`</mark> [**/v2/organization/:corporation/staff/:username/language/:id**](https://public-api.expertfile.com/v2/organization/:corporation/staff/:username/language/:id)

**Headers**

| Name          | Value              |
| ------------- | ------------------ |
| Content-Type  | `application/json` |
| Authorization | `Bearer <token>`   |

**Url**

<table><thead><tr><th width="339.3333333333333">Name</th><th>Type</th><th>Description</th></tr></thead><tbody><tr><td>corporation</td><td>number</td><td>Corporation ID</td></tr><tr><td>username</td><td>string</td><td>Unique username</td></tr><tr><td>id</td><td>number</td><td>Language ID</td></tr></tbody></table>

**Body**

<table><thead><tr><th width="339.3333333333333">Name</th><th>Type</th><th>Description</th></tr></thead><tbody><tr><td>name<mark style="color:red;">*</mark></td><td>string</td><td>Language Name</td></tr></tbody></table>

**Response**

{% tabs %}
{% tab title="200" %}

```json
{ 
    data: { 
        id: 1
    }, 
    success: true 
}
```

{% endtab %}
{% endtabs %}

Code

{% tabs %}
{% tab title="Node" %}

```javascript
const data = new URLSearchParams();
const accessToken = `<ACCESS TOKEN>`

data.append('name', 'Spanish');

fetch('https://public-api.expertfile.com/v2/organization/:corporation/staff/:username/language/:id', {
    method: 'PUT',
    headers: {
        'Content-Type': 'application/x-www-form-urlencoded',
        'Authorization': `Bearer ${accessToken}`
    },
    body: data
})
.then(response => response.json())
.then(json => {
    const { success, data, error } = json

    if (success) {
        const { id } = data
        console.log('Updated language id', id)
    }

})
.catch(error => console.error(error));

```

{% endtab %}

{% tab title="PHP" %}

```php
$accessToken = urlencode('<ACCESS TOKEN>');

$url = 'https://public-api.expertfile.com/v2/organization/:corporation/staff/:username/language/:id';
$data = ['name' => 'Spanish'];

$ch = curl_init($url);
curl_setopt(
    $ch,
    CURLOPT_HTTPHEADER,
    array('Content-Type: application/x-www-form-urlencoded', 'Authorization: Bearer ' . $accessToken)
);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_PUT, http_build_query($data));

$response = curl_exec($ch);
$json = json_decode($response);

if($json->success){
    var_dump($json->data);
}

curl_close($ch);
```

{% endtab %}

{% tab title="Curl" %}

```
curl -X PUT https://public-api.expertfile.com/v2/organization/:corporation/staff/:username/language/:id \
    -H "Content-Type: application/json" \
    -H "Authorization: Bearer <ACCESS TOKEN>" \
    -d '{"name":"Spanish"}'
```

{% endtab %}
{% endtabs %}

## Delete Language

<mark style="color:red;">`DELETE`</mark>[**/v2/organization/:corporation/staff/:username/language/:id**](https://public-api.expertfile.com/v2/organization/:corporation/staff/:username/language/:id)

**Headers**

| Name          | Value              |
| ------------- | ------------------ |
| Content-Type  | `application/json` |
| Authorization | `Bearer <token>`   |

**Url**

<table><thead><tr><th width="339.3333333333333">Name</th><th>Type</th><th>Description</th></tr></thead><tbody><tr><td>corporation</td><td>number</td><td>Corporation ID</td></tr><tr><td>username</td><td>string</td><td>Unique username</td></tr><tr><td>id</td><td>number</td><td>Language ID</td></tr></tbody></table>

**Response**

{% tabs %}
{% tab title="200" %}

```json
{ 
    data: { 
        deleted: true, 
        id: 1
    }, 
    success: true 
}
```

{% endtab %}
{% endtabs %}

Code

{% tabs %}
{% tab title="Node" %}

```javascript
const accessToken = `<ACCESS TOKEN>`

fetch('https://public-api.expertfile.com/v2/organization/:corporation/staff/:username/language/:id', {
    method: 'DELETE',
    headers: {
        'Content-Type': 'application/x-www-form-urlencoded',
        'Authorization': `Bearer ${accessToken}`
    }
})
.then(response => response.json())
.then(json => {
    const { success, data, error } = json

    if (success) {
        const { id } = data
        console.log('Deleted language id', id)
    }

})
.catch(error => console.error(error));

```

{% endtab %}

{% tab title="PHP" %}

```php
$accessToken = urlencode('<ACCESS TOKEN>');

$url = 'https://public-api.expertfile.com/v2/organization/:corporation/staff/:username/language/:id';

$ch = curl_init($url);
curl_setopt(
    $ch,
    CURLOPT_HTTPHEADER,
    array('Content-Type: application/x-www-form-urlencoded', 'Authorization: Bearer ' . $accessToken)
);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_CUSTOMREQUEST, "DELETE");

$response = curl_exec($ch);
$json = json_decode($response);

if($json->success){
    var_dump($json->data);
}

curl_close($ch);
```

{% endtab %}

{% tab title="Curl" %}

```
curl -X DELETE https://public-api.expertfile.com/v2/organization/:corporation/staff/:username/language/:id \
    -H "Content-Type: application/json" \
    -H "Authorization: Bearer <ACCESS TOKEN>"
```

{% endtab %}
{% endtabs %}


# Links

CRUD endpoints for a user's custom links

{% hint style="info" %}
Please note that in all urls & code samples you'll need to replace`:username` and `:corporation` with appropriate values
{% endhint %}

## Get All Links

<mark style="color:green;">`GET`</mark> [**/v2/organization/:corporation/staff/:username/link**](https://public-api.expertfile.com/v2/organization/:corporation/staff/:username/link)

**Headers**

| Name          | Value              |
| ------------- | ------------------ |
| Content-Type  | `application/json` |
| Authorization | `Bearer <token>`   |

**Url**

<table><thead><tr><th width="339.3333333333333">Name</th><th>Type</th><th>Description</th></tr></thead><tbody><tr><td>corporation</td><td>number</td><td>Corporation ID</td></tr><tr><td>username</td><td>string</td><td>Unique username</td></tr></tbody></table>

**Response**

{% tabs %}
{% tab title="200" %}

```json
 {
  data: [
    {
      id: 1,
      name: "link name",
      url: "link url"
    }
  ],
  success: true
}
```

{% endtab %}
{% endtabs %}

Code

{% tabs %}
{% tab title="Node" %}

```javascript
const accessToken = `<ACCESS TOKEN>`

fetch('https://public-api.expertfile.com/v2/organization/:corporation/staff/:username/link', {
    method: 'GET',
    headers: {
        'Content-Type': 'application/x-www-form-urlencoded',
        'Authorization': `Bearer ${accessToken}`
    }
})
.then(response => response.json())
.then(json => {
    const { success, data } = json

    if (success) {
        const links = data
        console.log('links', links)
    }

})
.catch(error => console.error(error));
```

{% endtab %}

{% tab title="PHP" %}

```php
$accessToken = urlencode('<ACCESS TOKEN>');
$url = 'https://public-api.expertfile.com/v2/organization/:corporation/staff/:username/link';

$ch = curl_init($url);
curl_setopt(
    $ch,
    CURLOPT_HTTPHEADER,
    array('Content-Type: application/x-www-form-urlencoded', 'Authorization: Bearer ' . $accessToken)
);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);

$response = curl_exec($ch);
$json = json_decode($response);

if($json->success){
    var_dump($json->data);
}

curl_close($ch);

```

{% endtab %}

{% tab title="Curl" %}

```
curl https://public-api.expertfile.com/v2/organization/:corporation/staff/:username/link \
    -H "Content-Type: application/json" \
    -H "Authorization: Bearer <ACCESS TOKEN>"
```

{% endtab %}
{% endtabs %}

## Get Individual Link

<mark style="color:green;">`GET`</mark> [**/v2/organization/:corporation/staff/:username/link/:id**](https://public-api.expertfile.com/v2/organization/:corporation/staff/:username/link/:id)

**Headers**

| Name          | Value              |
| ------------- | ------------------ |
| Content-Type  | `application/json` |
| Authorization | `Bearer <token>`   |

**Url**

<table><thead><tr><th width="339.3333333333333">Name</th><th>Type</th><th>Description</th></tr></thead><tbody><tr><td>corporation</td><td>number</td><td>Corporation ID</td></tr><tr><td>username</td><td>string</td><td>Unique username</td></tr><tr><td>id</td><td>number</td><td>Link ID</td></tr></tbody></table>

**Response**

{% tabs %}
{% tab title="200" %}

```json
{
  data: [
    {
      id: 1,
      name: "link name",
      url: "link url"
    }
  ],
  success: true
}
```

{% endtab %}
{% endtabs %}

Code

{% tabs %}
{% tab title="Node" %}

```javascript
const accessToken = `<ACCESS CODE>`

fetch('https://public-api.expertfile.com/v2/organization/:corporation/staff/:username/link/:id', {
    method: 'GET',
    headers: {
        'Content-Type': 'application/x-www-form-urlencoded',
        'Authorization': `Bearer ${accessToken}`
    }
})
.then(response => response.json())
.then(json => {
    const { success, data } = json

    if (success) {
        const link = data
        console.log('links', link[0])
    }

})
.catch(error => console.error(error));
```

{% endtab %}

{% tab title="PHP" %}

```php
$accessToken = urlencode('<ACCESS TOKEN>');
$url = 'https://public-api.expertfile.com/v2/organization/:corporation/staff/:username/link/:id';

$ch = curl_init($url);
curl_setopt(
    $ch,
    CURLOPT_HTTPHEADER,
    array('Content-Type: application/x-www-form-urlencoded', 'Authorization: Bearer ' . $accessToken)
);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);

$response = curl_exec($ch);
$json = json_decode($response);

if($json->success){
    var_dump($json->data);
}

curl_close($ch);
```

{% endtab %}

{% tab title="Curl" %}

```
curl -X GET https://public-api.expertfile.com/v2/organization/:corporation/staff/:username/link/:id \
    -H "Content-Type: application/json" \
    -H "Authorization: Bearer <ACCESS TOKEN>"     
```

{% endtab %}
{% endtabs %}

## Create Link

<mark style="color:blue;">`POST`</mark> [**/v2/organization/:corporation/staff/:username/link**](https://public-api.expertfile.com/v2/organization/:corporation/staff/:username/link)

**Headers**

| Name          | Value              |
| ------------- | ------------------ |
| Content-Type  | `application/json` |
| Authorization | `Bearer <token>`   |

**Url**

<table><thead><tr><th width="339.3333333333333">Name</th><th>Type</th><th>Description</th></tr></thead><tbody><tr><td>corporation</td><td>number</td><td>Corporation ID</td></tr><tr><td>username</td><td>string</td><td>Unique username</td></tr></tbody></table>

**Body**

<table><thead><tr><th width="339.3333333333333">Name</th><th>Type</th><th>Description</th></tr></thead><tbody><tr><td>name<mark style="color:red;">*</mark></td><td>string</td><td>Link Name</td></tr><tr><td>url<mark style="color:red;">*</mark></td><td>string</td><td>Link Url<br><mark style="color:purple;">*must be valid url</mark></td></tr></tbody></table>

**Response**

{% tabs %}
{% tab title="200" %}

```json
{ 
    data: { 
        id: 1
    }, 
    success: true 
}
```

{% endtab %}
{% endtabs %}

Code

{% tabs %}
{% tab title="Node" %}

```javascript
const data = new URLSearchParams();
const accessToken = `<ACCESS TOKEN>`

data.append('name', 'My Blog');
data.append('url', 'https://myblog.com');

fetch('https://public-api.expertfile.com/v2/organization/:corporation/staff/:username/link', {
    method: 'POST',
    headers: {
        'Content-Type': 'application/x-www-form-urlencoded',
        'Authorization': `Bearer ${accessToken}`
    },
    body: data
})
.then(response => response.json())
.then(json => {
    const { success, data, error } = json

    if (success) {
        const { id } = data
        console.log('New link id', id)
    }

})
.catch(error => console.error(error));

```

{% endtab %}

{% tab title="PHP" %}

```php
$accessToken = urlencode('<ACCESS TOKEN>');

$url = 'https://public-api.expertfile.com/v2/organization/:corporation/staff/:username/link';
$data = ['name' => 'My Blog', 'url' => 'https://myblog.com'];

$ch = curl_init($url);
curl_setopt(
    $ch,
    CURLOPT_HTTPHEADER,
    array('Content-Type: application/x-www-form-urlencoded', 'Authorization: Bearer ' . $accessToken)
);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_POSTFIELDS, http_build_query($data));

$response = curl_exec($ch);
$json = json_decode($response);

if($json->success){
    var_dump($json->data);
}

curl_close($ch);
```

{% endtab %}

{% tab title="Curl" %}

```
curl -X POST https://public-api.expertfile.com/v2/organization/:corporation/staff/:username/link \
    -H "Content-Type: application/json" \
    -H "Authorization: Bearer <ACCESS TOKEN>" \
    -d '{"name":"My Blog", "url":"https://myblog.com"}'
```

{% endtab %}
{% endtabs %}

## Update Link

<mark style="color:blue;">`PUT`</mark> [**/v2/organization/:corporation/staff/:username/link/:id**](https://public-api.expertfile.com/v2/organization/:corporation/staff/:username/link/:id)

**Headers**

| Name          | Value              |
| ------------- | ------------------ |
| Content-Type  | `application/json` |
| Authorization | `Bearer <token>`   |

**Url**

<table><thead><tr><th width="339.3333333333333">Name</th><th>Type</th><th>Description</th></tr></thead><tbody><tr><td>corporation</td><td>number</td><td>Corporation ID</td></tr><tr><td>username</td><td>string</td><td>Unique username</td></tr><tr><td>id</td><td>number</td><td>Link ID</td></tr></tbody></table>

**Body**

<table><thead><tr><th width="339.3333333333333">Name</th><th>Type</th><th>Description</th></tr></thead><tbody><tr><td>name<mark style="color:red;">*</mark></td><td>string</td><td>Link Name</td></tr><tr><td>url<mark style="color:red;">*</mark></td><td>string</td><td>Link Url<br><mark style="color:purple;">*must be valid url</mark></td></tr></tbody></table>

**Response**

{% tabs %}
{% tab title="200" %}

```json
{ 
    data: { 
        id: 1
    }, 
    success: true 
}
```

{% endtab %}
{% endtabs %}

Code

{% tabs %}
{% tab title="Node" %}

```javascript
const data = new URLSearchParams();
const accessToken = `<ACCESS TOKEN>`

data.append('name', 'My Blog');
data.append('url', 'https://myblog.com');

fetch('https://public-api.expertfile.com/v2/organization/:corporation/staff/:username/link/:id', {
    method: 'PUT',
    headers: {
        'Content-Type': 'application/x-www-form-urlencoded',
        'Authorization': `Bearer ${accessToken}`
    },
    body: data
})
.then(response => response.json())
.then(json => {
    const { success, data, error } = json

    if (success) {
        const { id } = data
        console.log('Updated link id', id)
    }

})
.catch(error => console.error(error));

```

{% endtab %}

{% tab title="PHP" %}

```php
$accessToken = urlencode('<ACCESS TOKEN>');

$url = 'https://public-api.expertfile.com/v2/organization/:corporation/staff/:username/link/:id';
$data = ['name' => 'My Blog', 'url' => 'https://myblog.com'];

$ch = curl_init($url);
curl_setopt(
    $ch,
    CURLOPT_HTTPHEADER,
    array('Content-Type: application/x-www-form-urlencoded', 'Authorization: Bearer ' . $accessToken)
);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_PUT, http_build_query($data));

$response = curl_exec($ch);
$json = json_decode($response);

if($json->success){
    var_dump($json->data);
}

curl_close($ch);
```

{% endtab %}

{% tab title="Curl" %}

```
curl -X PUT https://public-api.expertfile.com/v2/organization/:corporation/staff/:username/link/:id \
    -H "Content-Type: application/json" \
    -H "Authorization: Bearer <ACCESS TOKEN>" \
    -d '{"name":"My Blog", "url":"https://myblog.com"}'
```

{% endtab %}
{% endtabs %}

## Delete Link

<mark style="color:red;">`DELETE`</mark>[**/v2/organization/:corporation/staff/:username/link/:id**](https://public-api.expertfile.com/v2/organization/:corporation/staff/:username/link/:id)

**Headers**

| Name          | Value              |
| ------------- | ------------------ |
| Content-Type  | `application/json` |
| Authorization | `Bearer <token>`   |

**Url**

<table><thead><tr><th width="339.3333333333333">Name</th><th>Type</th><th>Description</th></tr></thead><tbody><tr><td>corporation</td><td>number</td><td>Corporation ID</td></tr><tr><td>username</td><td>string</td><td>Unique username</td></tr><tr><td>id</td><td>number</td><td>Link ID</td></tr></tbody></table>

**Response**

{% tabs %}
{% tab title="200" %}

```json
{ 
    data: { 
        deleted: true, 
        id: 1
    }, 
    success: true 
}
```

{% endtab %}
{% endtabs %}

Code

{% tabs %}
{% tab title="Node" %}

```javascript
const accessToken = `<ACCESS TOKEN>`

fetch('https://public-api.expertfile.com/v2/organization/:corporation/staff/:username/link/:id', {
    method: 'DELETE',
    headers: {
        'Content-Type': 'application/x-www-form-urlencoded',
        'Authorization': `Bearer ${accessToken}`
    }
})
.then(response => response.json())
.then(json => {
    const { success, data, error } = json

    if (success) {
        const { id } = data
        console.log('Deleted link id', id)
    }

})
.catch(error => console.error(error));

```

{% endtab %}

{% tab title="PHP" %}

```php
$accessToken = urlencode('<ACCESS TOKEN>');

$url = 'https://public-api.expertfile.com/v2/organization/:corporation/staff/:username/link/:id';

$ch = curl_init($url);
curl_setopt(
    $ch,
    CURLOPT_HTTPHEADER,
    array('Content-Type: application/x-www-form-urlencoded', 'Authorization: Bearer ' . $accessToken)
);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_CUSTOMREQUEST, "DELETE");

$response = curl_exec($ch);
$json = json_decode($response);

if($json->success){
    var_dump($json->data);
}

curl_close($ch);
```

{% endtab %}

{% tab title="Curl" %}

```
curl -X DELETE https://public-api.expertfile.com/v2/organization/:corporation/staff/:username/link/:id \
    -H "Content-Type: application/json" \
    -H "Authorization: Bearer <ACCESS TOKEN>"
```

{% endtab %}
{% endtabs %}


# Tagline

Get or create/update the a user's tagline field

{% hint style="info" %}
Please note that in all urls & code samples you'll need to replace`:username` and `:corporation` with appropriate values
{% endhint %}

## Get Tagline

<mark style="color:green;">`GET`</mark> [**/v2/organization/:corporation/staff/:username/tagline**](https://public-api.expertfile.com/v2/organization/:corporation/staff/:username/tagline)

**Headers**

| Name          | Value              |
| ------------- | ------------------ |
| Content-Type  | `application/json` |
| Authorization | `Bearer <token>`   |

**Url**

<table><thead><tr><th width="339.3333333333333">Name</th><th>Type</th><th>Description</th></tr></thead><tbody><tr><td>corporation</td><td>number</td><td>Corporation ID</td></tr><tr><td>username</td><td>string</td><td>Unique username</td></tr></tbody></table>

**Response**

{% tabs %}
{% tab title="200" %}

```json
 {
  data: [
    {
      tagline: 'Tagline text for expert here.'
    }
  ],
  success: true
}
```

{% endtab %}
{% endtabs %}

Code

{% tabs %}
{% tab title="Node" %}

<pre class="language-javascript"><code class="lang-javascript">const data = new URLSearchParams();
<strong>const accessToken = `&#x3C;ACCESS TOKEN>`
</strong>
fetch('https://public-api.expertfile.com/v2/organization/:corporation/staff/:username/tagline', {
    method: 'GET',
    headers: {
        'Content-Type': 'application/x-www-form-urlencoded',
        'Authorization': `Bearer ${accessToken}`
    }
})
.then(response => response.json())
.then(json => {
    const { success, data } = json

    if (success) {
        const { tagline } = data[0]
        console.log('tagline', tagline)
    }

})
.catch(error => console.error(error));

</code></pre>

{% endtab %}

{% tab title="PHP" %}

```php
$accessToken = urlencode('<ACCESS TOKEN>');
$url = 'https://public-api.expertfile.com/v2/organization/:corporation/staff/:username/tagline';

$ch = curl_init($url);
curl_setopt(
    $ch,
    CURLOPT_HTTPHEADER,
    array('Content-Type: application/x-www-form-urlencoded', 'Authorization: Bearer ' . $accessToken)
);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);

$response = curl_exec($ch);
$json = json_decode($response);

if($json->success){
    echo $json->data[0]->tagline;
}

curl_close($ch);

```

{% endtab %}

{% tab title="Curl" %}

```
curl https://public-api.expertfile.com/v2/organization/:corporation/staff/:username/tagline \
    -H "Content-Type: application/json" \
    -H "Authorization: Bearer <ACCESS TOKEN>"
```

{% endtab %}
{% endtabs %}

## Update Tagline

<mark style="color:blue;">`POST`</mark> [**/v2/organization/:corporation/staff/:username/tagline**](https://public-api.expertfile.com/v2/organization/:corporation/staff/:username/tagline)

**Headers**

| Name          | Value              |
| ------------- | ------------------ |
| Content-Type  | `application/json` |
| Authorization | `Bearer <token>`   |

**Url**

<table><thead><tr><th width="339.3333333333333">Name</th><th>Type</th><th>Description</th></tr></thead><tbody><tr><td>corporation</td><td>number</td><td>Corporation ID</td></tr><tr><td>username</td><td>string</td><td>Unique username</td></tr></tbody></table>

**Body**

| Name                                      | Type   | Description                                                                                 |
| ----------------------------------------- | ------ | ------------------------------------------------------------------------------------------- |
| tagline<mark style="color:red;">\*</mark> | string | <p>Content of tagline<br><mark style="color:purple;"><strong>\*optional</strong></mark></p> |

**Response**

{% tabs %}
{% tab title="200" %}

```json
{ 
    data: { 
        id: null 
    }, 
    success: true 
}
```

{% endtab %}
{% endtabs %}

Code

{% tabs %}
{% tab title="Node" %}

```javascript
const data = new URLSearchParams();
const accessToken = `<ACCESS TOKEN>`

data.append('tagline', 'Your tagline text');

fetch('https://public-api.expertfile.com/v2/organization/:corporation/staff/:username/tagline', {
    method: 'POST',
    headers: {
        'Content-Type': 'application/x-www-form-urlencoded',
        'Authorization': `Bearer ${accessToken}`
    },
    body: data
})
.then(response => response.json())
.then(json => {
    const { success, data } = json

    if (success) {
        const { id } = data
    }

})
.catch(error => console.error(error));
```

{% endtab %}

{% tab title="PHP" %}

```php
$accessToken = urlencode('<ACCESS TOKEN>');

$url = 'https://public-api.expertfile.com/v2/organization/:corporation/staff/:username/tagline';
$data = ['tagline' => 'Your tagline text'];

$ch = curl_init($url);
curl_setopt(
    $ch,
    CURLOPT_HTTPHEADER,
    array('Content-Type: application/x-www-form-urlencoded', 'Authorization: Bearer ' . $accessToken)
);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_POSTFIELDS, http_build_query($data));

$response = curl_exec($ch);
$json = json_decode($response);

if($json->success){
    var_dump($json->data);
}

curl_close($ch);
```

{% endtab %}

{% tab title="Curl" %}

```
curl -X POST https://public-api.expertfile.com/v2/organization/:corporation/staff/:username/tagline \
    -H "Content-Type: application/json" \
    -H "Authorization: Bearer <ACCESS TOKEN>" \
    -d '{"tagline":"Your tagline text"}'  
```

{% endtab %}
{% endtabs %}


# Tags

CRUD endpoints for a user's tags

{% hint style="info" %}
Please note that in all urls & code samples you'll need to replace`:username` and `:corporation` with appropriate values
{% endhint %}

## Get All Tags

<mark style="color:green;">`GET`</mark> [**/v2/organization/:corporation/staff/:username/tag**](https://public-api.expertfile.com/v2/organization/:corporation/staff/:username/tag/)

**Headers**

| Name          | Value              |
| ------------- | ------------------ |
| Content-Type  | `application/json` |
| Authorization | `Bearer <token>`   |

**Url**

<table><thead><tr><th width="339.3333333333333">Name</th><th>Type</th><th>Description</th></tr></thead><tbody><tr><td>corporation</td><td>number</td><td>Corporation ID</td></tr><tr><td>username</td><td>string</td><td>Unique username</td></tr></tbody></table>

**Response**

{% tabs %}
{% tab title="200" %}

```json
 {
  data: [
    {
      id: 1,
      content_tag_id: 1,
      tag: "tag name"
    }
  ],
  success: true
}
```

{% endtab %}
{% endtabs %}

Code

{% tabs %}
{% tab title="Node" %}

```javascript
const accessToken = `<ACCESS TOKEN>`

fetch('https://public-api.expertfile.com/v2/organization/:corporation/staff/:username/tag', {
    method: 'GET',
    headers: {
        'Content-Type': 'application/x-www-form-urlencoded',
        'Authorization': `Bearer ${accessToken}`
    }
})
.then(response => response.json())
.then(json => {
    const { success, data } = json

    if (success) {
        const tag = data
        console.log('tag', tag)
    }

})
.catch(error => console.error(error));
```

{% endtab %}

{% tab title="PHP" %}

```php
$accessToken = urlencode('<ACCESS TOKEN>');
$url = 'https://public-api.expertfile.com/v2/organization/:corporation/staff/:username/tag';

$ch = curl_init($url);
curl_setopt(
    $ch,
    CURLOPT_HTTPHEADER,
    array('Content-Type: application/x-www-form-urlencoded', 'Authorization: Bearer ' . $accessToken)
);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);

$response = curl_exec($ch);
$json = json_decode($response);

if($json->success){
    var_dump($json->data);
}

curl_close($ch);

```

{% endtab %}

{% tab title="Curl" %}

```
curl https://public-api.expertfile.com/v2/organization/:corporation/staff/:username/tag \
    -H "Content-Type: application/json" \
    -H "Authorization: Bearer <ACCESS TOKEN>"
```

{% endtab %}
{% endtabs %}

## Get Individual Tag

<mark style="color:green;">`GET`</mark> [**/v2/organization/:corporation/staff/:username/tag/:id**](https://public-api.expertfile.com/v2/organization/:corporation/staff/:username/tag/:id)

**Headers**

| Name          | Value              |
| ------------- | ------------------ |
| Content-Type  | `application/json` |
| Authorization | `Bearer <token>`   |

**Url**

<table><thead><tr><th width="339.3333333333333">Name</th><th>Type</th><th>Description</th></tr></thead><tbody><tr><td>corporation</td><td>number</td><td>Corporation ID</td></tr><tr><td>username</td><td>string</td><td>Unique username</td></tr><tr><td>id</td><td>number</td><td>Tag ID</td></tr></tbody></table>

**Response**

{% tabs %}
{% tab title="200" %}

```json
{
  data: [
    {
      id: 1,
      content_tag_id: 1,
      tag: "tag name"
    }
  ],
  success: true
}
```

{% endtab %}
{% endtabs %}

Code

{% tabs %}
{% tab title="Node" %}

```javascript
const accessToken = `<ACCESS CODE>`

fetch('https://public-api.expertfile.com/v2/organization/:corporation/staff/:username/tag/:id', {
    method: 'GET',
    headers: {
        'Content-Type': 'application/x-www-form-urlencoded',
        'Authorization': `Bearer ${accessToken}`
    }
})
.then(response => response.json())
.then(json => {
    const { success, data } = json

    if (success) {
        const tag = data
        console.log('tag', tag[0])
    }

})
.catch(error => console.error(error));
```

{% endtab %}

{% tab title="PHP" %}

```php
$accessToken = urlencode('<ACCESS TOKEN>');
$url = 'https://public-api.expertfile.com/v2/organization/:corporation/staff/:username/tag/:id';

$ch = curl_init($url);
curl_setopt(
    $ch,
    CURLOPT_HTTPHEADER,
    array('Content-Type: application/x-www-form-urlencoded', 'Authorization: Bearer ' . $accessToken)
);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);

$response = curl_exec($ch);
$json = json_decode($response);

if($json->success){
    var_dump($json->data);
}

curl_close($ch);
```

{% endtab %}

{% tab title="Curl" %}

```
curl -X GET https://public-api.expertfile.com/v2/organization/:corporation/staff/:username/tag/:id \
    -H "Content-Type: application/json" \
    -H "Authorization: Bearer <ACCESS TOKEN>"     
```

{% endtab %}
{% endtabs %}

## Create Tag

<mark style="color:blue;">`POST`</mark>[ **/v2/organization/:corporation/staff/:username/tag**](https://public-api.expertfile.com/v2/organization/:corporation/staff/:username/tag/)

**Headers**

| Name          | Value              |
| ------------- | ------------------ |
| Content-Type  | `application/json` |
| Authorization | `Bearer <token>`   |

**Url**

<table><thead><tr><th width="339.3333333333333">Name</th><th>Type</th><th>Description</th></tr></thead><tbody><tr><td>corporation</td><td>number</td><td>Corporation ID</td></tr><tr><td>username</td><td>string</td><td>Unique username</td></tr></tbody></table>

**Body**

<table><thead><tr><th width="339.3333333333333">Name</th><th>Type</th><th>Description</th></tr></thead><tbody><tr><td>name<mark style="color:red;">*</mark></td><td>string</td><td>Tag Name</td></tr></tbody></table>

**Response**

{% tabs %}
{% tab title="200" %}

```json
{ 
    data: { 
        id: 1
    }, 
    success: true 
}
```

{% endtab %}
{% endtabs %}

**Code**

{% tabs %}
{% tab title="Node" %}

```javascript
const data = new URLSearchParams();
const accessToken = `<ACCESS TOKEN>`

data.append('name', 'Test');

fetch('https://public-api.expertfile.com/v2/organization/:corporation/staff/:username/tag', {
    method: 'POST',
    headers: {
        'Content-Type': 'application/x-www-form-urlencoded',
        'Authorization': `Bearer ${accessToken}`
    },
    body: data
})
.then(response => response.json())
.then(json => {
    const { success, data, error } = json

    if (success) {
        const { id } = data
        console.log('New tag id', id)
    }

})
.catch(error => console.error(error));

```

{% endtab %}

{% tab title="PHP" %}

```php
$accessToken = urlencode('<ACCESS TOKEN>');

$url = 'https://public-api.expertfile.com/v2/organization/:corporation/staff/:username/tag';
$data = ['name' => 'Test'];

$ch = curl_init($url);
curl_setopt(
    $ch,
    CURLOPT_HTTPHEADER,
    array('Content-Type: application/x-www-form-urlencoded', 'Authorization: Bearer ' . $accessToken)
);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_POSTFIELDS, http_build_query($data));

$response = curl_exec($ch);
$json = json_decode($response);

if($json->success){
    var_dump($json->data);
}

curl_close($ch);
```

{% endtab %}

{% tab title="Curl" %}

```
curl -X POST https://public-api.expertfile.com/v2/organization/:corporation/staff/:username/tag \
    -H "Content-Type: application/json" \
    -H "Authorization: Bearer <ACCESS TOKEN>" \
    -d '{"name":"Test"}'
```

{% endtab %}
{% endtabs %}

## Delete Tag

<mark style="color:red;">`DELETE`</mark>[**/v2/organization/:corporation/staff/:username/tag/:id**](https://public-api.expertfile.com/v2/organization/:corporation/staff/:username/tag/:id)

**Headers**

| Name          | Value              |
| ------------- | ------------------ |
| Content-Type  | `application/json` |
| Authorization | `Bearer <token>`   |

**Url**

<table><thead><tr><th width="339.3333333333333">Name</th><th>Type</th><th>Description</th></tr></thead><tbody><tr><td>corporation</td><td>number</td><td>Corporation ID</td></tr><tr><td>username</td><td>string</td><td>Unique username</td></tr><tr><td>id</td><td>number</td><td>Tag ID</td></tr></tbody></table>

**Response**

{% tabs %}
{% tab title="200" %}

```json
{ 
    data: { 
        deleted: true, 
        id: 1
    }, 
    success: true 
}
```

{% endtab %}
{% endtabs %}

Code

{% tabs %}
{% tab title="Node" %}

```javascript
const accessToken = `<ACCESS TOKEN>`

fetch('https://public-api.expertfile.com/v2/organization/:corporation/staff/:username/tag/:id', {
    method: 'DELETE',
    headers: {
        'Content-Type': 'application/x-www-form-urlencoded',
        'Authorization': `Bearer ${accessToken}`
    }
})
.then(response => response.json())
.then(json => {
    const { success, data, error } = json

    if (success) {
        const { id } = data
        console.log('Deleted tag id', id)
    }

})
.catch(error => console.error(error));

```

{% endtab %}

{% tab title="PHP" %}

```php
$accessToken = urlencode('<ACCESS TOKEN>');

$url = 'https://public-api.expertfile.com/v2/organization/:corporation/staff/:username/tag/:id';

$ch = curl_init($url);
curl_setopt(
    $ch,
    CURLOPT_HTTPHEADER,
    array('Content-Type: application/x-www-form-urlencoded', 'Authorization: Bearer ' . $accessToken)
);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_CUSTOMREQUEST, "DELETE");

$response = curl_exec($ch);
$json = json_decode($response);

if($json->success){
    var_dump($json->data);
}

curl_close($ch);
```

{% endtab %}

{% tab title="Curl" %}

```
curl -X DELETE https://public-api.expertfile.com/v2/organization/:corporation/staff/:username/tag/:id \
    -H "Content-Type: application/json" \
    -H "Authorization: Bearer <ACCESS TOKEN>"
```

{% endtab %}
{% endtabs %}


# Inquiries

### Generate a Token:

{% content-ref url="/pages/BYd1G0wKUbajbfmWWW79" %}
[Authentication](/reference/api-reference/authentication)
{% endcontent-ref %}

### Admission Inquiry:

{% content-ref url="/pages/Vx4oDvDwFSMO6bStQmFt" %}
[Admission](/reference/api-reference/inquiries/admission)
{% endcontent-ref %}

### Business Inquiry:

{% content-ref url="/pages/0p5XEkOvD9MFqGMFcnRK" %}
[Business](/reference/api-reference/inquiries/business)
{% endcontent-ref %}

### Donor Inquiry:

{% content-ref url="/pages/fI2o7Ta75zAdycxgRTmN" %}
[Donor](/reference/api-reference/inquiries/donor)
{% endcontent-ref %}

### Event Inquiry:

{% content-ref url="/pages/do9ta9X6XMEjY7PAXirN" %}
[Event](/reference/api-reference/inquiries/event)
{% endcontent-ref %}

### Expert Witness:

{% content-ref url="/pages/Eokn7gmdC0fwERTvszYq" %}
[Expert Witness](/reference/api-reference/inquiries/expert-witness)
{% endcontent-ref %}

### General:

{% content-ref url="/pages/TZ9ocjHIOosReRXbKZ4M" %}
[General](/reference/api-reference/inquiries/general)
{% endcontent-ref %}

### Media Inquiry:

{% content-ref url="/pages/BFVftrSWnL56fs02CRgz" %}
[Media](/reference/api-reference/inquiries/media)
{% endcontent-ref %}

### Meeting:

{% content-ref url="/pages/ixcp3PcHqtZZ3QRBwTSK" %}
[Meeting](/reference/api-reference/inquiries/meeting)
{% endcontent-ref %}

### Partnership:

{% content-ref url="/pages/zxCfs2zBGtagZqIFBzZp" %}
[Partnership](/reference/api-reference/inquiries/partnership)
{% endcontent-ref %}

### Research:

{% content-ref url="/pages/t72QoO6tq0JrczOjqYDz" %}
[Research](/reference/api-reference/inquiries/research)
{% endcontent-ref %}


# Admission

Admissions inquiries are pivotal for professors because they: Recruit Talent, Build relationships & Enhance Reputation.

## Send Admission Inquiry

<mark style="color:blue;">`POST`</mark> [**/v2/organization/:corporation/inquiry/admission**](https://public-api.expertfile.com/v2/organization/:corporation/inquiry/admission)

**Headers**

| Name          | Value              |
| ------------- | ------------------ |
| Content-Type  | `application/json` |
| Authorization | `Bearer <token>`   |

**Url**

<table><thead><tr><th width="339.3333333333333">Name</th><th>Type</th><th>Description</th></tr></thead><tbody><tr><td>corporation</td><td>number</td><td>Corporation ID</td></tr></tbody></table>

**Body**

<table><thead><tr><th width="339.3333333333333">Name</th><th>Type</th><th>Description</th></tr></thead><tbody><tr><td>firstname<mark style="color:red;"><strong>*</strong></mark></td><td>string</td><td>Sender first name</td></tr><tr><td>lastname</td><td>string</td><td>Sender last name</td></tr><tr><td>email<mark style="color:red;"><strong>*</strong></mark></td><td>string</td><td>Sender email address</td></tr><tr><td>phone</td><td>string</td><td>Sender phone #</td></tr><tr><td>website</td><td>string</td><td>Sender website</td></tr><tr><td>organization</td><td>string</td><td>Sender company</td></tr><tr><td>message<mark style="color:red;"><strong>*</strong></mark></td><td>string</td><td>Sender message</td></tr><tr><td>location_city</td><td>string</td><td>Sender city</td></tr><tr><td>location_state</td><td>string</td><td>Sender state/province<br>See full list <a href="/reference/helpers#state-province-codes"><em><strong>here</strong></em></a></td></tr><tr><td>location_country</td><td>string</td><td>Sender country<br>See full list <a href="/reference/helpers#country-codes"><em><strong>here</strong></em></a></td></tr><tr><td>username<mark style="color:red;"><strong>*</strong></mark></td><td>string</td><td>Recipient(Expert) username</td></tr><tr><td>admission_type<mark style="color:red;"><strong>*</strong></mark></td><td>string</td><td>Admission Type(valid input: 'undergraduate', 'graduate')</td></tr><tr><td>admission_program_name<mark style="color:red;"><strong>*</strong></mark></td><td>string</td><td>Program name</td></tr><tr><td>admission_faculty<mark style="color:red;"><strong>*</strong></mark></td><td>string</td><td>Faculty</td></tr></tbody></table>

**Response**

{% tabs %}
{% tab title="200" %}

```json
{ 
    data: { 
        id: <INQUIRY_ID>
    }, 
    success: true 
}
```

{% endtab %}
{% endtabs %}

Code

{% tabs %}
{% tab title="Node" %}

```javascript
const data = new URLSearchParams();
const accessToken = `<ACCESS TOKEN>`

data.append('firstname', 'Testfirstname');
data.append('lastname', 'Teslastname');
data.append('email', 'testing@test.com');
data.append('phone', '(555) 555-5555');
data.append('website', 'https://mywebsite.com');
data.append('organization', 'NYT');
data.append('location_city', 'New York City');
data.append('location_state', 'NY');
data.append('location_country', 'US');
data.append('username', '<EXPERT USERNAME>');
data.append('admission_type', 'graduate');
data.append('admission_program_name', 'Computer Science');
data.append('admission_faculty', 'Mathematics & Science');
data.append('message', 'This is a test message to the expert...');

fetch('https://public-api.expertfile.com/v2/organization/:corporation/inquiry/admission', {
    method: 'POST',
    headers: {
        'Content-Type': 'application/x-www-form-urlencoded',
        'Authorization': `Bearer ${accessToken}`
    },
    body: data
})
.then(response => response.json())
.then(json => {
    const { success, data, error } = json

    if (success) {
        const { id } = data
        console.log('New inquiry id', id)
    }

})
.catch(error => console.error(error));

```

{% endtab %}

{% tab title="PHP" %}

```php
$accessToken = urlencode('<ACCESS TOKEN>');

$url = 'https://public-api.expertfile.com/v2/organization/:corporation/inquiry/admission';

$data = ['firstname' => 'Testfirstname',
'lastname' => 'Teslastname',
'email' => 'testing@test.com',
'phone' => '(555) 555-5555',
'website' => 'https://mywebsite.com',
'organization' => 'NYT',
'location_city' => 'New York City',
'location_state' => 'NY',
'location_country' => 'US',
'username' => '<EXPERT USERNAME>',
'admission_type' => 'graduate',
'admission_program_name' => 'Computer Science',
'admission_faculty' => 'Mathematics & Science',
'message' => 'This is a test message to the expert...'];

$ch = curl_init($url);
curl_setopt(
    $ch,
    CURLOPT_HTTPHEADER,
    array('Content-Type: application/x-www-form-urlencoded', 'Authorization: Bearer ' . $accessToken)
);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_POSTFIELDS, http_build_query($data));

$response = curl_exec($ch);
$json = json_decode($response);

if($json->success){
    var_dump($json->data);
}

curl_close($ch);
```

{% endtab %}

{% tab title="Curl" %}

```
curl -X POST https://public-api.expertfile.com/v2/organization/:corporation/inquiry/admission \
    -H "Content-Type: application/json" \
    -H "Authorization: Bearer <ACCESS TOKEN>" \
    -d '{ "firstname": "Testfirstname","lastname": "Teslastname","email": "testing@test.com","phone": "(555) 555-5555","website": "https://mywebsite.com","organization": "NYT","location_city": "New York City","location_state": "NY","location_country": "US","username": "<EXPERT USERNAME>","admission_type": "graduate","admission_program_name": "Computer Science","admission_faculty": "Mathematics & Science","message": "This is a test message to the expert..." }'
```

{% endtab %}
{% endtabs %}


# Business

## Send Business Inquiry

<mark style="color:blue;">`POST`</mark> [**/v2/organization/:corporation/inquiry/business**](https://public-api.expertfile.com/v2/organization/:corporation/inquiry/business)

**Headers**

| Name          | Value              |
| ------------- | ------------------ |
| Content-Type  | `application/json` |
| Authorization | `Bearer <token>`   |

**Url**

<table><thead><tr><th width="339.3333333333333">Name</th><th>Type</th><th>Description</th></tr></thead><tbody><tr><td>corporation</td><td>number</td><td>Corporation ID</td></tr></tbody></table>

**Body**

<table><thead><tr><th width="339.3333333333333">Name</th><th>Type</th><th>Description</th></tr></thead><tbody><tr><td>firstname<mark style="color:red;"><strong>*</strong></mark></td><td>string</td><td>Sender first name</td></tr><tr><td>lastname</td><td>string</td><td>Sender last name</td></tr><tr><td>email<mark style="color:red;"><strong>*</strong></mark></td><td>string</td><td>Sender email address</td></tr><tr><td>phone</td><td>string</td><td>Sender phone #</td></tr><tr><td>website</td><td>string</td><td>Sender website</td></tr><tr><td>organization</td><td>string</td><td>Sender company</td></tr><tr><td>message<mark style="color:red;"><strong>*</strong></mark></td><td>string</td><td>Sender message</td></tr><tr><td>location_city</td><td>string</td><td>Sender city</td></tr><tr><td>location_state</td><td>string</td><td>Sender state/province<br>See full list <a href="/reference/helpers#state-province-codes"><em><strong>here</strong></em></a></td></tr><tr><td>location_country</td><td>string</td><td>Sender country<br>See full list <a href="/reference/helpers#country-codes"><em><strong>here</strong></em></a></td></tr><tr><td>username<mark style="color:red;"><strong>*</strong></mark></td><td>string</td><td>Recipient(Expert) username</td></tr><tr><td>business_opportunity_type<mark style="color:red;"><strong>*</strong></mark></td><td>string</td><td>Business Stage(valid input: 'consulting_engagement', 'new_ventures/partnerships', 'business_deals', 'corporate_training')</td></tr></tbody></table>

**Response**

{% tabs %}
{% tab title="200" %}

```json
{ 
    data: { 
        id: <INQUIRY_ID>
    }, 
    success: true 
}
```

{% endtab %}
{% endtabs %}

Code

{% tabs %}
{% tab title="Node" %}

```javascript
const data = new URLSearchParams();
const accessToken = `<ACCESS TOKEN>`

data.append('firstname', 'Testfirstname');
data.append('lastname', 'Teslastname');
data.append('email', 'testing@test.com');
data.append('phone', '(555) 555-5555');
data.append('website', 'https://mywebsite.com');
data.append('organization', 'NYT');
data.append('location_city', 'New York City');
data.append('location_state', 'NY');
data.append('location_country', 'US');
data.append('username', '<EXPERT USERNAME>');
data.append('business_opportunity_type', 'business_deals');
data.append('message', 'This is a test message to the expert...');

fetch('https://public-api.expertfile.com/v2/organization/:corporation/inquiry/business', {
    method: 'POST',
    headers: {
        'Content-Type': 'application/x-www-form-urlencoded',
        'Authorization': `Bearer ${accessToken}`
    },
    body: data
})
.then(response => response.json())
.then(json => {
    const { success, data, error } = json

    if (success) {
        const { id } = data
        console.log('New inquiry id', id)
    }

})
.catch(error => console.error(error));
```

{% endtab %}

{% tab title="PHP" %}

```php
$accessToken = urlencode('<ACCESS TOKEN>');

$url = 'https://public-api.expertfile.com/v2/organization/:corporation/inquiry/business';

$data = ['firstname' => 'Testfirstname',
'lastname' => 'Teslastname',
'email' => 'testing@test.com',
'phone' => '(555) 555-5555',
'website' => 'https://mywebsite.com',
'organization' => 'NYT',
'location_city' => 'New York City',
'location_state' => 'NY',
'location_country' => 'US',
'username' => '<EXPERT USERNAME>',
'business_opportunity_type' => 'business_deals',
'message' => 'This is a test message to the expert...'];

$ch = curl_init($url);
curl_setopt(
    $ch,
    CURLOPT_HTTPHEADER,
    array('Content-Type: application/x-www-form-urlencoded', 'Authorization: Bearer ' . $accessToken)
);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_POSTFIELDS, http_build_query($data));

$response = curl_exec($ch);
$json = json_decode($response);

if($json->success){
    var_dump($json->data);
}

curl_close($ch);
```

{% endtab %}

{% tab title="Curl" %}

```
curl -X POST https://public-api.expertfile.com/v2/organization/:corporation/inquiry/business \
    -H "Content-Type: application/json" \
    -H "Authorization: Bearer <ACCESS TOKEN>" \
    -d '{ "firstname": "Testfirstname","lastname": "Teslastname","email": "testing@test.com","phone": "(555) 555-5555","website": "https://mywebsite.com","organization": "NYT","location_city": "New York City","location_state": "NY","location_country": "US","username": "<EXPERT USERNAME>","business_opportunity_type": "business_deals", "message": "This is a test message to the expert..." }'
```

{% endtab %}
{% endtabs %}


# Donor

## Send Donor Inquiry

<mark style="color:blue;">`POST`</mark> [**/v2/organization/:corporation/inquiry/donor**](https://public-api.expertfile.com/v2/organization/:corporation/inquiry/donor)

**Headers**

| Name          | Value              |
| ------------- | ------------------ |
| Content-Type  | `application/json` |
| Authorization | `Bearer <token>`   |

**Url**

<table><thead><tr><th width="339.3333333333333">Name</th><th>Type</th><th>Description</th></tr></thead><tbody><tr><td>corporation</td><td>number</td><td>Corporation ID</td></tr></tbody></table>

**Body**

<table><thead><tr><th width="339.3333333333333">Name</th><th>Type</th><th>Description</th></tr></thead><tbody><tr><td>firstname<mark style="color:red;"><strong>*</strong></mark></td><td>string</td><td>Sender first name</td></tr><tr><td>lastname</td><td>string</td><td>Sender last name</td></tr><tr><td>email<mark style="color:red;"><strong>*</strong></mark></td><td>string</td><td>Sender email address</td></tr><tr><td>phone</td><td>string</td><td>Sender phone #</td></tr><tr><td>website</td><td>string</td><td>Sender website</td></tr><tr><td>organization</td><td>string</td><td>Sender company</td></tr><tr><td>message<mark style="color:red;"><strong>*</strong></mark></td><td>string</td><td>Sender message</td></tr><tr><td>location_city</td><td>string</td><td>Sender city</td></tr><tr><td>location_state</td><td>string</td><td>Sender state/province<br>See full list <a href="/reference/helpers#state-province-codes"><em><strong>here</strong></em></a></td></tr><tr><td>location_country</td><td>string</td><td>Sender country<br>See full list <a href="/reference/helpers#country-codes"><em><strong>here</strong></em></a></td></tr><tr><td>username<mark style="color:red;"><strong>*</strong></mark></td><td>string</td><td>Recipient(Expert) username</td></tr><tr><td>donor_type<mark style="color:red;"><strong>*</strong></mark></td><td>string</td><td>Donor Type(valid input: 'corporate','government','ngo','not_for_profit', 'other')</td></tr><tr><td>donor_focus<mark style="color:red;"><strong>*</strong></mark></td><td>string</td><td>Donor Focus(valid input: 'one_time_gift','recurring_gift','endowments','bequests','other')</td></tr></tbody></table>

**Response**

{% tabs %}
{% tab title="200" %}

```json
{ 
    data: { 
        id: <INQUIRY_ID>
    }, 
    success: true 
}
```

{% endtab %}
{% endtabs %}

Code

{% tabs %}
{% tab title="Node" %}

```javascript
const data = new URLSearchParams();
const accessToken = `<ACCESS TOKEN>`

data.append('firstname', 'Testfirstname');
data.append('lastname', 'Teslastname');
data.append('email', 'testing@test.com');
data.append('phone', '(555) 555-5555');
data.append('website', 'https://mywebsite.com');
data.append('organization', 'NYT');
data.append('location_city', 'New York City');
data.append('location_state', 'NY');
data.append('location_country', 'US');
data.append('username', '<EXPERT USERNAME>');
data.append('donor_type', 'not_for_profit');
data.append('donor_focus', 'other');
data.append('message', 'This is a test message to the expert...');

fetch('https://public-api.expertfile.com/v2/organization/:corporation/inquiry/donor', {
    method: 'POST',
    headers: {
        'Content-Type': 'application/x-www-form-urlencoded',
        'Authorization': `Bearer ${accessToken}`
    },
    body: data
})
.then(response => response.json())
.then(json => {
    const { success, data, error } = json

    if (success) {
        const { id } = data
        console.log('New inquiry id', id)
    }

})
.catch(error => console.error(error));
```

{% endtab %}

{% tab title="PHP" %}

```php
$accessToken = urlencode('<ACCESS TOKEN>');

$url = 'https://public-api.expertfile.com/v2/organization/:corporation/inquiry/donor';

$data = ['firstname' => 'Testfirstname',
'lastname' => 'Teslastname',
'email' => 'testing@test.com',
'phone' => '(555) 555-5555',
'website' => 'https://mywebsite.com',
'organization' => 'NYT',
'location_city' => 'New York City',
'location_state' => 'NY',
'location_country' => 'US',
'username' => '<EXPERT USERNAME>',
'donor_type' => 'not_for_profit',
'donor_focus' => 'other',
'message' => 'This is a test message to the expert...'];

$ch = curl_init($url);
curl_setopt(
    $ch,
    CURLOPT_HTTPHEADER,
    array('Content-Type: application/x-www-form-urlencoded', 'Authorization: Bearer ' . $accessToken)
);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_POSTFIELDS, http_build_query($data));

$response = curl_exec($ch);
$json = json_decode($response);

if($json->success){
    var_dump($json->data);
}

curl_close($ch);
```

{% endtab %}

{% tab title="Curl" %}

```
curl -X POST https://public-api.expertfile.com/v2/organization/:corporation/inquiry/donor \
    -H "Content-Type: application/json" \
    -H "Authorization: Bearer <ACCESS TOKEN>" \
    -d '{ "firstname": "Testfirstname","lastname": "Teslastname","email": "testing@test.com","phone": "(555) 555-5555","website": "https://mywebsite.com","organization": "NYT","location_city": "New York City","location_state": "NY","location_country": "US","username": "<EXPERT USERNAME>","donor_type": "not_for_profit","donor_focus": "other", "message": "This is a test message to the expert..." }'
```

{% endtab %}
{% endtabs %}


# Event

## Send Event Inquiry

<mark style="color:blue;">`POST`</mark>[ **/v2/organization/:corporation/inquiry/event**](https://public-api.expertfile.com/v2/organization/:corporation/inquiry/event)

**Headers**

| Name          | Value              |
| ------------- | ------------------ |
| Content-Type  | `application/json` |
| Authorization | `Bearer <token>`   |

**Url**

<table><thead><tr><th width="339.3333333333333">Name</th><th>Type</th><th>Description</th></tr></thead><tbody><tr><td>corporation</td><td>number</td><td>Corporation ID</td></tr></tbody></table>

**Body**

<table><thead><tr><th width="339.3333333333333">Name</th><th>Type</th><th>Description</th></tr></thead><tbody><tr><td>firstname<mark style="color:red;"><strong>*</strong></mark></td><td>string</td><td>Sender first name</td></tr><tr><td>lastname</td><td>string</td><td>Sender last name</td></tr><tr><td>email<mark style="color:red;"><strong>*</strong></mark></td><td>string</td><td>Sender email address</td></tr><tr><td>phone</td><td>string</td><td>Sender phone #</td></tr><tr><td>website</td><td>string</td><td>Sender website</td></tr><tr><td>organization</td><td>string</td><td>Sender company</td></tr><tr><td>message<mark style="color:red;"><strong>*</strong></mark></td><td>string</td><td>Sender message</td></tr><tr><td>location_city</td><td>string</td><td>Sender city</td></tr><tr><td>location_state</td><td>string</td><td>Sender state/province<br>See full list <a href="/reference/helpers#state-province-codes"><em><strong>here</strong></em></a></td></tr><tr><td>location_country</td><td>string</td><td>Sender country<br>See full list <a href="/reference/helpers#country-codes"><em><strong>here</strong></em></a></td></tr><tr><td>username<mark style="color:red;"><strong>*</strong></mark></td><td>string</td><td>Recipient(Expert) username</td></tr><tr><td>event_name<mark style="color:red;"><strong>*</strong></mark></td><td>string</td><td>Event Name</td></tr><tr><td>event_location<mark style="color:red;"><strong>*</strong></mark></td><td>string</td><td>Event Location</td></tr><tr><td>event_date<mark style="color:red;"><strong>*</strong></mark></td><td>unix timestamp</td><td>Event Date</td></tr><tr><td>event_description<mark style="color:red;"><strong>*</strong></mark></td><td>string</td><td>Event Description</td></tr></tbody></table>

**Response**

{% tabs %}
{% tab title="200" %}

```json
{ 
    data: { 
        id: <INQUIRY_ID>
    }, 
    success: true 
}
```

{% endtab %}
{% endtabs %}

Code

{% tabs %}
{% tab title="Node" %}

```javascript
const data = new URLSearchParams();
const accessToken = `<ACCESS TOKEN>`

data.append('firstname', 'Testfirstname');
data.append('lastname', 'Teslastname');
data.append('email', 'testing@test.com');
data.append('phone', '(555) 555-5555');
data.append('website', 'https://mywebsite.com');
data.append('organization', 'NYT');
data.append('location_city', 'New York City');
data.append('location_state', 'NY');
data.append('location_country', 'US');
data.append('username', '<EXPERT USERNAME>');
data.append('event_name', 'Text event name');
data.append('event_location', 'Toronto, ON Canada');
data.append('event_date', 1714657477);
data.append('event_description', 'this a description of the event...')
data.append('message', 'This is a test message to the expert...');

fetch('https://public-api.expertfile.com/v2/organization/:corporation/inquiry/event', {
    method: 'POST',
    headers: {
        'Content-Type': 'application/x-www-form-urlencoded',
        'Authorization': `Bearer ${accessToken}`
    },
    body: data
})
.then(response => response.json())
.then(json => {
    const { success, data, error } = json

    if (success) {
        const { id } = data
        console.log('New inquiry id', id)
    }

})
.catch(error => console.error(error));
```

{% endtab %}

{% tab title="PHP" %}

```php
$accessToken = urlencode('<ACCESS TOKEN>');

$url = 'https://public-api.expertfile.com/v2/organization/:corporation/inquiry/event';

$data = ['firstname' => 'Testfirstname',
'lastname' => 'Teslastname',
'email' => 'testing@test.com',
'phone' => '(555) 555-5555',
'website' => 'https://mywebsite.com',
'organization' => 'NYT',
'location_city' => 'New York City',
'location_state' => 'NY',
'location_country' => 'US',
'username' => '<EXPERT USERNAME>',
'event_name' => 'Text event name',
'event_location' => 'Toronto, ON Canada',
'event_date' => 1714657477,
'event_description' => 'this a description of the event...',
'message' => 'This is a test message to the expert...'];

$ch = curl_init($url);
curl_setopt(
    $ch,
    CURLOPT_HTTPHEADER,
    array('Content-Type: application/x-www-form-urlencoded', 'Authorization: Bearer ' . $accessToken)
);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_POSTFIELDS, http_build_query($data));

$response = curl_exec($ch);
$json = json_decode($response);

if($json->success){
    var_dump($json->data);
}

curl_close($ch);
```

{% endtab %}

{% tab title="Curl" %}

```
curl -X POST https://public-api.expertfile.com/v2/organization/:corporation/inquiry/event \
    -H "Content-Type: application/json" \
    -H "Authorization: Bearer <ACCESS TOKEN>" \
    -d '{ "firstname": "Testfirstname","lastname": "Teslastname","email": "testing@test.com","phone": "(555) 555-5555","website": "https://mywebsite.com","organization": "NYT","location_city": "New York City","location_state": "NY","location_country": "US","username": "<EXPERT USERNAME>", "event_name": "Text event name", "event_location": "Toronto, ON Canada", "event_date": 1714657477, "event_description": "this a description of the event...", "message": "This is a test message to the expert..." }'
```

{% endtab %}
{% endtabs %}


# Expert Witness

## Send Expert Witness Inquiry

<mark style="color:blue;">`POST`</mark> [**/v2/organization/:corporation/inquiry/expertwitness**](https://public-api.expertfile.com/v2/organization/:corporation/inquiry/expertwitness)

**Headers**

| Name          | Value              |
| ------------- | ------------------ |
| Content-Type  | `application/json` |
| Authorization | `Bearer <token>`   |

**Url**

<table><thead><tr><th width="339.3333333333333">Name</th><th>Type</th><th>Description</th></tr></thead><tbody><tr><td>corporation</td><td>number</td><td>Corporation ID</td></tr></tbody></table>

**Body**

<table><thead><tr><th width="339.3333333333333">Name</th><th>Type</th><th>Description</th></tr></thead><tbody><tr><td>firstname<mark style="color:red;"><strong>*</strong></mark></td><td>string</td><td>Sender first name</td></tr><tr><td>lastname</td><td>string</td><td>Sender last name</td></tr><tr><td>email<mark style="color:red;"><strong>*</strong></mark></td><td>string</td><td>Sender email address</td></tr><tr><td>phone</td><td>string</td><td>Sender phone #</td></tr><tr><td>website</td><td>string</td><td>Sender website</td></tr><tr><td>organization</td><td>string</td><td>Sender company</td></tr><tr><td>message<mark style="color:red;"><strong>*</strong></mark></td><td>string</td><td>Sender message</td></tr><tr><td>location_city</td><td>string</td><td>Sender city</td></tr><tr><td>location_state</td><td>string</td><td>Sender state/province<br>See full list <a href="/reference/helpers#state-province-codes"><em><strong>here</strong></em></a></td></tr><tr><td>location_country</td><td>string</td><td>Sender country<br>See full list <a href="/reference/helpers#country-codes"><em><strong>here</strong></em></a></td></tr><tr><td>username<mark style="color:red;"><strong>*</strong></mark></td><td>string</td><td>Recipient(Expert) username</td></tr><tr><td>expertwitness_organization_type<mark style="color:red;"><strong>*</strong></mark></td><td>string</td><td>Organization Type(valid input: 'legal_firm', 'corporate_legal_department', 'insurance_provider', 'government_agency', 'legal_nurse_consultant', 'other')</td></tr><tr><td>expertwitness_stage_in_process<mark style="color:red;"><strong>*</strong></mark></td><td>string</td><td>Stage in process(valid input: 'investigation', 'in_litigation', 'approaching_trial','other')</td></tr></tbody></table>

**Response**

{% tabs %}
{% tab title="200" %}

```json
{ 
    data: { 
        id: <INQUIRY_ID>
    }, 
    success: true 
}
```

{% endtab %}
{% endtabs %}

Code

{% tabs %}
{% tab title="Node" %}

```javascript
const data = new URLSearchParams();
const accessToken = `<ACCESS TOKEN>`

data.append('firstname', 'Testfirstname');
data.append('lastname', 'Teslastname');
data.append('email', 'testing@test.com');
data.append('phone', '(555) 555-5555');
data.append('website', 'https://mywebsite.com');
data.append('organization', 'NYT');
data.append('location_city', 'New York City');
data.append('location_state', 'NY');
data.append('location_country', 'US');
data.append('username', '<EXPERT USERNAME>');
data.append('expertwitness_organization_type', 'other');
data.append('expertwitness_stage_in_process', 'investigation')
data.append('message', 'This is a test message to the expert...');

fetch('https://public-api.expertfile.com/v2/organization/:corporation/inquiry/expertwitness', {
    method: 'POST',
    headers: {
        'Content-Type': 'application/x-www-form-urlencoded',
        'Authorization': `Bearer ${accessToken}`
    },
    body: data
})
.then(response => response.json())
.then(json => {
    const { success, data, error } = json

    if (success) {
        const { id } = data
        console.log('New inquiry id', id)
    }

})
.catch(error => console.error(error));
```

{% endtab %}

{% tab title="PHP" %}

```php
$accessToken = urlencode('<ACCESS TOKEN>');

$url = 'https://public-api.expertfile.com/v2/organization/:corporation/inquiry/expertwitness';

$data = ['firstname' => 'Testfirstname',
'lastname' => 'Teslastname',
'email' => 'testing@test.com',
'phone' => '(555) 555-5555',
'website' => 'https://mywebsite.com',
'organization' => 'NYT',
'location_city' => 'New York City',
'location_state' => 'NY',
'location_country' => 'US',
'username' => '<EXPERT USERNAME>',
'expertwitness_organization_type' => 'other',
'expertwitness_stage_in_process' => 'investigation',
'message' => 'This is a test message to the expert...'];

$ch = curl_init($url);
curl_setopt(
    $ch,
    CURLOPT_HTTPHEADER,
    array('Content-Type: application/x-www-form-urlencoded', 'Authorization: Bearer ' . $accessToken)
);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_POSTFIELDS, http_build_query($data));

$response = curl_exec($ch);
$json = json_decode($response);

if($json->success){
    var_dump($json->data);
}

curl_close($ch);
```

{% endtab %}

{% tab title="Curl" %}

```
curl -X POST https://public-api.expertfile.com/v2/organization/:corporation/inquiry/expertwitness \
    -H "Content-Type: application/json" \
    -H "Authorization: Bearer <ACCESS TOKEN>" \
    -d '{ "firstname": "Testfirstname","lastname": "Teslastname","email": "testing@test.com","phone": "(555) 555-5555","website": "https://mywebsite.com","organization": "NYT","location_city": "New York City","location_state": "NY","location_country": "US","username": "<EXPERT USERNAME>","expertwitness_organization_type": "other", "expertwitness_stage_in_process": "investigation", "message": "This is a test message to the expert..." }'
    
```

{% endtab %}
{% endtabs %}


# General

## Send General Inquiry

<mark style="color:blue;">`POST`</mark> [**/v2/organization/:corporation/inquiry/general**](https://public-api.expertfile.com/v2/organization/:corporation/inquiry/general)

**Headers**

| Name          | Value              |
| ------------- | ------------------ |
| Content-Type  | `application/json` |
| Authorization | `Bearer <token>`   |

**Url**

<table><thead><tr><th width="339.3333333333333">Name</th><th>Type</th><th>Description</th></tr></thead><tbody><tr><td>corporation</td><td>number</td><td>Corporation ID</td></tr></tbody></table>

**Body**

<table><thead><tr><th width="339.3333333333333">Name</th><th>Type</th><th>Description</th></tr></thead><tbody><tr><td>firstname<mark style="color:red;"><strong>*</strong></mark></td><td>string</td><td>Sender first name</td></tr><tr><td>lastname</td><td>string</td><td>Sender last name</td></tr><tr><td>email<mark style="color:red;"><strong>*</strong></mark></td><td>string</td><td>Sender email address</td></tr><tr><td>phone</td><td>string</td><td>Sender phone #</td></tr><tr><td>website</td><td>string</td><td>Sender website</td></tr><tr><td>organization</td><td>string</td><td>Sender company</td></tr><tr><td>message<mark style="color:red;"><strong>*</strong></mark></td><td>string</td><td>Sender message</td></tr><tr><td>location_city</td><td>string</td><td>Sender city</td></tr><tr><td>location_state</td><td>string</td><td>Sender state/province<br>See full list <a href="/reference/helpers#state-province-codes"><em><strong>here</strong></em></a></td></tr><tr><td>location_country</td><td>string</td><td>Sender country<br>See full list <a href="/reference/helpers#country-codes"><em><strong>here</strong></em></a></td></tr><tr><td>username<mark style="color:red;"><strong>*</strong></mark></td><td>string</td><td>Recipient(Expert) username</td></tr></tbody></table>

**Response**

{% tabs %}
{% tab title="200" %}

```json
{ 
    data: { 
        id: <INQUIRY_ID>
    }, 
    success: true 
}
```

{% endtab %}
{% endtabs %}

Code

{% tabs %}
{% tab title="Node" %}

```javascript
const data = new URLSearchParams();
const accessToken = `<ACCESS TOKEN>`

data.append('firstname', 'Testfirstname');
data.append('lastname', 'Teslastname');
data.append('email', 'testing@test.com');
data.append('phone', '(555) 555-5555');
data.append('website', 'https://mywebsite.com');
data.append('organization', 'NYT');
data.append('location_city', 'New York City');
data.append('location_state', 'NY');
data.append('location_country', 'US');
data.append('username', '<EXPERT USERNAME>');
data.append('message', 'This is a test message to the expert...');

fetch('https://public-api.expertfile.com/v2/organization/:corporation/inquiry/general', {
    method: 'POST',
    headers: {
        'Content-Type': 'application/x-www-form-urlencoded',
        'Authorization': `Bearer ${accessToken}`
    },
    body: data
})
.then(response => response.json())
.then(json => {
    const { success, data, error } = json

    if (success) {
        const { id } = data
        console.log('New inquiry id', id)
    }

})
.catch(error => console.error(error));
```

{% endtab %}

{% tab title="PHP" %}

```php
$accessToken = urlencode('<ACCESS TOKEN>');

$url = 'https://public-api.expertfile.com/v2/organization/:corporation/inquiry/general';

$data = ['firstname' => 'Testfirstname',
'lastname' => 'Teslastname',
'email' => 'testing@test.com',
'phone' => '(555) 555-5555',
'website' => 'https://mywebsite.com',
'organization' => 'NYT',
'location_city' => 'New York City',
'location_state' => 'NY',
'location_country' => 'US',
'username' => '<EXPERT USERNAME>',
'message' => 'This is a test message to the expert...'];

$ch = curl_init($url);
curl_setopt(
    $ch,
    CURLOPT_HTTPHEADER,
    array('Content-Type: application/x-www-form-urlencoded', 'Authorization: Bearer ' . $accessToken)
);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_POSTFIELDS, http_build_query($data));

$response = curl_exec($ch);
$json = json_decode($response);

if($json->success){
    var_dump($json->data);
}

curl_close($ch);
```

{% endtab %}

{% tab title="Curl" %}

```
curl -X POST https://public-api.expertfile.com/v2/organization/:corporation/inquiry/general \
    -H "Content-Type: application/json" \
    -H "Authorization: Bearer <ACCESS TOKEN>" \
    -d '{ "firstname": "Testfirstname","lastname": "Teslastname","email": "testing@test.com","phone": "(555) 555-5555","website": "https://mywebsite.com","organization": "NYT","location_city": "New York City","location_state": "NY","location_country": "US","username": "<EXPERT USERNAME>", "message": "This is a test message to the expert..." }'
    
```

{% endtab %}
{% endtabs %}


# Media

## Send Media Inquiry

<mark style="color:blue;">`POST`</mark> [**/v2/organization/:corporation/inquiry/media**](https://public-api.expertfile.com/v2/organization/:corporation/inquiry/media)

**Headers**

| Name          | Value              |
| ------------- | ------------------ |
| Content-Type  | `application/json` |
| Authorization | `Bearer <token>`   |

**Url**

<table><thead><tr><th width="339.3333333333333">Name</th><th>Type</th><th>Description</th></tr></thead><tbody><tr><td>corporation</td><td>number</td><td>Corporation ID</td></tr></tbody></table>

**Body**

<table><thead><tr><th width="339.3333333333333">Name</th><th>Type</th><th>Description</th></tr></thead><tbody><tr><td>firstname<mark style="color:red;"><strong>*</strong></mark></td><td>string</td><td>Sender first name</td></tr><tr><td>lastname</td><td>string</td><td>Sender last name</td></tr><tr><td>email<mark style="color:red;"><strong>*</strong></mark></td><td>string</td><td>Sender email address</td></tr><tr><td>phone</td><td>string</td><td>Sender phone #</td></tr><tr><td>website</td><td>string</td><td>Sender website</td></tr><tr><td>organization</td><td>string</td><td>Sender company</td></tr><tr><td>message<mark style="color:red;"><strong>*</strong></mark></td><td>string</td><td>Sender message</td></tr><tr><td>location_city</td><td>string</td><td>Sender city</td></tr><tr><td>location_state</td><td>string</td><td>Sender state/province<br>See full list <a href="/reference/helpers#state-province-codes"><em><strong>here</strong></em></a></td></tr><tr><td>location_country</td><td>string</td><td>Sender country<br>See full list <a href="/reference/helpers#country-codes"><em><strong>here</strong></em></a></td></tr><tr><td>username<mark style="color:red;"><strong>*</strong></mark></td><td>string</td><td>Recipient(Expert) username</td></tr><tr><td>media_position<mark style="color:red;"><strong>*</strong></mark></td><td>string</td><td>Media Position(valid input: 'reporter','editor','news_director','researcher', 'other')</td></tr><tr><td>media_type<mark style="color:red;"><strong>*</strong></mark></td><td>string</td><td>Media Type</td></tr><tr><td>media_deadline<mark style="color:red;"><strong>*</strong></mark></td><td>unix timestampe</td><td>Media Deadline</td></tr></tbody></table>

**Response**

{% tabs %}
{% tab title="200" %}

```json
{ 
    data: { 
        id: <INQUIRY_ID>
    }, 
    success: true 
}
```

{% endtab %}
{% endtabs %}

Code

{% tabs %}
{% tab title="Node" %}

```javascript
const data = new URLSearchParams();
const accessToken = `<ACCESS TOKEN>`

data.append('firstname', 'Testfirstname');
data.append('lastname', 'Teslastname');
data.append('email', 'testing@test.com');
data.append('phone', '(555) 555-5555');
data.append('website', 'https://mywebsite.com');
data.append('organization', 'NYT');
data.append('location_city', 'New York City');
data.append('location_state', 'NY');
data.append('location_country', 'US');
data.append('username', '<EXPERT USERNAME>');
data.append('media_position', 'other');
data.append('media_type', 'Podcast');
data.append('media_deadline', 1714657477)
data.append('message', 'This is a test message to the expert...');

fetch('https://public-api.expertfile.com/v2/organization/:corporation/inquiry/media', {
    method: 'POST',
    headers: {
        'Content-Type': 'application/x-www-form-urlencoded',
        'Authorization': `Bearer ${accessToken}`
    },
    body: data
})
.then(response => response.json())
.then(json => {
    const { success, data, error } = json

    if (success) {
        const { id } = data
        console.log('New inquiry id', id)
    }

})
.catch(error => console.error(error));
```

{% endtab %}

{% tab title="PHP" %}

```php
$accessToken = urlencode('<ACCESS TOKEN>');

$url = 'https://public-api.expertfile.com/v2/organization/:corporation/inquiry/media';

$data = ['firstname' => 'Testfirstname',
'lastname' => 'Teslastname',
'email' => 'testing@test.com',
'phone' => '(555) 555-5555',
'website' => 'https://mywebsite.com',
'organization' => 'NYT',
'location_city' => 'New York City',
'location_state' => 'NY',
'location_country' => 'US',
'media_position' => 'other',
'media_type' => 'Podcast',
'media_deadline' => 17146574,
'username' => '<EXPERT USERNAME>',
'message' => 'This is a test message to the expert...'];

$ch = curl_init($url);
curl_setopt(
    $ch,
    CURLOPT_HTTPHEADER,
    array('Content-Type: application/x-www-form-urlencoded', 'Authorization: Bearer ' . $accessToken)
);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_POSTFIELDS, http_build_query($data));

$response = curl_exec($ch);
$json = json_decode($response);

if($json->success){
    var_dump($json->data);
}

curl_close($ch);
```

{% endtab %}

{% tab title="Curl" %}

```
curl -X POST https://public-api.expertfile.com/v2/organization/:corporation/inquiry/media \
    -H "Content-Type: application/json" \
    -H "Authorization: Bearer <ACCESS TOKEN>" \
    -d '{ "firstname": "Testfirstname","lastname": "Teslastname","email": "testing@test.com","phone": "(555) 555-5555","website": "https://mywebsite.com","organization": "NYT","location_city": "New York City","location_state": "NY","location_country": "US","username": "<EXPERT USERNAME>", "media_position": "other", "media_type": "Podcast", "media_deadline": 1714657477, "message": "This is a test message to the expert..." }'
    
```

{% endtab %}
{% endtabs %}


# Meeting

## Send Meeting Inquiry

<mark style="color:blue;">`POST`</mark> [**/v2/organization/:corporation/inquiry/meeting**](https://public-api.expertfile.com/v2/organization/:corporation/inquiry/meeting)

**Headers**

| Name          | Value              |
| ------------- | ------------------ |
| Content-Type  | `application/json` |
| Authorization | `Bearer <token>`   |

**Url**

<table><thead><tr><th width="339.3333333333333">Name</th><th>Type</th><th>Description</th></tr></thead><tbody><tr><td>corporation</td><td>number</td><td>Corporation ID</td></tr></tbody></table>

**Body**

<table><thead><tr><th width="339.3333333333333">Name</th><th>Type</th><th>Description</th></tr></thead><tbody><tr><td>firstname<mark style="color:red;"><strong>*</strong></mark></td><td>string</td><td>Sender first name</td></tr><tr><td>lastname</td><td>string</td><td>Sender last name</td></tr><tr><td>email<mark style="color:red;"><strong>*</strong></mark></td><td>string</td><td>Sender email address</td></tr><tr><td>phone</td><td>string</td><td>Sender phone #</td></tr><tr><td>website</td><td>string</td><td>Sender website</td></tr><tr><td>organization</td><td>string</td><td>Sender company</td></tr><tr><td>message<mark style="color:red;"><strong>*</strong></mark></td><td>string</td><td>Sender message</td></tr><tr><td>location_city</td><td>string</td><td>Sender city</td></tr><tr><td>location_state</td><td>string</td><td>Sender state/province<br>See full list <a href="/reference/helpers#state-province-codes"><em><strong>here</strong></em></a></td></tr><tr><td>location_country</td><td>string</td><td>Sender country<br>See full list <a href="/reference/helpers#country-codes"><em><strong>here</strong></em></a></td></tr><tr><td>username<mark style="color:red;"><strong>*</strong></mark></td><td>string</td><td>Recipient(Expert) username</td></tr><tr><td>meeting_preferred_time<mark style="color:red;"><strong>*</strong></mark></td><td>string</td><td>Time of day</td></tr><tr><td>meeting_preferred_days<mark style="color:red;"><strong>*</strong></mark></td><td>string</td><td>Days of the week(comma separated)</td></tr><tr><td>meeting_timezone<mark style="color:red;"><strong>*</strong></mark></td><td>string</td><td>Meeting timezone</td></tr><tr><td>meeting_discussion_topics</td><td>string</td><td>Meeting discussion topics</td></tr></tbody></table>

**Response**

{% tabs %}
{% tab title="200" %}

```json
{ 
    data: { 
        id: <INQUIRY_ID>
    }, 
    success: true 
}
```

{% endtab %}
{% endtabs %}

Code

{% tabs %}
{% tab title="Node" %}

```javascript
const data = new URLSearchParams();
const accessToken = `<ACCESS TOKEN>`

data.append('firstname', 'Testfirstname');
data.append('lastname', 'Teslastname');
data.append('email', 'testing@test.com');
data.append('phone', '(555) 555-5555');
data.append('website', 'https://mywebsite.com');
data.append('organization', 'NYT');
data.append('location_city', 'New York City');
data.append('location_state', 'NY');
data.append('location_country', 'US');
data.append('username', '<EXPERT USERNAME>');
data.append('meeting_preferred_time', 'AM');
data.append('meeting_preferred_days', 'Thursday, Friday');
data.append('meeting_timezone', 'EDT America/Toronto (GMT -04:00)');
data.append('meeting_discussion_topics', 'This is a meeting discussion note...');
data.append('message', 'This is a test message to the expert...');

fetch('https://public-api.expertfile.com/v2/organization/:corporation/inquiry/meeting', {
    method: 'POST',
    headers: {
        'Content-Type': 'application/x-www-form-urlencoded',
        'Authorization': `Bearer ${accessToken}`
    },
    body: data
})
.then(response => response.json())
.then(json => {
    const { success, data, error } = json

    if (success) {
        const { id } = data
        console.log('New inquiry id', id)
    }

})
.catch(error => console.error(error));
```

{% endtab %}

{% tab title="PHP" %}

```php
$accessToken = urlencode('<ACCESS TOKEN>');

$url = 'https://public-api.expertfile.com/v2/organization/:corporation/inquiry/meeting';

$data = ['firstname' => 'Testfirstname',
'lastname' => 'Teslastname',
'email' => 'testing@test.com',
'phone' => '(555) 555-5555',
'website' => 'https://mywebsite.com',
'organization' => 'NYT',
'location_city' => 'New York City',
'location_state' => 'NY',
'location_country' => 'US',
'meeting_preferred_time' => 'AM',
'meeting_preferred_days' => 'Thursday, Friday',
'meeting_timezone' => 'EDT America/Toronto (GMT -04:00)',
'meeting_discussion_topics' => 'This is a meeting discussion note...',
'username' => '<EXPERT USERNAME>',
'message' => 'This is a test message to the expert...'];

$ch = curl_init($url);
curl_setopt(
    $ch,
    CURLOPT_HTTPHEADER,
    array('Content-Type: application/x-www-form-urlencoded', 'Authorization: Bearer ' . $accessToken)
);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_POSTFIELDS, http_build_query($data));

$response = curl_exec($ch);
$json = json_decode($response);

if($json->success){
    var_dump($json->data);
}

curl_close($ch);
```

{% endtab %}

{% tab title="Curl" %}

```
curl -X POST https://public-api.expertfile.com/v2/organization/:corporation/inquiry/meeting \
    -H "Content-Type: application/json" \
    -H "Authorization: Bearer <ACCESS TOKEN>" \
    -d '{ "firstname": "Testfirstname","lastname": "Teslastname","email": "testing@test.com","phone": "(555) 555-5555","website": "https://mywebsite.com","organization": "NYT","location_city": "New York City","location_state": "NY","location_country": "US","username": "<EXPERT USERNAME>","meeting_preferred_time": "AM", "meeting_preferred_days": "Thursday, Friday", "meeting_timezone": "EDT America/Toronto (GMT -04:00)", "meeting_discussion_topics": "This is a meeting discussion note...", "message": "This is a test message to the expert..." }'
```

{% endtab %}
{% endtabs %}


# Partnership

## Send Partnership Inquiry

<mark style="color:blue;">`POST`</mark>[ **/v2/organization/:corporation/inquiry/partnership**](https://public-api.expertfile.com/v2/organization/:corporation/inquiry/partnership)

**Headers**

| Name          | Value              |
| ------------- | ------------------ |
| Content-Type  | `application/json` |
| Authorization | `Bearer <token>`   |

**Url**

<table><thead><tr><th width="339.3333333333333">Name</th><th>Type</th><th>Description</th></tr></thead><tbody><tr><td>corporation</td><td>number</td><td>Corporation ID</td></tr></tbody></table>

**Body**

<table><thead><tr><th width="339.3333333333333">Name</th><th>Type</th><th>Description</th></tr></thead><tbody><tr><td>firstname<mark style="color:red;"><strong>*</strong></mark></td><td>string</td><td>Sender first name</td></tr><tr><td>lastname</td><td>string</td><td>Sender last name</td></tr><tr><td>email<mark style="color:red;"><strong>*</strong></mark></td><td>string</td><td>Sender email address</td></tr><tr><td>phone</td><td>string</td><td>Sender phone #</td></tr><tr><td>website</td><td>string</td><td>Sender website</td></tr><tr><td>organization</td><td>string</td><td>Sender company</td></tr><tr><td>message<mark style="color:red;"><strong>*</strong></mark></td><td>string</td><td>Sender message</td></tr><tr><td>location_city</td><td>string</td><td>Sender city</td></tr><tr><td>location_state</td><td>string</td><td>Sender state/province<br>See full list <a href="/reference/helpers#state-province-codes"><em><strong>here</strong></em></a></td></tr><tr><td>location_country</td><td>string</td><td>Sender country<br>See full list <a href="/reference/helpers#country-codes"><em><strong>here</strong></em></a></td></tr><tr><td>username<mark style="color:red;"><strong>*</strong></mark></td><td>string</td><td>Recipient(Expert) username</td></tr><tr><td>partner_organization_type<mark style="color:red;"><strong>*</strong></mark></td><td>string</td><td>Organization Type(valid input: 'corporate', 'government', 'ngo', 'not_for_profit', 'other')</td></tr><tr><td>partner_focus<mark style="color:red;"><strong>*</strong></mark></td><td>string</td><td>Focus(valid input: 'business_development', 'corporate', 'fundraising', 'licensing', 'research', 'sponsorship', 'technology', 'other')</td></tr></tbody></table>

**Response**

{% tabs %}
{% tab title="200" %}

```json
{ 
    data: { 
        id: <INQUIRY_ID>
    }, 
    success: true 
}
```

{% endtab %}
{% endtabs %}

Code

{% tabs %}
{% tab title="Node" %}

```javascript
const data = new URLSearchParams();
const accessToken = `<ACCESS TOKEN>`

data.append('firstname', 'Testfirstname');
data.append('lastname', 'Teslastname');
data.append('email', 'testing@test.com');
data.append('phone', '(555) 555-5555');
data.append('website', 'https://mywebsite.com');
data.append('organization', 'NYT');
data.append('location_city', 'New York City');
data.append('location_state', 'NY');
data.append('location_country', 'US');
data.append('username', '<EXPERT USERNAME>');
data.append('partner_organization_type', 'not_for_profit');
data.append('partner_focus', 'business_development');
data.append('message', 'This is a test message to the expert...');

fetch('https://public-api.expertfile.com/v2/organization/:corporation/inquiry/partnership', {
    method: 'POST',
    headers: {
        'Content-Type': 'application/x-www-form-urlencoded',
        'Authorization': `Bearer ${accessToken}`
    },
    body: data
})
.then(response => response.json())
.then(json => {
    const { success, data, error } = json

    if (success) {
        const { id } = data
        console.log('New inquiry id', id)
    }

})
.catch(error => console.error(error));
```

{% endtab %}

{% tab title="PHP" %}

```php
$accessToken = urlencode('<ACCESS TOKEN>');

$url = 'https://public-api.expertfile.com/v2/organization/:corporation/inquiry/partnership';

$data = ['firstname' => 'Testfirstname',
'lastname' => 'Teslastname',
'email' => 'testing@test.com',
'phone' => '(555) 555-5555',
'website' => 'https://mywebsite.com',
'organization' => 'NYT',
'location_city' => 'New York City',
'location_state' => 'NY',
'location_country' => 'US',
'partner_organization_type' => 'not_for_profit',
'partner_focus' => 'business_development',
'username' => '<EXPERT USERNAME>',
'message' => 'This is a test message to the expert...'];

$ch = curl_init($url);
curl_setopt(
    $ch,
    CURLOPT_HTTPHEADER,
    array('Content-Type: application/x-www-form-urlencoded', 'Authorization: Bearer ' . $accessToken)
);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_POSTFIELDS, http_build_query($data));

$response = curl_exec($ch);
$json = json_decode($response);

if($json->success){
    var_dump($json->data);
}

curl_close($ch);
```

{% endtab %}

{% tab title="Curl" %}

```
curl -X POST https://public-api.expertfile.com/v2/organization/:corporation/inquiry/partnership \
    -H "Content-Type: application/json" \
    -H "Authorization: Bearer <ACCESS TOKEN>" \
    -d '{ "firstname": "Testfirstname","lastname": "Teslastname","email": "testing@test.com","phone": "(555) 555-5555","website": "https://mywebsite.com","organization": "NYT","location_city": "New York City","location_state": "NY","location_country": "US","username": "<EXPERT USERNAME>", "partner_organization_type": "not_for_profit", "partner_focus": "business_development", "message": "This is a test message to the expert..." }'

```

{% endtab %}
{% endtabs %}


# Research

## Send Research Inquiry

<mark style="color:blue;">`POST`</mark> [**/v2/organization/:corporation/inquiry/research**](https://public-api.expertfile.com/v2/organization/:corporation/inquiry/research)

**Headers**

| Name          | Value              |
| ------------- | ------------------ |
| Content-Type  | `application/json` |
| Authorization | `Bearer <token>`   |

**Url**

<table><thead><tr><th width="339.3333333333333">Name</th><th>Type</th><th>Description</th></tr></thead><tbody><tr><td>corporation</td><td>number</td><td>Corporation ID</td></tr></tbody></table>

**Body**

<table><thead><tr><th width="339.3333333333333">Name</th><th>Type</th><th>Description</th></tr></thead><tbody><tr><td>firstname<mark style="color:red;"><strong>*</strong></mark></td><td>string</td><td>Sender first name</td></tr><tr><td>lastname</td><td>string</td><td>Sender last name</td></tr><tr><td>email<mark style="color:red;"><strong>*</strong></mark></td><td>string</td><td>Sender email address</td></tr><tr><td>phone</td><td>string</td><td>Sender phone #</td></tr><tr><td>website</td><td>string</td><td>Sender website</td></tr><tr><td>organization</td><td>string</td><td>Sender company</td></tr><tr><td>message<mark style="color:red;"><strong>*</strong></mark></td><td>string</td><td>Sender message</td></tr><tr><td>location_city</td><td>string</td><td>Sender city</td></tr><tr><td>location_state</td><td>string</td><td>Sender state/province<br>See full list <a href="/reference/helpers#state-province-codes"><em><strong>here</strong></em></a></td></tr><tr><td>location_country</td><td>string</td><td>Sender country<br>See full list <a href="/reference/helpers#country-codes"><em><strong>here</strong></em></a></td></tr><tr><td>username<mark style="color:red;"><strong>*</strong></mark></td><td>string</td><td>Recipient(Expert) username</td></tr><tr><td>research_area<mark style="color:red;"><strong>*</strong></mark></td><td>string</td><td>Research Area</td></tr><tr><td>research_stage_in_process<mark style="color:red;"><strong>*</strong></mark></td><td>string</td><td>Research Stage(valid input: 'collaboration', 'funding', 'partnership', 'other')</td></tr><tr><td>research_deadline</td><td>unix timestamp</td><td>Deadline</td></tr></tbody></table>

**Response**

{% tabs %}
{% tab title="200" %}

```json
{ 
    data: { 
        id: <INQUIRY_ID>
    }, 
    success: true 
}
```

{% endtab %}
{% endtabs %}

Code

{% tabs %}
{% tab title="Node" %}

```javascript
const data = new URLSearchParams();
const accessToken = `<ACCESS TOKEN>`

data.append('firstname', 'Testfirstname');
data.append('lastname', 'Teslastname');
data.append('email', 'testing@test.com');
data.append('phone', '(555) 555-5555');
data.append('website', 'https://mywebsite.com');
data.append('organization', 'NYT');
data.append('location_city', 'New York City');
data.append('location_state', 'NY');
data.append('location_country', 'US');
data.append('username', '<EXPERT USERNAME>');
data.append('research_area', 'Research area...');
data.append('research_stage_in_process', 'collaboration');
data.append('research_deadline', 1714657477);
data.append('message', 'This is a test message to the expert...');

fetch('https://public-api.expertfile.com/v2/organization/:corporation/inquiry/research', {
    method: 'POST',
    headers: {
        'Content-Type': 'application/x-www-form-urlencoded',
        'Authorization': `Bearer ${accessToken}`
    },
    body: data
})
.then(response => response.json())
.then(json => {
    const { success, data, error } = json

    if (success) {
        const { id } = data
        console.log('New inquiry id', id)
    }

})
.catch(error => console.error(error));
```

{% endtab %}

{% tab title="PHP" %}

```php
$accessToken = urlencode('<ACCESS TOKEN>');

$url = 'https://public-api.expertfile.com/v2/organization/:corporation/inquiry/research';

$data = ['firstname' => 'Testfirstname',
'lastname' => 'Teslastname',
'email' => 'testing@test.com',
'phone' => '(555) 555-5555',
'website' => 'https://mywebsite.com',
'organization' => 'NYT',
'location_city' => 'New York City',
'location_state' => 'NY',
'location_country' => 'US',
'research_area' => 'Research area...',
'research_stage_in_process' => 'collaboration',
'research_deadline' => 1714657477,
'username' => '<EXPERT USERNAME>',
'message' => 'This is a test message to the expert...'];

$ch = curl_init($url);
curl_setopt(
    $ch,
    CURLOPT_HTTPHEADER,
    array('Content-Type: application/x-www-form-urlencoded', 'Authorization: Bearer ' . $accessToken)
);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_POSTFIELDS, http_build_query($data));

$response = curl_exec($ch);
$json = json_decode($response);

if($json->success){
    var_dump($json->data);
}

curl_close($ch);
```

{% endtab %}

{% tab title="Curl" %}

```
curl -X POST https://public-api.expertfile.com/v2/organization/:corporation/inquiry/research \
    -H "Content-Type: application/json" \
    -H "Authorization: Bearer <ACCESS TOKEN>" \
    -d '{ "firstname": "Testfirstname","lastname": "Teslastname","email": "testing@test.com","phone": "(555) 555-5555","website": "https://mywebsite.com","organization": "NYT","location_city": "New York City","location_state": "NY","location_country": "US","username": "<EXPERT USERNAME>","research_area": "Research area...", "research_stage_in_process": "collaboration", "research_deadline: 1714657477", "message": "This is a test message to the expert..." }'

```

{% endtab %}
{% endtabs %}


# Posts (Spotlights)

Welcome to the Posts API Documentation! This guide serves as your gateway to harnessing the power of our versatile Posts API. Explore our documentation to discover endpoints, parameters, & examples.

### Generate a Token:

{% content-ref url="/pages/BYd1G0wKUbajbfmWWW79" %}
[Authentication](/reference/api-reference/authentication)
{% endcontent-ref %}

### Explore the  Listing/Search endpoint:

{% content-ref url="/pages/IIv8ZS9Vkckkgyw7lJCI" %}
[Post Listings/Search](/reference/api-reference/posts-spotlights/post-listings-search)
{% endcontent-ref %}

### Full Post data:

{% content-ref url="/pages/ZrV7E5yJZQA6mnhGRDET" %}
[Full Post](/reference/api-reference/posts-spotlights/full-post)
{% endcontent-ref %}

### Adding Analytics tracking to your pages:

{% content-ref url="/pages/B8RUWa1icG9Xs3ADG2IM" %}
[Tracking Code (Analytics)](/reference/tracking-code-analytics)
{% endcontent-ref %}


# Post Listings/Search

{% hint style="info" %}
Remember to change **:corporation** with your corporation id(found in the integrations section of the dashboard).
{% endhint %}

## Listing Posts

<mark style="color:green;">`GET`</mark> [**/v2/spotlight/:corporation/search**](https://public-api.expertfile.com/v2/spotlight/:corporation/search)

**Headers**

| Name          | Value              |
| ------------- | ------------------ |
| Content-Type  | `application/json` |
| Authorization | `Bearer <token>`   |

**Url**

<table><thead><tr><th width="339.3333333333333">Name</th><th>Type</th><th>Description</th></tr></thead><tbody><tr><td>corporation</td><td>number</td><td>Corporation ID</td></tr><tr><td>username</td><td>string</td><td>Unique username</td></tr><tr><td>q</td><td>string</td><td>Keyword search term</td></tr><tr><td>month</td><td>string</td><td>Published month</td></tr><tr><td>year</td><td>string</td><td>Published year</td></tr><tr><td>page_size</td><td>number</td><td>Size of page</td></tr><tr><td>page_from</td><td>number</td><td>Starting point</td></tr><tr><td>tagged</td><td>string</td><td>Filter by tagged experts(array of usernames(i.e. ["expert1","expert1"]))</td></tr><tr><td>tags</td><td>string</td><td>Filter by tags. Array of tags(i.e. ["tag1","tag2"])</td></tr></tbody></table>

**Response**

{% tabs %}
{% tab title="200" %}

```json
{
  data: {
    spotlights: [],
    aggregations: {
      year: [],
      tagged_experts: [],
      tags: []
    },
    total: 10
  },
  success: true
}  
```

{% endtab %}
{% endtabs %}

**Code**

{% tabs %}
{% tab title="Node" %}

```javascript
const accessToken = `<ACCESS TOKEN>`

fetch('https://public-api.expertfile.com/v2/spotlight/:corporation/search', {
    method: 'GET',
    headers: {
        'Content-Type': 'application/x-www-form-urlencoded',
        'Authorization': `Bearer ${accessToken}`
    }
})
.then(response => response.json())
.then(json => {
    const { success, data } = json

    if (success) {
        const { spotlights, aggregations } = data;
        console.log('Posts', spotlights);
        console.log('Filters', aggregations);
    }

})
.catch(error => console.error(error));
```

{% endtab %}

{% tab title="PHP" %}

```php
$accessToken = urlencode('<ACCESS TOKEN>');
$url = 'https://public-api.expertfile.com/v2/spotlight/:corporation/search';

$ch = curl_init($url);
curl_setopt(
    $ch,
    CURLOPT_HTTPHEADER,
    array('Content-Type: application/x-www-form-urlencoded', 'Authorization: Bearer ' . $accessToken)
);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);

$response = curl_exec($ch);
$json = json_decode($response);

if($json->success){
    var_dump($json->data);
}

curl_close($ch);

```

{% endtab %}

{% tab title="Curl" %}

```
curl https://public-api.expertfile.com/v2/spotlight/:corporation/search \
    -H "Content-Type: application/json" \
    -H "Authorization: Bearer <ACCESS TOKEN>"
```

{% endtab %}
{% endtabs %}

## Applying Tagged Filter to Posts

<mark style="color:green;">`GET`</mark> [**/v2/organization/:corporation/expert**](https://public-api.expertfile.com/v2/organization/:corporation/expert)

**Headers**

| Name          | Value              |
| ------------- | ------------------ |
| Content-Type  | `application/json` |
| Authorization | `Bearer <token>`   |

**Url**

<table><thead><tr><th width="339.3333333333333">Name</th><th>Type</th><th>Description</th></tr></thead><tbody><tr><td>corporation</td><td>number</td><td>Corporation ID</td></tr><tr><td>categories</td><td>string</td><td>Filter by categories. Array of categories(i.e. ["cat1","cat2"])</td></tr></tbody></table>

**Response**

{% tabs %}
{% tab title="200" %}

```json
{
  data: {
    spotlights: [],
    aggregations: {
      year: [],
      tagged_experts: [],
      tags: []
    },
    total: 10
  },
  success: true
} 
```

{% endtab %}
{% endtabs %}

**Code**

{% tabs %}
{% tab title="Node" %}

```javascript
const accessToken = `<ACCESS TOKEN>`

const params = {
    tagged: JSON.stringify(['<USERNAME1>', '<USERNAME2>'])
};

const qs = new URLSearchParams(params).toString()

const path = `https://public-api.expertfile.com/v2/spotlight/:corporation/search${qs ? '?' + qs : ''}`
fetch(path, {
    method: 'GET',
    headers: {
        'Content-Type': 'application/x-www-form-urlencoded',
        'Authorization': `Bearer ${accessToken}`
    }
})
.then(response => response.json())
.then(json => {
    const { success, data } = json

    if (success) {
        const { spotlights:, aggregations } = data;
        console.log('Posts', spotlights:);
        console.log('Filters', aggregations);
    }

})
.catch(error => console.error(error));
```

{% endtab %}

{% tab title="PHP" %}

```php
$accessToken = urlencode('<ACCESS CODE>');
$parameters = array(
    'tagged' => json_encode(['<USERNAME1>', '<USERNAME2>'])
);

$url = 'https://public-api.expertfile.com/v2/spotlight/:corporation/search?' . http_build_query($parameters);

$ch = curl_init($url);
curl_setopt(
    $ch,
    CURLOPT_HTTPHEADER,
    array('Content-Type: application/x-www-form-urlencoded', 'Authorization: Bearer ' . $accessToken)
);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);

$response = curl_exec($ch);
$json = json_decode($response);

if($json->success){
    var_dump($json->data);
}

curl_close($ch);
```

{% endtab %}

{% tab title="Curl" %}

```
curl --GET \
--data-urlencode 'tagged=["<USERNAME1>","<USERNAME2>"]' \
https://public-api.expertfile.com/v2/spotlight/:corporation/search \
-H "Content-Type: application/json" \
-H "Authorization: Bearer <ACCESS CODE>"
```

{% endtab %}
{% endtabs %}


# Full Post

{% hint style="info" %}
Please note that in all urls & code samples you'll need to replace`:id` and `:corporation` with appropriate values
{% endhint %}

## Get Individual Post

<mark style="color:green;">`GET`</mark>[ **/v2/spotlight/:corporation/:id**](https://public-api.expertfile.com/v2/spotlight/:corporation/:id)

**Headers**

| Name          | Value              |
| ------------- | ------------------ |
| Content-Type  | `application/json` |
| Authorization | `Bearer <token>`   |

**Url**

<table><thead><tr><th width="339.3333333333333">Name</th><th>Type</th><th>Description</th></tr></thead><tbody><tr><td>corporation</td><td>number</td><td>Corporation ID</td></tr><tr><td>id</td><td>number</td><td>Unique post id</td></tr></tbody></table>

**Response**

{% tabs %}
{% tab title="200" %}

```json
 {
  data: {
    spotlight: [],
    tags: [],
    seo: []
  },
  success: true
}
```

{% endtab %}
{% endtabs %}

Code

{% tabs %}
{% tab title="Node" %}

```javascript
const accessToken = `<ACCESS TOKEN>`

fetch('https://public-api.expertfile.com/v2/spotlight/:corporation/:id', {
    method: 'GET',
    headers: {
        'Content-Type': 'application/x-www-form-urlencoded',
        'Authorization': `Bearer ${accessToken}`
    }
})
.then(response => response.json())
.then(json => {
    const { success, data } = json

    if (success) {
        const { spotlight, tags, seo } = data;
        console.log('post', spotlight)
    }

})
.catch(error => console.error(error));
```

{% endtab %}

{% tab title="PHP" %}

```php
$accessToken = urlencode('<ACCESS TOKEN>');
$url = 'https://public-api.expertfile.com/v2/spotlight/:corporation/:id';

$ch = curl_init($url);
curl_setopt(
    $ch,
    CURLOPT_HTTPHEADER,
    array('Content-Type: application/x-www-form-urlencoded', 'Authorization: Bearer ' . $accessToken)
);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);

$response = curl_exec($ch);
$json = json_decode($response);

if($json->success){
    var_dump($json->data);
}

curl_close($ch);
```

{% endtab %}

{% tab title="Curl" %}

```
curl https://public-api.expertfile.com/v2/spotlight/:corporation/:id
    -H "Content-Type: application/json" \
    -H "Authorization: Bearer <ACCESS TOKEN>"
```

{% endtab %}
{% endtabs %}


# Q\&A (Answers)

Welcome to the ExpertAnswers API Documentation! This comprehensive guide is designed to empower developers to seamlessly integrate our ExpertAnswers platform into their applications and workflows.

### Generate a Token:

{% content-ref url="/pages/BYd1G0wKUbajbfmWWW79" %}
[Authentication](/reference/api-reference/authentication)
{% endcontent-ref %}

### Explore the  Listing/Search endpoint:

{% content-ref url="/pages/h1fWCUn03se0SBPyjPU3" %}
[Q\&A Listings/Search](/reference/api-reference/q-and-a-answers/q-and-a-listings-search)
{% endcontent-ref %}

### Full Question & Answer data:

{% content-ref url="/pages/LWnBdjy1WPddySA0TH3I" %}
[Individual Q\&A](/reference/api-reference/q-and-a-answers/individual-q-and-a)
{% endcontent-ref %}

### Adding Analytics tracking to your pages:

{% content-ref url="/pages/B8RUWa1icG9Xs3ADG2IM" %}
[Tracking Code (Analytics)](/reference/tracking-code-analytics)
{% endcontent-ref %}


# Q\&A Listings/Search

{% hint style="info" %}
Remember to change **:corporation** with your corporation id(found in the integrations section of the dashboard).
{% endhint %}

## Listing ExpertAnswers

<mark style="color:green;">`GET`</mark>[ **/v2/qanda/:corporation/search**](https://public-api.expertfile.com/v2/qanda/:corporation/search)

**Headers**

| Name          | Value              |
| ------------- | ------------------ |
| Content-Type  | `application/json` |
| Authorization | `Bearer <token>`   |

**Url**

<table><thead><tr><th width="339.3333333333333">Name</th><th>Type</th><th>Description</th></tr></thead><tbody><tr><td>corporation</td><td>number</td><td>Corporation ID</td></tr><tr><td>username</td><td>string</td><td>Unique username</td></tr><tr><td>page_size</td><td>number</td><td>Size of page</td></tr><tr><td>page_from</td><td>number</td><td>Starting point</td></tr><tr><td>tags</td><td>string</td><td>Filter by tags. Array of tags(i.e. ["tag1","tag2"])</td></tr></tbody></table>

**Response**

{% tabs %}
{% tab title="200" %}

```json
{
  data: {
    questions: [],  
    total: 10
  },
  success: true
}  
```

{% endtab %}
{% endtabs %}

**Code**

{% tabs %}
{% tab title="Node" %}

```javascript
const accessToken = `<ACCESS TOKEN>`

fetch('https://public-api.expertfile.com/v2/qanda/:corporation/search', {
    method: 'GET',
    headers: {
        'Content-Type': 'application/x-www-form-urlencoded',
        'Authorization': `Bearer ${accessToken}`
    }
})
.then(response => response.json())
.then(json => {
    const { success, data } = json

    if (success) {
        const { questions } = data;
        console.log('Questions', questions);
    }

})
.catch(error => console.error(error));
```

{% endtab %}

{% tab title="PHP" %}

```php
$accessToken = urlencode('<ACCESS TOKEN>');
$url = 'https://public-api.expertfile.com/v2/qanda/:corporation/search';

$ch = curl_init($url);
curl_setopt(
    $ch,
    CURLOPT_HTTPHEADER,
    array('Content-Type: application/x-www-form-urlencoded', 'Authorization: Bearer ' . $accessToken)
);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);

$response = curl_exec($ch);
$json = json_decode($response);

if($json->success){
    var_dump($json->data);
}

curl_close($ch);

```

{% endtab %}

{% tab title="Curl" %}

```
curl https://public-api.expertfile.com/v2/qanda/:corporation/search \
    -H "Content-Type: application/json" \
    -H "Authorization: Bearer <ACCESS TOKEN>"
```

{% endtab %}
{% endtabs %}

## Applying Tags Filter to ExpertAnswers

<mark style="color:green;">`GET`</mark> [**/v2/qanda/:corporation/search**](https://public-api.expertfile.com/v2/qanda/:corporation/search)

**Headers**

| Name          | Value              |
| ------------- | ------------------ |
| Content-Type  | `application/json` |
| Authorization | `Bearer <token>`   |

**Url**

<table><thead><tr><th width="339.3333333333333">Name</th><th>Type</th><th>Description</th></tr></thead><tbody><tr><td>corporation</td><td>number</td><td>Corporation ID</td></tr><tr><td>tags</td><td>string</td><td>Filter by categories. Array of tags(i.e. ["tag1","tag2"])</td></tr></tbody></table>

**Response**

{% tabs %}
{% tab title="200" %}

```json
{
  data: {
    questions: [],  
    total: 10
  },
  success: true
} 
```

{% endtab %}
{% endtabs %}

**Code**

{% tabs %}
{% tab title="Node" %}

```javascript
const accessToken = `<ACCESS TOKEN>`

const params = {
    tags: JSON.stringify(['<TAG1>', '<TAG2>'])
};

const qs = new URLSearchParams(params).toString()

const path = `https://public-api.expertfile.com/v2/spotlight/:corporation/search${qs ? '?' + qs : ''}`
fetch(path, {
    method: 'GET',
    headers: {
        'Content-Type': 'application/x-www-form-urlencoded',
        'Authorization': `Bearer ${accessToken}`
    }
})
.then(response => response.json())
.then(json => {
    const { success, data } = json

    if (success) {
        const { questions, total } = data;
        console.log('Questions', questions);
    }

})
.catch(error => console.error(error));
```

{% endtab %}

{% tab title="PHP" %}

```php
$accessToken = urlencode('<ACCESS CODE>');
$parameters = array(
    'tags' => json_encode(['<TAG1>', '<TAG2>'])
);

$url = 'https://public-api.expertfile.com/v2/spotlight/:corporation/search?' . http_build_query($parameters);

$ch = curl_init($url);
curl_setopt(
    $ch,
    CURLOPT_HTTPHEADER,
    array('Content-Type: application/x-www-form-urlencoded', 'Authorization: Bearer ' . $accessToken)
);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);

$response = curl_exec($ch);
$json = json_decode($response);

if($json->success){
    var_dump($json->data);
}

curl_close($ch);
```

{% endtab %}

{% tab title="Curl" %}

```
curl --GET \
--data-urlencode 'tags=["<TAG1>","<TAG2>"]' \
https://public-api.expertfile.com/v2/spotlight/:corporation/search \
-H "Content-Type: application/json" \
-H "Authorization: Bearer <ACCESS CODE>"
```

{% endtab %}
{% endtabs %}


# Individual Q\&A

{% hint style="info" %}
Please note that in all urls & code samples you'll need to replace`:id` and `:corporation` with appropriate values
{% endhint %}

## Get Individual Answer

<mark style="color:green;">`GET`</mark> [**/v2/qanda/:corporation/:id**](https://public-api.expertfile.com/v2/qanda/:corporation/:id)

**Headers**

| Name          | Value              |
| ------------- | ------------------ |
| Content-Type  | `application/json` |
| Authorization | `Bearer <token>`   |

**Url**

<table><thead><tr><th width="339.3333333333333">Name</th><th>Type</th><th>Description</th></tr></thead><tbody><tr><td>corporation</td><td>number</td><td>Corporation ID</td></tr><tr><td>id</td><td>number</td><td>Unique question id</td></tr></tbody></table>

**Response**

{% tabs %}
{% tab title="200" %}

```json
 {
  data: {
    question: [],
    tags: [],
    seo: []
  },
  success: true
}
```

{% endtab %}
{% endtabs %}

Code

{% tabs %}
{% tab title="Node" %}

```javascript
const accessToken = `<ACCESS TOKEN>`

fetch('https://public-api.expertfile.com/v2/qanda/:corporation/:id', {
    method: 'GET',
    headers: {
        'Content-Type': 'application/x-www-form-urlencoded',
        'Authorization': `Bearer ${accessToken}`
    }
})
.then(response => response.json())
.then(json => {
    const { success, data } = json

    if (success) {
        const { question, tags, seo } = data;
        console.log('question', question)
    }

})
.catch(error => console.error(error));
```

{% endtab %}

{% tab title="PHP" %}

```php
$accessToken = urlencode('<ACCESS TOKEN>');
$url = 'https://public-api.expertfile.com/v2/qanda/:corporation/:id';

$ch = curl_init($url);
curl_setopt(
    $ch,
    CURLOPT_HTTPHEADER,
    array('Content-Type: application/x-www-form-urlencoded', 'Authorization: Bearer ' . $accessToken)
);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);

$response = curl_exec($ch);
$json = json_decode($response);

if($json->success){
    var_dump($json->data);
}

curl_close($ch);
```

{% endtab %}

{% tab title="Curl" %}

```
curl https://public-api.expertfile.com/v2/qanda/:corporation/:id
    -H "Content-Type: application/json" \
    -H "Authorization: Bearer <ACCESS TOKEN>"
```

{% endtab %}
{% endtabs %}


# Embeds

Our **Embed Builder** is the fastest way to customize and implement your expert content assets, from searchable directories to profiles, posts and more.  You can use the builder once you're logged in to the dashboard, but if you'd like a more detailed reference of the parameters available to you, check out the following embed docs.  Embeds should be used in conjunction with the API for enhanced [SEO](/reference/api-reference/experts/expert-profile/seo-meta-data).

<figure><img src="https://1291996600-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FJl8SkdXXTR0rcda2A45A%2Fuploads%2F7JFsSExdstyQmImYt4UB%2FScreenshot%202024-05-06%20at%202.04.45%20PM.png?alt=media&amp;token=29d27f5b-3dc7-47dd-a3a4-ab771037c475" alt=""><figcaption></figcaption></figure>

The best way to generate your ExpertFile embeds is to use the "Embed Builder" found [here](https://expertfile.com/dashboard/builder) in the dashboard. By using the builder you'll be able to quickly configure the look-and-feel and get all the html + javascript code you'll need to get your page setup.

If you'd like to see the parameters available for each embed type, they can be found here:

{% content-ref url="/pages/V8UtkkSL8kWPoADCVw5q" %}
[Expert Directory/Search](/reference/embeds/expert-directory-search)
{% endcontent-ref %}

{% content-ref url="/pages/mnTT2LzE7Ww0wlVJCjhl" %}
[Expert & Staff Profiles](/reference/embeds/expert-and-staff-profiles)
{% endcontent-ref %}

{% content-ref url="/pages/jQrPu6JVxdfbu4HtxwYZ" %}
[Inquiries](/reference/embeds/inquiries)
{% endcontent-ref %}

{% content-ref url="/pages/1BFMfPW9kNQC45qbV8px" %}
[Featured Experts](/reference/embeds/featured-experts)
{% endcontent-ref %}

{% content-ref url="/pages/raN5ADtlVa4stYqEtK1v" %}
[Post Listings/Search](/reference/embeds/post-listings-search)
{% endcontent-ref %}

{% content-ref url="/pages/CHLhtq76RDQFAJSJ2Zx7" %}
[Full Post](/reference/embeds/full-post)
{% endcontent-ref %}

{% content-ref url="/pages/8bnI7m3TtsTIYvwkThjI" %}
[Q\&A Listings/Search](/reference/embeds/q-and-a-listings-search)
{% endcontent-ref %}

{% content-ref url="/pages/5VCpe4zAa1DRyzRNKFgk" %}
[Individual Q\&A](/reference/embeds/individual-q-and-a)
{% endcontent-ref %}


# Expert Directory/Search

## Parameters

<table><thead><tr><th width="339.3333333333333">Name</th><th>Description</th></tr></thead><tbody><tr><td>topic</td><td>Comma-delimited Topics(i.e. Topic1,Topic2)</td></tr><tr><td>category</td><td>Comma-delimited Categories(i.e. Cat1,Cat2)</td></tr><tr><td>tag</td><td>Comma-delimited Tags(i.e. Tag1,Tag2)</td></tr><tr><td>alphabet</td><td>Filter by letter on last name</td></tr><tr><td>page_size</td><td>Page size</td></tr><tr><td>page_number</td><td>Page number</td></tr><tr><td>keyword</td><td>Keyword search</td></tr><tr><td>channel</td><td>Unique ID used to set iframe height(must match with parameter value in JS code)</td></tr><tr><td>url_override</td><td>Used to change expert profile url location</td></tr><tr><td>access</td><td>Access state(i.e. public/private/all)</td></tr><tr><td>layout</td><td>Layout style(i.e. list/grid)</td></tr><tr><td>sort</td><td>Sort type(i.e. name/featured)</td></tr><tr><td>order</td><td>Sort order(i.e. asc/desc)</td></tr><tr><td>hide_search_bar</td><td>Hide the main search bar(yes/no)</td></tr><tr><td>hide_search_category</td><td>Hide category filter(yes/no)</td></tr><tr><td>hide_search_sort</td><td>Hide sort dropdown(yes/no)</td></tr><tr><td>open_tab</td><td>Open links in new tab(yes/no)</td></tr><tr><td>powered_by</td><td>Show ExpertFile logo(yes/no)</td></tr><tr><td>avatar</td><td>Avatar style(circle/square)</td></tr><tr><td>user_type</td><td>User types(experts/employee/all)</td></tr><tr><td>search_placeholder</td><td>Override searhbar placeholder text</td></tr><tr><td>content</td><td>Content to show in listing(title,organization,headline,expertise,phone_number,email)</td></tr><tr><td>filters</td><td>Set which filters to display</td></tr><tr><td>url_color</td><td>url color</td></tr><tr><td>primary_action_button_color</td><td>button color</td></tr><tr><td>max_topic</td><td>Max topics to show in search result</td></tr></tbody></table>


# Expert & Staff Profiles

## Parameters

<table><thead><tr><th width="339.3333333333333">Name</th><th>Description</th></tr></thead><tbody><tr><td>channel</td><td>Unique ID used to set iframe height(must match with parameter value in JS code)</td></tr><tr><td>url_override</td><td>Used to change inquiry url location</td></tr><tr><td>open_tab</td><td>Open links in new tab(yes/no)</td></tr><tr><td>powered_by</td><td>Show ExpertFile logo(yes/no)</td></tr><tr><td>avatar</td><td>Avatar style(circle/square)</td></tr><tr><td>content</td><td>Content to show in listing(organization,location,phone_number,email)</td></tr><tr><td>url_color</td><td>url color</td></tr><tr><td>primary_action_button_color</td><td>button color</td></tr><tr><td>contact_button_text</td><td>Override contact button text</td></tr><tr><td>show_share_button</td><td>Show share controls(yes/no)</td></tr><tr><td>show_pdf_download</td><td>Show download pdf(yes/no)</td></tr><tr><td>show_contact_button</td><td>Show contact button(yes/no)</td></tr></tbody></table>


# Adding Profile Meta Data

The following API calls are required in order to add dynamic meta data including schema data to individual profile pages using key profile fields.

**Authentication Step Required**: Before employing the specific SEO endpoints per piece of expert content below, please ensure you have already authenticated your organization. Details can be found here

{% hint style="info" %}
Please note that in all urls & code samples you'll need to replace`:username` and `:corporation` with appropriate values
{% endhint %}

## Get Profile Meta Data

<mark style="color:green;">`GET`</mark> [**/v2/organization/:corporation/expert/:username/seo**](https://public-api.expertfile.com/v2/organization/:corporation/expert/:username/seo)

**Headers**

| Name          | Value              |
| ------------- | ------------------ |
| Content-Type  | `application/json` |
| Authorization | `Bearer <token>`   |

**Url**

<table><thead><tr><th width="339.3333333333333">Name</th><th>Type</th><th>Description</th></tr></thead><tbody><tr><td>corporation</td><td>number</td><td>Corporation ID</td></tr><tr><td>username</td><td>string</td><td>Unique username</td></tr></tbody></table>

**Response**

{% tabs %}
{% tab title="200" %}

```json
 {
  data: [
    {
      title: '',
      description: '',
      keywords: '',
      canonical: '',
      schema: ''
    }
  ],
  success: true
}
```

{% endtab %}
{% endtabs %}

Code

{% tabs %}
{% tab title="Node" %}

```javascript
const accessToken = `<ACCESS TOKEN>`

fetch('https://public-api.expertfile.com/v2/organization/:corporation/expert/:username/seo', {
    method: 'GET',
    headers: {
        'Content-Type': 'application/x-www-form-urlencoded',
        'Authorization': `Bearer ${accessToken}`
    }
})
.then(response => response.json())
.then(json => {
    const { success, data } = json

    if (success) {
        const seo = data[0]
        console.log('seo', seo)
    }

})
.catch(error => console.error(error));
```

{% endtab %}

{% tab title="PHP" %}

```php
$accessToken = urlencode('<ACCESS TOKEN>');
$url = 'https://public-api.expertfile.com/v2/organization/:corporation/expert/:username/seo';

$ch = curl_init($url);
curl_setopt(
    $ch,
    CURLOPT_HTTPHEADER,
    array('Content-Type: application/x-www-form-urlencoded', 'Authorization: Bearer ' . $accessToken)
);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);

$response = curl_exec($ch);
$json = json_decode($response);

if($json->success){
    var_dump($json->data);
}

curl_close($ch);
```

{% endtab %}

{% tab title="Curl" %}

```
curl https://public-api.expertfile.com/v2/organization/:corporation/expert/:username/seo \
    -H "Content-Type: application/json" \
    -H "Authorization: Bearer <ACCESS TOKEN>"

```

{% endtab %}
{% endtabs %}


# Featured Experts

## Parameters

<table><thead><tr><th width="339.3333333333333">Name</th><th>Description</th></tr></thead><tbody><tr><td>channel</td><td>Unique ID used to set iframe height(must match with parameter value in JS code)</td></tr><tr><td>url_override</td><td>Used to change inquiry url location</td></tr><tr><td>open_tab</td><td>Open links in new tab(yes/no)</td></tr><tr><td>powered_by</td><td>Show ExpertFile logo(yes/no)</td></tr><tr><td>avatar</td><td>Avatar style(circle/square)</td></tr><tr><td>url_color</td><td>url color</td></tr><tr><td>primary_action_button_color</td><td>button color</td></tr></tbody></table>


# Inquiries

## Parameters

<table><thead><tr><th width="339.3333333333333">Name</th><th>Description</th></tr></thead><tbody><tr><td>channel</td><td>Unique ID used to set iframe height(must match with parameter value in JS code)</td></tr><tr><td>url_override</td><td>Used to change inquiry url location</td></tr><tr><td>open_tab</td><td>Open links in new tab(yes/no)</td></tr><tr><td>powered_by</td><td>Show ExpertFile logo(yes/no)</td></tr><tr><td>avatar</td><td>Avatar style(circle/square)</td></tr><tr><td>url_color</td><td>url color</td></tr><tr><td>primary_action_button_color</td><td>button color</td></tr><tr><td>preferences</td><td>Override inquiry types</td></tr></tbody></table>


# Post Listings/Search

## Parameters

<table><thead><tr><th width="339.3333333333333">Name</th><th>Description</th></tr></thead><tbody><tr><td>channel</td><td>Unique ID used to set iframe height(must match with parameter value in JS code)</td></tr><tr><td>url_override</td><td>Used to change inquiry url location</td></tr><tr><td>open_tab</td><td>Open links in new tab(yes/no)</td></tr><tr><td>powered_by</td><td>Show ExpertFile logo(yes/no)</td></tr><tr><td>avatar</td><td>Avatar style(circle/square)</td></tr><tr><td>url_color</td><td>url color</td></tr><tr><td>primary_action_button_color</td><td>button color</td></tr><tr><td>filters</td><td>Set which filters to display</td></tr><tr><td>year</td><td>filter result by year</td></tr><tr><td>tag</td><td>Comma-delimited Tags(i.e. Tag1,Tag2)</td></tr><tr><td>tagged</td><td>Comma-delimited Usernames(i.e. Username1,Username2)</td></tr><tr><td>keyword</td><td>Keyword search</td></tr><tr><td>num_post</td><td>Number of posts to display. "Show more" will be hidden</td></tr><tr><td>page_size</td><td>Page size</td></tr><tr><td>page_from</td><td>Page starting</td></tr><tr><td>hide_published_date</td><td>Show published date(yes/no)</td></tr><tr><td>hide_reading_time</td><td>Show reading time(yes/no)</td></tr></tbody></table>


# Full Post

## Parameters

<table><thead><tr><th width="339.3333333333333">Name</th><th>Description</th></tr></thead><tbody><tr><td>channel</td><td>Unique ID used to set iframe height(must match with parameter value in JS code)</td></tr><tr><td>url_override</td><td>Used to change inquiry url location</td></tr><tr><td>open_tab</td><td>Open links in new tab(yes/no)</td></tr><tr><td>powered_by</td><td>Show ExpertFile logo(yes/no)</td></tr><tr><td>avatar</td><td>Avatar style(circle/square)</td></tr><tr><td>url_color</td><td>url color</td></tr><tr><td>primary_action_button_color</td><td>button color</td></tr><tr><td>hide_published_date</td><td>Show published date(yes/no)</td></tr><tr><td>hide_reading_time</td><td>Show reading time(yes/no)</td></tr><tr><td>show_share</td><td>Show share controls(yes/no)</td></tr></tbody></table>


# Adding Post Meta Data

The following API calls are required in order to add dynamic meta data including schema data to individual full post pages using post title and related data.

**Authentication Step Required**: Before employing the specific SEO endpoints per piece of expert content below, please ensure you have already authenticated your organization. Details can be found here

{% hint style="info" %}
Please note that in all urls & code samples you'll need to replace`:id` and `:corporation` with appropriate values
{% endhint %}

: Before employing the specific SEO endpoints per piece of expert content below, please ensure you have already authenticated your organization. Details can be found here

## Get Post Meta Data

<mark style="color:green;">`GET`</mark>[ **/v2/spotlight/:corporation/:id**](https://public-api.expertfile.com/v2/spotlight/:corporation/:id)

**Headers**

| Name          | Value              |
| ------------- | ------------------ |
| Content-Type  | `application/json` |
| Authorization | `Bearer <token>`   |

**Url**

<table><thead><tr><th width="339.3333333333333">Name</th><th>Type</th><th>Description</th></tr></thead><tbody><tr><td>corporation</td><td>number</td><td>Corporation ID</td></tr><tr><td>id</td><td>number</td><td>Unique post id</td></tr></tbody></table>

**Response**

{% tabs %}
{% tab title="200" %}

```json
 {
  data: {
    spotlight: [],
    tags: [],
    seo: []
  },
  success: true
}
```

{% endtab %}
{% endtabs %}

Code

{% tabs %}
{% tab title="Node" %}

```javascript
const accessToken = `<ACCESS TOKEN>`

fetch('https://public-api.expertfile.com/v2/spotlight/:corporation/:id', {
    method: 'GET',
    headers: {
        'Content-Type': 'application/x-www-form-urlencoded',
        'Authorization': `Bearer ${accessToken}`
    }
})
.then(response => response.json())
.then(json => {
    const { success, data } = json

    if (success) {
        const { spotlight, tags, seo } = data;
        console.log('post', spotlight)
    }

})
.catch(error => console.error(error));
```

{% endtab %}

{% tab title="PHP" %}

```php
$accessToken = urlencode('<ACCESS TOKEN>');
$url = 'https://public-api.expertfile.com/v2/spotlight/:corporation/:id';

$ch = curl_init($url);
curl_setopt(
    $ch,
    CURLOPT_HTTPHEADER,
    array('Content-Type: application/x-www-form-urlencoded', 'Authorization: Bearer ' . $accessToken)
);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);

$response = curl_exec($ch);
$json = json_decode($response);

if($json->success){
    var_dump($json->data);
}

curl_close($ch);
```

{% endtab %}

{% tab title="Curl" %}

```
curl https://public-api.expertfile.com/v2/spotlight/:corporation/:id
    -H "Content-Type: application/json" \
    -H "Authorization: Bearer <ACCESS TOKEN>"
```

{% endtab %}
{% endtabs %}


# Q\&A Listings/Search

## Parameters

<table><thead><tr><th width="339.3333333333333">Name</th><th>Description</th></tr></thead><tbody><tr><td>channel</td><td>Unique ID used to set iframe height(must match with parameter value in JS code)</td></tr><tr><td>url_override</td><td>Used to change inquiry url location</td></tr><tr><td>open_tab</td><td>Open links in new tab(yes/no)</td></tr><tr><td>powered_by</td><td>Show ExpertFile logo(yes/no)</td></tr><tr><td>avatar</td><td>Avatar style(circle/square)</td></tr><tr><td>url_color</td><td>url color</td></tr><tr><td>tag</td><td>Comma-delimited Tags(i.e. Tag1,Tag2)</td></tr><tr><td>num_post</td><td>Number of posts to display. "Show more" will be hidden</td></tr></tbody></table>


# Individual Q\&A

## Parameters

<table><thead><tr><th width="339.3333333333333">Name</th><th>Description</th></tr></thead><tbody><tr><td>channel</td><td>Unique ID used to set iframe height(must match with parameter value in JS code)</td></tr><tr><td>url_override</td><td>Used to change inquiry url location</td></tr><tr><td>open_tab</td><td>Open links in new tab(yes/no)</td></tr><tr><td>powered_by</td><td>Show ExpertFile logo(yes/no)</td></tr><tr><td>avatar</td><td>Avatar style(circle/square)</td></tr><tr><td>url_color</td><td>url color</td></tr><tr><td>primary_action_button_color</td><td>button color</td></tr><tr><td>show_share</td><td>Override inquiry types</td></tr></tbody></table>


# Adding Q\&A Meta Data

The following API calls are required in order to add dynamic meta data including schema data to individual Q\&A pages using question and answer details.

**Authentication Step Required**: Before employing the specific SEO endpoints per piece of expert content below, please ensure you have already authenticated your organization. Details can be found here

{% hint style="info" %}
Please note that in all urls & code samples you'll need to replace`:id` and `:corporation` with appropriate values
{% endhint %}

## Get Q\&A Meta Data

<mark style="color:green;">`GET`</mark> [**/v2/qanda/:corporation/:id**](https://public-api.expertfile.com/v2/qanda/:corporation/:id)

**Headers**

| Name          | Value              |
| ------------- | ------------------ |
| Content-Type  | `application/json` |
| Authorization | `Bearer <token>`   |

**Url**

<table><thead><tr><th width="339.3333333333333">Name</th><th>Type</th><th>Description</th></tr></thead><tbody><tr><td>corporation</td><td>number</td><td>Corporation ID</td></tr><tr><td>id</td><td>number</td><td>Unique question id</td></tr></tbody></table>

**Response**

{% tabs %}
{% tab title="200" %}

```json
 {
  data: {
    question: [],
    tags: [],
    seo: []
  },
  success: true
}
```

{% endtab %}
{% endtabs %}

Code

{% tabs %}
{% tab title="Node" %}

```javascript
const accessToken = `<ACCESS TOKEN>`

fetch('https://public-api.expertfile.com/v2/qanda/:corporation/:id', {
    method: 'GET',
    headers: {
        'Content-Type': 'application/x-www-form-urlencoded',
        'Authorization': `Bearer ${accessToken}`
    }
})
.then(response => response.json())
.then(json => {
    const { success, data } = json

    if (success) {
        const { question, tags, seo } = data;
        console.log('question', question)
    }

})
.catch(error => console.error(error));
```

{% endtab %}

{% tab title="PHP" %}

```php
$accessToken = urlencode('<ACCESS TOKEN>');
$url = 'https://public-api.expertfile.com/v2/qanda/:corporation/:id';

$ch = curl_init($url);
curl_setopt(
    $ch,
    CURLOPT_HTTPHEADER,
    array('Content-Type: application/x-www-form-urlencoded', 'Authorization: Bearer ' . $accessToken)
);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);

$response = curl_exec($ch);
$json = json_decode($response);

if($json->success){
    var_dump($json->data);
}

curl_close($ch);
```

{% endtab %}

{% tab title="Curl" %}

```
curl https://public-api.expertfile.com/v2/qanda/:corporation/:id
    -H "Content-Type: application/json" \
    -H "Authorization: Bearer <ACCESS TOKEN>"
```

{% endtab %}
{% endtabs %}


# Adding Meta Data to Embeds

When creating integration using our Embed Builder or through a fully customized API integration it is critical to add the appropriate meta data so that you maximize SEO discoverable to Google.

**Authentication Step Required:**  Before employing the specific SEO endpoints per piece of expert content below, please ensure you have already authenticated your organization.  Details can be found [here](/reference/api-reference/authentication).<br>

### Expert Profiles

Add dynamic meta data including schema data to expert profile pages using key elements of each profile.

{% content-ref url="/pages/E4BbTfBZf4PYNnudy2oM" %}
[SEO/Meta Data](/reference/api-reference/experts/expert-profile/seo-meta-data)
{% endcontent-ref %}

### Full Posts (Spotlights)

Add dynamic meta data including schema data to individual full post pages using post title and related data.&#x20;

{% content-ref url="/pages/chgY23sKKK8ICGX0LKxX" %}
[Adding Post Meta Data](/reference/embeds/full-post/adding-post-meta-data)
{% endcontent-ref %}

### Q\&A (Answers)

Add dynamic meta data including schema data to individual individual Q\&A pages using question and answer related data.

{% content-ref url="/pages/s0HqJvdaCDi0QlO7rRjH" %}
[Adding Q\&A Meta Data](/reference/embeds/individual-q-and-a/adding-q-and-a-meta-data)
{% endcontent-ref %}


# WordPress

## Overview

The ExpertFile WordPress plugin provides ExpertFile users the easiest, SEO-friendly way to quickly add your experts and their valuable content to any website. For current non-WordPress users, firing up a WordPress instance provides you a quick option when looking to create a microsite for your expert content outside your core CMS. Once installed, you can control your content updates from your ExpertFile dashboard with your changes automatically reflected on your website, all without having to log back into WordPress.

#### Display all your important Expert Content elements from profiles to posts.

Your expert content can be added as part of a “new” purpose-specific page such as an “Expert Directory” or as a component of a current page such as your homepage or newsroom section of your website. All your expert related content is available to be added which includes:

* Expert Directories
* Expert Profiles
* Inquiry Forms
* Feature Expert Callouts
* Spotlights (News Posts)
* ExpertAnswers (Q\&A)

**Get started quickly without the need for complex IT support.**

The following are the basic steps for adding your ExpertFile content to your WordPress pages or posts.

1. Create a new page for your website or determine the current page you’d like to add the content to.
2. Open the "Settings" tab to add your ExpertFile organization credentials and new URLs created.
3. Access the HTML code for the page or add an HTML element/container to the page using your editor.
4. Copy the shortcode text (eg \[expertfile-directory]) from the "Shortcodes" tab and paste it onto the page/post.
5. Hit Save & Publish when ready.

## Settings

**Connecting your ExpertFile account and accessing your data is simple.**

Access your Expertfile dashboard at expertfile.com/login and locate your credentials in the “API” area of the “Settings” section. Once applied, your credentials provide access to all your expert content. Don’t have access to the ExpertFile platform? Contact your organization’s admin.<br>

<figure><img src="https://1291996600-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FJl8SkdXXTR0rcda2A45A%2Fuploads%2FvYcfE93VDWXLrqyrMiSB%2FPageURL.webp?alt=media&amp;token=8414ccbc-03ff-4e1d-831f-6d7ef7f2286b" alt=""><figcaption></figcaption></figure>

**We take the work out of linking all your pages together.**

By adding the new page URLs you’ve created to the settings tab, ExpertFile is able to dynamically link various elements of your expert content together such as directory listings to profiles, profiles to inquiry forms, Spotlight listings to full Spotlight posts, and ExpertAnswers listings to individual questions with answer(s).

<figure><img src="https://1291996600-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FJl8SkdXXTR0rcda2A45A%2Fuploads%2FEZSLxeHpAWZqN00aHFCY%2FCredentials.webp?alt=media&amp;token=9baed468-a8e8-4e19-9fa4-6d9aa2ed6927" alt=""><figcaption></figcaption></figure>


# Expert Directory/Search

```
// Shortcode

[expertfile-expert-directory]
```

## Parameters

<table><thead><tr><th width="339.3333333333333">Name</th><th>Description</th></tr></thead><tbody><tr><td>page_size</td><td>Page size</td></tr><tr><td>page_number</td><td>Page number</td></tr><tr><td>tags</td><td>Filter by tags(comma-delimited)</td></tr><tr><td>categories</td><td>Filter by categories(comma-delimited)</td></tr><tr><td>topics</td><td>Filter by topics(comma-delimited)</td></tr><tr><td>profile_page_url</td><td>Override location for profile page</td></tr><tr><td>sort</td><td>Sort order(name/featured)</td></tr><tr><td>show_search</td><td>Hide searchbar(true/false)</td></tr><tr><td>show_sort</td><td>Hide sorting(true/false)</td></tr><tr><td>filter</td><td>Enable or disable filters(topic,category,alphabet)</td></tr><tr><td>filter_show</td><td>Set number of filter items to display before "show more" appears</td></tr><tr><td>search_result_topic_max</td><td>Set number of topics shown in search result</td></tr><tr><td>searchbox_placeholder</td><td>Set search box placeholder text</td></tr><tr><td>show_powered_by</td><td>Display Powered by ExpertFile logo(true/false)</td></tr><tr><td>search_term_sort</td><td>Set sorting options when keyword search has been executed</td></tr><tr><td>filter_label_category</td><td>Set category filter label</td></tr><tr><td>filter_label_topic</td><td>Set top topics filter label</td></tr><tr><td>filter_label_alphabet</td><td>Set alphabet filter label</td></tr></tbody></table>


# Expert & Staff Profiles

```
// Shortcode

[expertfile-expert-profile]
```

## Parameters

<table><thead><tr><th width="339.3333333333333">Name</th><th>Description</th></tr></thead><tbody><tr><td>show_email</td><td>Hide email(true/false)</td></tr><tr><td>show_phone</td><td>Hide phone number(true/false)</td></tr><tr><td>show_organization</td><td>Hide organization name(true/false)</td></tr><tr><td>show_contact_button</td><td>Hide contact button(true/false)</td></tr><tr><td>show</td><td>Items to show in each content section</td></tr><tr><td>inquiry_page_url</td><td>Override location for profile page</td></tr><tr><td>spotlight_page_url</td><td>Override location for spotlight page</td></tr><tr><td>expertanswer_page_url</td><td>Override location for ExpertAnswer page</td></tr><tr><td>show_share_button</td><td>Hide share component(true/false)</td></tr><tr><td>show_pdf_download</td><td>Hide pdf button(true/false)</td></tr><tr><td>show_powered_by</td><td>Display Powered by ExpertFile logo(true/false)</td></tr></tbody></table>


# Featured Experts

```
// Shortcode

[expertfile-expert-featured]
```

## Parameters

<table><thead><tr><th width="339.3333333333333">Name</th><th>Description</th></tr></thead><tbody><tr><td>page_size</td><td>Page size</td></tr><tr><td>page_number</td><td>Page number</td></tr><tr><td>tags</td><td>Filter by tags(comma-delimited)</td></tr><tr><td>profile_page_url</td><td>Override location for profile page</td></tr><tr><td>sort</td><td>Sort order(name/featured)</td></tr><tr><td>categories</td><td>Filter by categories(comma-delimited)</td></tr><tr><td>show_powered_by</td><td>Display Powered by ExpertFile logo(true/false)</td></tr></tbody></table>


# Inquiries

```
// Shortcode

[expertfile-expert-inquiry]
```

## Parameters

<table><thead><tr><th width="339.3333333333333">Name</th><th>Description</th></tr></thead><tbody><tr><td>profile_page_url</td><td>Override location for profile page</td></tr><tr><td>show_powered_by</td><td>Display Powered by ExpertFile logo(true/false)</td></tr></tbody></table>


# Q\&A Listings/Search

```
// Shortcode

[expertfile-expertanswer-list]
```

## Parameters

<table><thead><tr><th width="339.3333333333333">Name</th><th>Description</th></tr></thead><tbody><tr><td>page_size</td><td>Page size</td></tr><tr><td>page_number</td><td>Page number</td></tr><tr><td>tags</td><td>Filter by tags(comma-delimited)</td></tr><tr><td>expertanswer_page_url</td><td>Override location for answer page</td></tr><tr><td>show_more</td><td>Show more button(true/false)</td></tr><tr><td>show_powered_by</td><td>Display Powered by ExpertFile logo(true/false)</td></tr></tbody></table>


# Individual Q\&A

```
// Shortcode

[expertfile-expertanswer-question]
```

## Parameters

<table><thead><tr><th width="339.3333333333333">Name</th><th>Description</th></tr></thead><tbody><tr><td>show_share_button</td><td>Show share component(true/false)</td></tr><tr><td>profile_page_url</td><td>Override location for profile page</td></tr><tr><td>show_powered_by</td><td>Display Powered by ExpertFile logo(true/false)</td></tr></tbody></table>


# Post Listings/Search

```
// Shortcode

[expertfile-spotlight-list]
```

## Parameters

<table><thead><tr><th width="339.3333333333333">Name</th><th>Description</th></tr></thead><tbody><tr><td>page_size</td><td>Page size</td></tr><tr><td>page_number</td><td>Page number</td></tr><tr><td>tags</td><td>Filter by tags(comma-delimited)</td></tr><tr><td>post_page_url</td><td>Override location for post page</td></tr><tr><td>show_powered_by</td><td>Display Powered by ExpertFile logo(true/false)</td></tr><tr><td>show_more</td><td>Show more button(true/false)</td></tr></tbody></table>


# Full Post

```
// Shortcode

[expertfile-spotlight-post]
```

## Parameters

<table><thead><tr><th width="339.3333333333333">Name</th><th>Description</th></tr></thead><tbody><tr><td>profile_page_url</td><td>Override location for profile page</td></tr><tr><td>show_powered_by</td><td>Display Powered by ExpertFile logo(true/false)</td></tr></tbody></table>


# CNAME

### Set up your custom domain (CNAME)

You can use your own subdomain (like `experts.yourcompany.com`) to access your ExpertFile content. Setting this up only takes a few minutes.

#### Step 1: Choose your subdomain

Enter the **subdomain** you want to use in the field below.

**Examples:**

* `experts.yourcompany.com`
* `insights.yourcompany.com`
* `newsroom.yourcompany.com`

<figure><img src="https://1291996600-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FJl8SkdXXTR0rcda2A45A%2Fuploads%2FCbyGC1VuZQ9BMGl65RPC%2FScreenshot%202025-12-26%20at%202.03.37%E2%80%AFPM.png?alt=media&amp;token=daa355ef-147e-4c84-8a13-06a373d29b7b" alt=""><figcaption></figcaption></figure>

> ⚠️ Note: You must use a **subdomain**. Root domains (like `yourcompany.com`) are not supported.

#### Step 2: Update your DNS settings

Log in to your DNS provider (such as GoDaddy, Cloudflare, Namecheap, or your hosting provider) and create a new **CNAME record**.

Use the following values:

| Setting            | Value                                 |
| ------------------ | ------------------------------------- |
| **Type**           | CNAME                                 |
| **Host / Name**    | Your chosen subdomain (e.g. `expert`) |
| **Target / Value** | `greenlock.expertfile.com`            |
| **TTL**            | Default or Auto                       |

Save your changes.

***

#### Step 3: Wait for DNS to propagate

DNS changes can take anywhere from a few minutes up to 24 hours to fully propagate, depending on your provider.

Once propagation is complete, your custom domain will automatically become active and secured with HTTPS.

***

#### Need help?

If you’re unsure where to add a CNAME record, check your DNS provider’s help docs or contact our support team—we’re happy to help you get set up.


# Tracking Code (Analytics)

Please apply the following analytics tracking code to the head section of your webpages for accurate, anonymous tracking of page views for all API generated pages.

Please apply the following analytics tracking code to the head section of your webpages for accurate, anonymous tracking of page views for all API generated pages.

## Directory

Record analytics for your organizations’ directory endpoint.`corporate_username` value is a string and should be dynamically written from the API response as it can change.

```javascript
<script src="//d2mo5pjlwftw8w.cloudfront.net/analytics/analytic.ly.min.v1.0.2.js"></script>
<script type="text/javascript">
analyticly.track({
    asset_type : analyticly.TYPES.DIRECTORY,
    corporate_username : <CORPORATE_USERNAME>
});
</script>
```

## Expert/Staff

Record analytics for your organizations’ expert/staff endpoint. `corporate_username/expert/staff` username value is a string and should be dynamically written from the API response as it can change.

```javascript
<script src="//d2mo5pjlwftw8w.cloudfront.net/analytics/analytic.ly.min.v1.0.2.js"></script>
<script type="text/javascript">
analyticly.track({
    asset_type : analyticly.TYPES.USER,
    corporate_username : <CORPORATE_USERNAME>
    attr : {
        username : <USERNAME>
    } 
});
</script>
```

## Posts Listing

Record analytics for your organizations’ spotlight search endpoint. `corporate_username` value is a string and should be dynamically written from the API response as it can change.

```javascript
<script src="//d2mo5pjlwftw8w.cloudfront.net/analytics/analytic.ly.min.v1.0.2.js"></script>
<script type="text/javascript">
analyticly.track({
   asset_type : analyticly.TYPES.SPOTLIGHT,
   corporate_username : <CORPORATE_USERNAME>
});
</script>
```

## Full Post

Record analytics for your organizations’ spotlight post endpoint. `corporate_username` is a string and should be dynamically written from the API response as it can change. Same goes for spotlight post value.

```javascript
<script src="//d2mo5pjlwftw8w.cloudfront.net/analytics/analytic.ly.min.v1.0.2.js"></script>
<script type="text/javascript">
analyticly.track({
    asset_type : analyticly.TYPES.SPOTLIGHT,
    corporate_username : <CORPORATE_USERNAME>,
    attr : {
        post_id : <POST_ID>
    } 
});
</script>
```

## Q\&A Listing

Record analytics for your organizations’ questions search endpoint. `corporate_username` value is a string and should be dynamically written from the API response as it can change.

```javascript
<script src="//d2mo5pjlwftw8w.cloudfront.net/analytics/analytic.ly.min.v1.0.2.js"></script>
<script type="text/javascript">
analyticly.track({
   asset_type : analyticly.TYPES.SPOTLIGHT,
   corporate_username : <CORPORATE_USERNAME>
});
</script>
```

## Q\&A Posts

Record analytics for your organizations’ question endpoint. `corporate_username` is a string and should be dynamically written from the API response as it can change. Same goes for question value.

```javascript
<script src="//d2mo5pjlwftw8w.cloudfront.net/analytics/analytic.ly.min.v1.0.2.js"></script>
<script type="text/javascript">
<script type="text/javascript">
analyticly.track({
   asset_type : analyticly.TYPES.QANDA,
   corporate_username : <CORPORATE_USERNAME>,
   attr : {
       question_id : <QUESTION_ID>
   } 
});
</script>
</script>
```


# Adding Meta Data for SEO

When creating integration using our Embed Builder or through a fully customized API integration it is critical to add the appropriate meta data so that you maximize SEO discoverable to Google.

**Authentication Step Required:**  Before employing the specific SEO endpoints per piece of expert content below, please ensure you have already authenticated your organization.  Details can be found [here](/reference/api-reference/authentication).<br>

### Expert Profiles

Add dynamic meta data including schema data to expert profile pages using key elements of each profile.

{% content-ref url="/pages/E4BbTfBZf4PYNnudy2oM" %}
[SEO/Meta Data](/reference/api-reference/experts/expert-profile/seo-meta-data)
{% endcontent-ref %}

### Full Posts (Spotlights)

Add dynamic meta data including schema data to individual full post pages using post title and related data.&#x20;

{% content-ref url="/pages/chgY23sKKK8ICGX0LKxX" %}
[Adding Post Meta Data](/reference/embeds/full-post/adding-post-meta-data)
{% endcontent-ref %}

### Q\&A (Answers)

Add dynamic meta data including schema data to individual individual Q\&A pages using question and answer related data.

{% content-ref url="/pages/s0HqJvdaCDi0QlO7rRjH" %}
[Adding Q\&A Meta Data](/reference/embeds/individual-q-and-a/adding-q-and-a-meta-data)
{% endcontent-ref %}


# Helpers

Here are the lists of valid values you can use as parameters for different endpoints.

## Return Fields

```javascript
//Fields
[
 "accomplishment",
 "accreditation",
 "address",
 "article",
 "avatar_large",
 "avatar_medium",
 "avatar_original",
 "avatar_small",
 "book",
 "building",
 "city",
 "company",
 "corporation_id",
 "corporation_logo",
 "corporation_name",
 "corporation_username",
 "country",
 "course",
 "department",
 "description",
 "email",
 "event_appearance",
 "firstname",
 "fullname",
 "industry",
 "jobtitle",
 "lastname",
 "media_appearance",
 "patent",
 "phone_number",
 "phone_number_extension",
 "postal",
 "research_focus",
 "research_grant",
 "room",
 "slideshare",
 "spotlight",
 "state",
 "tagline",
 "talk",
 "testimonial",
 "topic",
 "username",
 "vimeo",
 "youtube"
 ]
```

## Country Codes

```javascript
// Country codes
{
  US : "UNITED STATES",
  CA : "CANADA",
  AF : "AFGHANISTAN",
  AL : "ALBANIA",
  DZ : "ALGERIA",
  AS : "AMERICAN SAMOA",
  AD : "ANDORRA",
  AO : "ANGOLA",
  AI : "ANGUILLA",
  AQ : "ANTARCTICA",
  AG : "ANTIGUA AND BARBUDA",
  AR : "ARGENTINA",
  AM : "ARMENIA",
  AW : "ARUBA",
  AU : "AUSTRALIA",
  AT : "AUSTRIA",
  AZ : "AZERBAIJAN",
  BS : "BAHAMAS",
  BH : "BAHRAIN",
  BD : "BANGLADESH",
  BB : "BARBADOS",
  BY : "BELARUS",
  BE : "BELGIUM",
  BZ : "BELIZE",
  BJ : "BENIN",
  BM : "BERMUDA",
  BT : "BHUTAN",
  BO : "BOLIVIA",
  BA : "BOSNIA AND HERZEGOVINA",
  BW : "BOTSWANA",
  BV : "BOUVET ISLAND",
  BR : "BRAZIL",
  IO : "BRITISH INDIAN OCEAN TERRITORY",
  BN : "BRUNEI DARUSSALAM",
  BG : "BULGARIA",
  BF : "BURKINA FASO",
  BI : "BURUNDI",
  KH : "CAMBODIA",
  CM : "CAMEROON",
  CV : "CAPE VERDE",
  KY : "CAYMAN ISLANDS",
  CF : "CENTRAL AFRICAN REPUBLIC",
  TD : "CHAD",
  CL : "CHILE",
  CN : "CHINA",
  CX : "CHRISTMAS ISLAND",
  CC : "COCOS (KEELING) ISLANDS",
  CO : "COLOMBIA",
  KM : "COMOROS",
  CG : "CONGO",
  CD : "CONGO, THE DEMOCRATIC REPUBLIC OF THE",
  CK : "COOK ISLANDS",
  CR : "COSTA RICA",
  CI : "COTE D IVOIRE",
  HR : "CROATIA",
  CU : "CUBA",
  CY : "CYPRUS",
  CZ : "CZECH REPUBLIC",
  DK : "DENMARK",
  DJ : "DJIBOUTI",
  DM : "DOMINICA",
  DO : "DOMINICAN REPUBLIC",
  TP : "EAST TIMOR",
  EC : "ECUADOR",
  EG : "EGYPT",
  SV : "EL SALVADOR",
  GQ : "EQUATORIAL GUINEA",
  ER : "ERITREA",
  EE : "ESTONIA",
  ET : "ETHIOPIA",
  FK : "FALKLAND ISLANDS (MALVINAS)",
  FO : "FAROE ISLANDS",
  FJ : "FIJI",
  FI : "FINLAND",
  FR : "FRANCE",
  GF : "FRENCH GUIANA",
  PF : "FRENCH POLYNESIA",
  TF : "FRENCH SOUTHERN TERRITORIES",
  GA : "GABON",
  GM : "GAMBIA",
  GE : "GEORGIA",
  DE : "GERMANY",
  GH : "GHANA",
  GI : "GIBRALTAR",
  GR : "GREECE",
  GL : "GREENLAND",
  GD : "GRENADA",
  GP : "GUADELOUPE",
  GU : "GUAM",
  GT : "GUATEMALA",
  GN : "GUINEA",
  GW : "GUINEA-BISSAU",
  GY : "GUYANA",
  HT : "HAITI",
  HM : "HEARD ISLAND AND MCDONALD ISLANDS",
  VA : "HOLY SEE (VATICAN CITY STATE)",
  HN : "HONDURAS",
  HK : "HONG KONG",
  HU : "HUNGARY",
  IS : "ICELAND",
  IN : "INDIA",
  ID : "INDONESIA",
  IR : "IRAN, ISLAMIC REPUBLIC OF",
  IQ : "IRAQ",
  IE : "IRELAND",
  IL : "ISRAEL",
  IT : "ITALY",
  JM : "JAMAICA",
  JP : "JAPAN",
  JO : "JORDAN",
  KZ : "KAZAKSTAN",
  KE : "KENYA",
  KI : "KIRIBATI",
  KP : "KOREA DEMOCRATIC PEOPLES REPUBLIC OF",
  KR : "KOREA REPUBLIC OF",
  KW : "KUWAIT",
  KG : "KYRGYZSTAN",
  LA : "LAO PEOPLES DEMOCRATIC REPUBLIC",
  LV : "LATVIA",
  LB : "LEBANON",
  LS : "LESOTHO",
  LR : "LIBERIA",
  LY : "LIBYAN ARAB JAMAHIRIYA",
  LI : "LIECHTENSTEIN",
  LT : "LITHUANIA",
  LU : "LUXEMBOURG",
  MO : "MACAU",
  MK : "MACEDONIA, THE FORMER YUGOSLAV REPUBLIC OF",
  MG : "MADAGASCAR",
  MW : "MALAWI",
  MY : "MALAYSIA",
  MV : "MALDIVES",
  ML : "MALI",
  MT : "MALTA",
  MH : "MARSHALL ISLANDS",
  MQ : "MARTINIQUE",
  MR : "MAURITANIA",
  MU : "MAURITIUS",
  YT : "MAYOTTE",
  MX : "MEXICO",
  FM : "MICRONESIA, FEDERATED STATES OF",
  MD : "MOLDOVA, REPUBLIC OF",
  MC : "MONACO",
  MN : "MONGOLIA",
  MS : "MONTSERRAT",
  MA : "MOROCCO",
  MZ : "MOZAMBIQUE",
  MM : "MYANMAR",
  NA : "NAMIBIA",
  NR : "NAURU",
  NP : "NEPAL",
  NL : "NETHERLANDS",
  AN : "NETHERLANDS ANTILLES",
  NC : "NEW CALEDONIA",
  NZ : "NEW ZEALAND",
  NI : "NICARAGUA",
  NE : "NIGER",
  NG : "NIGERIA",
  NU : "NIUE",
  NK : "NORFOLK ISLAND",
  MP : "NORTHERN MARIANA ISLANDS",
  NO : "NORWAY",
  OM : "OMAN",
  PK : "PAKISTAN",
  PW : "PALAU",
  PS : "PALESTINIAN TERRITORY, OCCUPIED",
  PA : "PANAMA",
  PG : "PAPUA NEW GUINEA",
  PY : "PARAGUAY",
  PE : "PERU",
  PH : "PHILIPPINES",
  PN : "PITCAIRN",
  PL : "POLAND",
  PT : "PORTUGAL",
  PR : "PUERTO RICO",
  QA : "QATAR",
  RE : "REUNION",
  RO : "ROMANIA",
  RU : "RUSSIAN FEDERATION",
  RW : "RWANDA",
  SH : "SAINT HELENA",
  KN : "SAINT KITTS AND NEVIS",
  LC : "SAINT LUCIA",
  PM : "SAINT PIERRE AND MIQUELON",
  VC : "SAINT VINCENT AND THE GRENADINES",
  WS : "SAMOA",
  SM : "SAN MARINO",
  ST : "SAO TOME AND PRINCIPE",
  SA : "SAUDI ARABIA",
  SN : "SENEGAL",
  SC : "SEYCHELLES",
  SL : "SIERRA LEONE",
  SG : "SINGAPORE",
  SK : "SLOVAKIA",
  SI : "SLOVENIA",
  SB : "SOLOMON ISLANDS",
  SO : "SOMALIA",
  ZA : "SOUTH AFRICA",
  GS : "SOUTH GEORGIA AND THE SOUTH SANDWICH ISLANDS",
  ES : "SPAIN",
  LK : "SRI LANKA",
  SD : "SUDAN",
  SR : "SURINAME",
  SJ : "SVALBARD AND JAN MAYEN",
  SZ : "SWAZILAND",
  SE : "SWEDEN",
  CH : "SWITZERLAND",
  SY : "SYRIAN ARAB REPUBLIC",
  TW : "TAIWAN, PROVINCE OF CHINA",
  TJ : "TAJIKISTAN",
  TZ : "TANZANIA, UNITED REPUBLIC OF",
  TH : "THAILAND",
  TG : "TOGO",
  TK : "TOKELAU",
  TO : "TONGA",
  TT : "TRINIDAD AND TOBAGO",
  TN : "TUNISIA",
  TR : "TURKEY",
  TM : "TURKMENISTAN",
  TC : "TURKS AND CAICOS ISLANDS",
  TV : "TUVALU",
  UG : "UGANDA",
  UA : "UKRAINE",
  AE : "UNITED ARAB EMIRATES",
  GB : "UNITED KINGDOM",
  UM : "UNITED STATES MINOR OUTLYING ISLANDS",
  UY : "URUGUAY",
  UZ : "UZBEKISTAN",
  VU : "VANUATU",
  VE : "VENEZUELA",
  VN : "VIET NAM",
  VG : "VIRGIN ISLANDS, BRITISH",
  VI : "VIRGIN ISLANDS, U.S.",
  WF : "WALLIS AND FUTUNA",
  EH : "WESTERN SAHARA",
  YE : "YEMEN",
  YU : "YUGOSLAVIA",
  ZM : "ZAMBIA",
  ZW : "ZIMBABWE"
}
```

## State/Province Codes

```javascript
//States
["AL","AK","AZ","AR","CA","CO","CT","DE","DC","FL","GA","HI","ID","IL","IN","IA","KS","KY","LA","ME","MD","MA","MI","MN","MS","MO","MT","NE","NV","NH","NJ","NM","NY","NC","ND","OH","OK","OR","PA","RI","SC","SD","TN","TX","UT","VT","VA","WA","WV","WI","WY"]
// Provinces
["BC","ON","NF","NS","PE","NU","NB","QC","MB","SK","AB","NT","YT"]

```


