# Expert Profile

{% 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="../../../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="../../../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="../../../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="../../../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 %}
