Partnerships

CRUD endpoints for a user's partnerships

Please note that in all urls & code samples you'll need to replace:username and :corporation with appropriate values

Get All Partnerships

GET /v2/organization/:corporation/expert/:username/partnership

Headers

NameValue

Content-Type

application/json

Authorization

Bearer <token>

Url

NameTypeDescription

corporation

number

Corporation ID

username

string

Unique username

Response

{
  data: [
    {
      id: 1,
      title: 'Partnership title',
      individual: 'Individual Name',
      organization: 'Organization Name',
      url: 'http://www.myurl.com',
      details: 'Partnership details',
      date: 0
    },
  ],
  success: true
}

Code

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));

Get Individual Partnership

GET /v2/organization/:corporation/expert/:username/partnership/:id

Headers

NameValue

Content-Type

application/json

Authorization

Bearer <token>

Url

NameTypeDescription

corporation

number

Corporation ID

username

string

Unique username

id

number

Partnership ID

Response

{
  data: [
    {
      id: 1,
      title: 'Partnership title',
      individual: 'Individual Name',
      organization: 'Organization Name',
      url: 'http://www.myurl.com',
      details: 'Partnership details',
      date: 0
    },
  ],
  success: true
}

Code

const accessToken = `<ACCESS TOKEN>`

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));

Create Partnership

POST /v2/organization/:corporation/expert/:username/partnership

Headers

NameValue

Content-Type

application/json

Authorization

Bearer <token>

Url

NameTypeDescription

corporation

number

Corporation ID

username

string

Unique username

Body

NameTypeDescription

title*

string

Partnership Title

organization

string

Partnership Organization

details*

string

Partnership Detail

date

unix timestamp

PartnershipDate

url

string

Partnership Url

individual*

string

Partnership Individual

Response

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

Code

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));

Update Partnership

PUT /v2/organization/:corporation/expert/:username/partnership/:id

Headers

NameValue

Content-Type

application/json

Authorization

Bearer <token>

Url

NameTypeDescription

corporation

number

Corporation ID

username

string

Unique username

id

number

Partnership ID

Body

NameTypeDescription

title*

string

Partnership Title

organization

string

Partnership Organization

details*

string

Partnership Detail

date

unix timestamp

PartnershipDate

url

string

Partnership Url

individual*

string

Partnership Individual

Response

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

Code

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));

Delete Partnership

DELETE /v2/organization/:corporation/expert/:username/partnership/:id

Headers

NameValue

Content-Type

application/json

Authorization

Bearer <token>

Url

NameTypeDescription

corporation

number

Corporation ID

username

string

Unique username

id

number

Partnership ID

Response

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

Code

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));

Last updated