NAV Navbar
javascript php shell

Introduction

const TPS = require('3ps-js');

let tps = new TPS('e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855');
<?php

use Ideea\TPS;

$tps = new TPS('YOUR_API_KEY');

This is the documentation for 3PS API. You can use this SDK to create components and objects and start new print jobs.

Components

Get Components

GET /api/v1/components

tps.components.latest().then((components) => {
  console.log(components);
})
<?php

$components = $tps->components->latest();
curl 'https://3ps.ideea.io/api/v1/components' \
  -X GET \
  -H 'Authorization: Bearer ACCESS_TOKEN'

Response

{
    "data": [
        {
            "id": "6f0ad6b2-e9e1-4ca7-a03e-84cdbdb9f89a",
            "created_by": "aaaaaaaa-9a34-4466-ba4c-46438def7d7f",
            "group_id": "2f8fdea3-b875-4926-90c8-5a1b11b818c8",
            "is_public": true,
            "name": "Dice",
            "image": "https://3ps-images.sfo2.digitaloceanspaces.com/stl-1df5d8bb-7188-4766-b626-125ef94f3db5.png",
            "description": null,
            "source": null,
            "star_count": 0,
            "download_count": 0,
            "resolution": "200",
            "material": "PLA",
            "color": "Red",
            "process": "FDM",
            "infill": 20,
            "stl_version": 2,
            "stl_id": "1df5d8bb-7188-4766-b626-125ef94f3db5",
            "deleted_at": null,
            "created_at": "2019-07-12T16:23:53.905Z",
            "updated_at": "2019-07-12T16:23:59.112Z"
        }
    ],
    "meta": {},
    "status": "ok"
}

This endpoint returns all of the latest components.

HTTP Endpoint

GET https://3ps.ideea.io/api/v1/components

Create Component

POST /api/v1/components/create

tps.components.create({
    group_id: 'a0ffedbb-ff29-5138-9b5d-cd1f6ae3bc6b',
    name: 'Dice',
    is_public: true,
    resolution: 100,
    material: 'pla',
    color: 'red',
    process: 'FDM',
    infill: 20,
    stl: fs.readFileSync('./dice.stl'),
}).then((newComponent) => {
  console.log(newComponent);
})
<?php

$newComponent = $tps->components->create([
    'group_id' => 'a0ffedbb-ff29-5138-9b5d-cd1f6ae3bc6b',
    'name' => 'dice',
    'is_public' => true,
    'resolution' => 100,
    'material' => 'pla',
    'color' => 'red',
    'process' => 'FDM',
    'infill' => 20,
    'stl' => dirname(__FILE__) . '/dice.stl',
]);
curl 'http://3ps.ideea.io/api/v1/components/create' \
  -X POST \
  -H 'Authorization: Bearer ACCESS_TOKEN' \
  -H 'Content-Type: application/x-www-form-urlencoded' \
  -H 'cache-control: no-cache' \
  -F group_id=2f8fdea3-b875-4926-90c8-5a1b11b818c8 \
  -F name=test \
  -F is_public=1 \
  -F resolution=100 \
  -F material=pla \
  -F color=red \
  -F process=FDM \
  -F infill=20 \
  -F stl=@/tmp/dice.stl

Response

{
    "data": {
        "id": "2e79a2df-25e7-4a61-8e8e-f29bb96a3550",
        "created_by": "aaaaaaaa-9a34-4466-ba4c-46438def7d7f",
        "group_id": "a0ffedbb-ff29-5138-9b5d-cd1f6ae3bc6b",
        "is_public": true,
        "name": "test",
        "image": "https://3ps-images.sfo2.digitaloceanspaces.com/stl-293ae558-4374-4e76-8e67-9a2581d55136.png",
        "stl_version": 1,
        "stl_id": "293ae558-4374-4e76-8e67-9a2581d55136",
        "resolution": "100",
        "material": "pla",
        "color": "red",
        "process": "FDM",
        "infill": 20,
        "source": null,
        "updated_at": "2019-08-15T21:18:22.324Z",
        "created_at": "2019-08-15T21:18:22.324Z",
        "description": null,
        "download_count": 0,
        "star_count": 0,
        "deleted_at": null,
        "stl": {
            "id": "293ae558-4374-4e76-8e67-9a2581d55136",
            "component_id": "2e79a2df-25e7-4a61-8e8e-f29bb96a3550",
            "version": 1,
            "stl_file": "https://3ps-stl.sfo2.digitaloceanspaces.com/293ae558-4374-4e76-8e67-9a2581d55136.stl",
            "updated_at": "2019-08-15T21:18:22.037Z",
            "created_at": "2019-08-15T21:18:22.037Z"
        }
    },
    "meta": {},
    "status": "ok"
}

To create a new component make a post request to /api/v1/components/create. This will create the component with the provided data.

HTTP Endpoint

POST http://3ps.ideea.io/api/v1/components/create

Request Payload

Parameter Required Description
group_id true The group ID that this component will belong to
name true The name of the component
is_public true Component accessibility
resolution true Default print resolution
material true Default print material
color true Default print material color
process true Default printing process
infill true Default infill percentage

Get Components By Group ID

GET /api/v1/components/group/{group_id}

tps.components.getByGroupID('a0ffedbb-ff29-5138-9b5d-cd1f6ae3bc6b').then((components) => {
  console.log(components);
})
<?php

$components = $tps->components->getByGroupID('a0ffedbb-ff29-5138-9b5d-cd1f6ae3bc6b');
curl 'https://3ps.ideea.io/api/v1/components/group/a0ffedbb-ff29-5138-9b5d-cd1f6ae3bc6b' \
  -X GET \
  -H 'Authorization: Bearer ACCESS_TOKEN'

Response

{
    "data": [
        {
            "id": "6f0ad6b2-e9e1-4ca7-a03e-84cdbdb9f89a",
            "created_by": "aaaaaaaa-9a34-4466-ba4c-46438def7d7f",
            "group_id": "a0ffedbb-ff29-5138-9b5d-cd1f6ae3bc6b",
            "is_public": true,
            "name": "Dice",
            "image": "https://3ps-images.sfo2.digitaloceanspaces.com/stl-1df5d8bb-7188-4766-b626-125ef94f3db5.png",
            "description": null,
            "source": null,
            "star_count": 0,
            "download_count": 0,
            "resolution": "200",
            "material": "PLA",
            "color": "Red",
            "process": "FDM",
            "infill": 20,
            "stl_version": 2,
            "stl_id": "1df5d8bb-7188-4766-b626-125ef94f3db5",
            "deleted_at": null,
            "created_at": "2019-07-12T16:23:53.905Z",
            "updated_at": "2019-07-12T16:23:59.112Z"
        }
    ],
    "meta": {},
    "status": "ok"
}

This endpoint returns all of the group's components

HTTP Endpoint

GET https://3ps.ideea.io/api/v1/components/group/{group_id}

Get Component By ID

GET /api/v1/components/{component_id}

tps.components.get('6f0ad6b2-e9e1-4ca7-a03e-84cdbdb9f89a').then((component) => {
  console.log(component);
})
<?php

$component = $tps->components->get('6f0ad6b2-e9e1-4ca7-a03e-84cdbdb9f89a');
curl 'https://3ps.ideea.io/api/v1/components/6f0ad6b2-e9e1-4ca7-a03e-84cdbdb9f89a' \
  -X GET \
  -H 'Authorization: Bearer ACCESS_TOKEN'

Response

{
    "data": {
        "id": "6f0ad6b2-e9e1-4ca7-a03e-84cdbdb9f89a",
        "created_by": "aaaaaaaa-9a34-4466-ba4c-46438def7d7f",
        "group_id": "2f8fdea3-b875-4926-90c8-5a1b11b818c8",
        "is_public": true,
        "name": "Dice",
        "image": "https://3ps-images.sfo2.digitaloceanspaces.com/stl-1df5d8bb-7188-4766-b626-125ef94f3db5.png",
        "description": null,
        "source": null,
        "star_count": 0,
        "download_count": 0,
        "resolution": "200",
        "material": "PLA",
        "color": "Red",
        "process": "FDM",
        "infill": 20,
        "stl_version": 2,
        "stl_id": "1df5d8bb-7188-4766-b626-125ef94f3db5",
        "deleted_at": null,
        "created_at": "2019-07-12T16:23:53.905Z",
        "updated_at": "2019-07-12T16:23:59.112Z"
    },
    "meta": {},
    "status": "ok"
}

This endpoint will retrun a component by it's ID

HTTP Endpoint

GET https://3ps.ideea.io/api/v1/components/{component_id}

Update Component

POST /api/v1/components/{component_id}

tps.components.update({
    name: 'New Name',
    is_public: false,
    color: 'blue',
}).then((updatedComponent) => {
  console.log(updatedComponent);
})
<?php

$updatedComponent = $tps->components->update('2e79a2df-25e7-4a61-8e8e-f29bb96a3550', [
    'name' => 'New Name',
    'is_public' => false,
    'color' => 'blue',
]);
curl 'http://3ps.ideea.io/api/v1/components/2e79a2df-25e7-4a61-8e8e-f29bb96a3550' \
  -X POST \
  -H 'Authorization: Bearer ACCESS_TOKEN' \
  -H 'Content-Type: application/x-www-form-urlencoded' \
  -F group_id=2f8fdea3-b875-4926-90c8-5a1b11b818c8 \
  -F name=new%20test \
  -F is_public=false \
  -F color=blue

Response

{
    "data": {
        "id": "2e79a2df-25e7-4a61-8e8e-f29bb96a3550",
        "created_by": "aaaaaaaa-9a34-4466-ba4c-46438def7d7f",
        "group_id": "a0ffedbb-ff29-5138-9b5d-cd1f6ae3bc6b",
        "is_public": false,
        "name": "new name",
        "image": "https://3ps-images.sfo2.digitaloceanspaces.com/stl-293ae558-4374-4e76-8e67-9a2581d55136.png",
        "stl_version": 1,
        "stl_id": "293ae558-4374-4e76-8e67-9a2581d55136",
        "resolution": "100",
        "material": "pla",
        "color": "blue",
        "process": "FDM",
        "infill": 20,
        "source": null,
        "updated_at": "2019-08-15T21:18:22.324Z",
        "created_at": "2019-08-15T21:18:22.324Z",
        "description": null,
        "download_count": 0,
        "star_count": 0,
        "deleted_at": null,
        "stl": {
            "id": "293ae558-4374-4e76-8e67-9a2581d55136",
            "component_id": "2e79a2df-25e7-4a61-8e8e-f29bb96a3550",
            "version": 1,
            "stl_file": "https://3ps-stl.sfo2.digitaloceanspaces.com/293ae558-4374-4e76-8e67-9a2581d55136.stl",
            "updated_at": "2019-08-15T21:18:22.037Z",
            "created_at": "2019-08-15T21:18:22.037Z"
        }
    },
    "meta": {},
    "status": "ok"
}

To update an existing component make a post request to /api/v1/components/{component_id}. This will update the component with the provided data.

HTTP Endpoint

POST http://3ps.ideea.io/api/v1/components/{component_id}

Request Payload

Parameter Required Description
is_public false Component accessibility
name false The name of the component
description false Component description
resolution false Default print resolution
material false Default print material
color false Default print material color
process false Default printing process
infill false Default infill percentage
source false Component soource url

Download Component STL

GET /api/v1/components/{component_id}/download/{stl_id}

tps.components.downloadSTL('2e79a2df-25e7-4a61-8e8e-f29bb96a3550', '293ae558-4374-4e76-8e67-9a2581d55136').then(({ url }) => {
  console.log(url);
})
<?php

$download = $tps->components->downloadSTL('2e79a2df-25e7-4a61-8e8e-f29bb96a3550', '293ae558-4374-4e76-8e67-9a2581d55136');

file_put_contents("dice.stl", fopen($download->url, 'r'));
curl 'https://3ps.ideea.io/api/v1/components/6f0ad6b2-e9e1-4ca7-a03e-84cdbdb9f89a/download/293ae558-4374-4e76-8e67-9a2581d55136' \
  -X GET \
  -H 'Authorization: Bearer ACCESS_TOKEN'

Response

{
    "data": {
        "url": "https://download.ideea.io/293ae558-4374-4e76-8e67-9a2581d55136.stl"
    },
    "meta": {},
    "status": "ok"
}

To download a component's STL file hit the route /api/v1/components/{component_id}/download/{stl_id}. This will return an object with a single property url, this is a signed download link and will expire in 15 minutes.

HTTP Endpoint

GET http://3ps.ideea.io/api/v1/components/{component_id}/download/{stl_id}

New Component STL

POST /api/v1/components/{component_id}/stl

tps.components.newSTL('2e79a2df-25e7-4a61-8e8e-f29bb96a3550', fs.readFileSync('./dice-2.stl'))
.then((newSTL) => {
  console.log(newSTL);
})
<?php

$newSTL = $tps->components->newSTL('2e79a2df-25e7-4a61-8e8e-f29bb96a3550', dirname(__FILE__) . '/dice-2.stl');

curl 'http://3ps.ideea.local/api/v1/components/2e79a2df-25e7-4a61-8e8e-f29bb96a3550/stl' \
  -X POST \
  -H 'Authorization: Bearer ACCESS_TOKEN' \
  -H 'Content-Type: application/x-www-form-urlencoded' \
  -F stl=@/tmp/dice-2.stl

Response

{
    "data": {
        "id": "f8284c75-74d6-4fcb-b2ff-608a9db01c28",
        "component_id": "2e79a2df-25e7-4a61-8e8e-f29bb96a3550",
        "version": 2,
        "stl_file": "https://3ps-stl.sfo2.digitaloceanspaces.com/f8284c75-74d6-4fcb-b2ff-608a9db01c28.stl",
        "updated_at": "2019-08-15T22:30:22.169Z",
        "created_at": "2019-08-15T22:30:22.169Z"
    },
    "meta": {},
    "status": "ok"
}

To create a new STL version for an existing component POST the new .stl file to /components/{component_id}/stl. This will create a new verion and will be considered the latest version.

HTTP Endpoint

POST http://3ps.ideea.io/api/v1/components/{component_id}/stl

Request Payload

Parameter Required Description
stl true The new STL

Delete a Components STL

DELETE /api/v1/components/{component_id}/stl/{stl_id}/delete

tps.components.deleteSTL('2e79a2df-25e7-4a61-8e8e-f29bb96a3550', '293ae558-4374-4e76-8e67-9a2581d55136')
.then((deletedSTL) => {
  console.log(deletedSTL);
})
<?php

$deletedSTL = $tps->components->deleteSTL('2e79a2df-25e7-4a61-8e8e-f29bb96a3550', '293ae558-4374-4e76-8e67-9a2581d55136');

curl 'http://3ps.ideea.local/api/v1/components/2e79a2df-25e7-4a61-8e8e-f29bb96a3550/stl/293ae558-4374-4e76-8e67-9a2581d55136/delete' \
  -X DELETE \
  -H 'Authorization: Bearer ACCESS_TOKEN'

Response

{
    "data": {
        "id": "f8284c75-74d6-4fcb-b2ff-608a9db01c28",
    },
    "meta": {},
    "status": "ok"
}

To delete an STL make a DELETE request to /components/{component_id}/stl/{stl_id}/delete

Delete a Component

DELETE /api/v1/components/{component_id}/delete

tps.components.delete('2e79a2df-25e7-4a61-8e8e-f29bb96a3550')
.then((deletedComponent) => {
  console.log(deletedComponent);
})
<?php

$deletedComponent = $tps->components->delete('2e79a2df-25e7-4a61-8e8e-f29bb96a3550');

curl 'http://3ps.ideea.local/api/v1/components/2e79a2df-25e7-4a61-8e8e-f29bb96a3550/delete' \
  -X DELETE \
  -H 'Authorization: Bearer ACCESS_TOKEN'

Response

{
    "data": {
        "id": "f8284c75-74d6-4fcb-b2ff-608a9db01c28",
    },
    "meta": {},
    "status": "ok"
}

To delete a component make a DELETE request to /components/{component_id}/delete

Search Components

GET /api/v1/components/search/{query}

tps.components.search('dice').then((searchResults) => {
  console.log(searchResults)
})
<?php

$searchResults = $tps->components->search('dice');

curl 'https://3ps.ideea.io/api/v1/components/search/dice' \
  -X GET \
  -H 'Authorization: Bearer ACCESS_TOKEN'

Response

{
    "data": [
        {
            "id": "6f0ad6b2-e9e1-4ca7-a03e-84cdbdb9f89a",
            "created_by": "aaaaaaaa-9a34-4466-ba4c-46438def7d7f",
            "group_id": "2f8fdea3-b875-4926-90c8-5a1b11b818c8",
            "is_public": true,
            "name": "Dice",
            "image": "https://3ps-images.sfo2.digitaloceanspaces.com/stl-1df5d8bb-7188-4766-b626-125ef94f3db5.png",
            "description": null,
            "source": null,
            "star_count": 0,
            "download_count": 0,
            "resolution": "200",
            "material": "PLA",
            "color": "Red",
            "process": "FDM",
            "infill": 20,
            "stl_version": 2,
            "stl_id": "1df5d8bb-7188-4766-b626-125ef94f3db5",
            "deleted_at": null,
            "created_at": "2019-07-12T16:23:53.905Z",
            "updated_at": "2019-07-12T16:23:59.112Z"
        }
    ],
    "meta": {},
    "status": "ok"
}

This endpoint will return all components matching the query param

HTTP Endpoint

GET https://3ps.ideea.io/api/v1/components/search/dice

Star a Component

POST /api/v1/components/{component_id}/star

tps.components.star('6f0ad6b2-e9e1-4ca7-a03e-84cdbdb9f89a')
.then((star) => {
  console.log(star);
})
<?php

$star = $tps->components->star('6f0ad6b2-e9e1-4ca7-a03e-84cdbdb9f89a');
curl 'http://3ps.ideea.io/api/v1/components/6f0ad6b2-e9e1-4ca7-a03e-84cdbdb9f89a/star' \
  -X POST \
  -H 'Authorization: Bearer ACCESS_TOKEN'

Response

{
    "data": {
        "id": "54c250cb-7c43-41dd-875a-8d8065422197",
        "user_id": "aaaaaaaa-9a34-4466-ba4c-46438def7d7f",
        "component_id": "2e79a2df-25e7-4a61-8e8e-f29bb96a3550",
        "updated_at": "2019-08-15T22:44:39.377Z",
        "created_at": "2019-08-15T22:44:39.377Z"
    },
    "meta": {},
    "status": "ok"
}

Starring a componnet is similar to liking a post on social media.

HTTP Endpoint

POST http://3ps.ideea.io/api/v1/components/{component_id}/star

Unstar a Component

DELETE /api/v1/components/{component_id}/un-star

tps.components.unStar('2e79a2df-25e7-4a61-8e8e-f29bb96a3550')
.then((unStar) => {
  console.log(unStar);
})
<?php

$unStar = $tps->components->unStar('2e79a2df-25e7-4a61-8e8e-f29bb96a3550');

curl 'http://3ps.ideea.local/api/v1/components/2e79a2df-25e7-4a61-8e8e-f29bb96a3550/un-star' \
  -X DELETE \
  -H 'Authorization: Bearer ACCESS_TOKEN'

Response

{
    "data": {
        "component_id": "2e79a2df-25e7-4a61-8e8e-f29bb96a3550"
    },
    "meta": {},
    "status": "ok"
}

To un-star a component make a DELETE request to /components/{component_id}/un-star

Tag Component

POST /api/v1/components/{component_id}/add-tag

tps.components.addTag('6f0ad6b2-e9e1-4ca7-a03e-84cdbdb9f89a', 'foo')
.then((tag) => {
  console.log(tag);
})
<?php

$tag = $tps->components->addTag('6f0ad6b2-e9e1-4ca7-a03e-84cdbdb9f89a', 'foo');

curl 'http://3ps.ideea.io/api/v1/components/6f0ad6b2-e9e1-4ca7-a03e-84cdbdb9f89a/add-tag' \
  -X POST \
  -H 'Authorization: Bearer ACCESS_TOKEN' \
  -H 'Content-Type: application/x-www-form-urlencoded' \
  -d tag=foo

Response

{
    "data": {
        "id": "51eb64bd-dc74-4f28-8568-73245fee626e",
        "component_id": "6f0ad6b2-e9e1-4ca7-a03e-84cdbdb9f89a",
        "tag": "foo",
        "updated_at": "2019-08-15T23:28:35.786Z",
        "created_at": "2019-08-15T23:28:35.786Z",
    },
    "meta": {},
    "status": "ok"
}

A tag is like adding a keyword to a component

HTTP Endpoint

POST http://3ps.ideea.io/api/v1/components/{component_id}/add-tag

Request Payload

Parameter Required Description
tag true The tag

Remove Tag

DELETE /api/v1/components/{component_id}/remove-tag/{tag_id}

tps.components.removeTag('2e79a2df-25e7-4a61-8e8e-f29bb96a3550', '51eb64bd-dc74-4f28-8568-73245fee626e')
.then((unStar) => {
  console.log(unStar);
})
<?php

$unStar = $tps->components->removeTag('2e79a2df-25e7-4a61-8e8e-f29bb96a3550', '51eb64bd-dc74-4f28-8568-73245fee626e');

curl 'http://3ps.ideea.local/api/v1/components/2e79a2df-25e7-4a61-8e8e-f29bb96a3550/remove-tag/51eb64bd-dc74-4f28-8568-73245fee626e' \
  -X DELETE \
  -H 'Authorization: Bearer ACCESS_TOKEN'

Response

{
    "data": {
        "id": "51eb64bd-dc74-4f28-8568-73245fee626e"
    },
    "meta": {},
    "status": "ok"
}

To remove a tag from a component make a DELETE request to /components/{component_id}/remove-tag/{tag_id}

Objects

Get Objects

GET /api/v1/objects

tps.objects.latest().then((objects) => {
  console.log(objects);
})
<?php

$objects = $tps->objects->latest();
curl 'https://3ps.ideea.io/api/v1/objects' \
  -X GET \
  -H 'Authorization: Bearer ACCESS_TOKEN'

Response

{
    "data": [
        {
            "id": "1f502233-08ff-4a22-9519-69ee76db0edd",
            "group_id": "2f8fdea3-b875-4926-90c8-5a1b11b818c8",
            "is_public": true,
            "name": "Nut & Bolt",
            "image": "https://ideea.io/static/img/logo.png",
            "description": null,
            "star_count": 0,
            "deleted_at": null,
            "created_at": "2019-08-16T04:48:26.000Z",
            "updated_at": null
        },
    ],
    "meta": {},
    "status": "ok"
}

This endpoint returns all of the latest objects.

HTTP Endpoint

GET https://3ps.ideea.io/api/v1/objects

Create Object

POST /api/v1/objects/create

tps.objects.create({
    name: 'Nut & Bolt'
    is_public: true
    group_id: 'a0ffedbb-ff29-5138-9b5d-cd1f6ae3bc6b',
    components:[
        {
            id: '0d9f0418-a1fe-47e6-baed-001feac9ec15',
        },{
            count: 2,
            id: 'c47304f0-cc99-4e97-8d2b-38d6ad47f6e3'
        }
    ],
    image: fs.readFileSync('./nut-and-bolt.png),
}).then((newObject) => {
  console.log(newObject);
})
<?php

$newObject = $tps->objects->create([
    'group_id' => 'a0ffedbb-ff29-5138-9b5d-cd1f6ae3bc6b',
    'name' => 'Nut & Bolt'
    'is_public' => true,
    'components' => [
        [
            'id' => '0d9f0418-a1fe-47e6-baed-001feac9ec15',
        ],[
            'count' => 2,
            'id' => 'c47304f0-cc99-4e97-8d2b-38d6ad47f6e3',
        ]
    ],
    'image' => dirname(__FILE__) . '/nut-and-bolt.png',
]);
curl 'http://3ps.ideea.io/api/v1/objects/create' \
  -X POST \
  -H 'Authorization: Bearer ACCESS_TOKEN' \
  -H 'Content-Type: application/x-www-form-urlencoded' \
  -F 'group_id=2f8fdea3-b875-4926-90c8-5a1b11b818c8' \
  -F 'name=Nut & Bolt' \
  -F 'is_public=true' \
  -F 'components[0][id]=00000000-0000-0000-0000-000000000000' \
  -F 'components[0][count]=2' \
  -F 'components[1][id]=11111111-0000-0000-0000-000000000000' \
  -F image=@/nut-and-bolt.png

Response

{
    "data": {
        "id": "1f502233-08ff-4a22-9519-69ee76db0edd",
        "group_id": "2f8fdea3-b875-4926-90c8-5a1b11b818c8",
        "is_public": true,
        "name": "Nut & Bolt",
        "image": "https://ideea.io/static/img/logo.png",
        "description": null,
        "star_count": 0,
        "deleted_at": null,
        "created_at": "2019-08-16T04:48:26.000Z",
        "updated_at": null
    },
    "meta": {},
    "status": "ok"
}

To create a new object make a post request to /api/v1/objects/create. This will create the object with the provided data.

HTTP Endpoint

POST http://3ps.ideea.io/api/v1/objects/create

Request Payload

Parameter Required Description
group_id true The group ID that this object will belong to
name true The name of the object
is_public true Object accessibility
components true Array of components
components[].id true The component_id
components[].count false The total components. Default 1
image true An image for the object

Get Objects By Group ID

GET /api/v1/objects/group/{group_id}

tps.objects.getByGroupID('a0ffedbb-ff29-5138-9b5d-cd1f6ae3bc6b').then((objects) => {
  console.log(objects);
})
<?php

$objects = $tps->objects->getByGroupID('a0ffedbb-ff29-5138-9b5d-cd1f6ae3bc6b');
curl 'https://3ps.ideea.io/api/v1/objects/group/a0ffedbb-ff29-5138-9b5d-cd1f6ae3bc6b' \
  -X GET \
  -H 'Authorization: Bearer ACCESS_TOKEN'

Response

{
    "data": [
        {
            "id": "1f502233-08ff-4a22-9519-69ee76db0edd",
            "group_id": "2f8fdea3-b875-4926-90c8-5a1b11b818c8",
            "is_public": true,
            "name": "Nut & Bolt",
            "image": "https://ideea.io/static/img/logo.png",
            "description": null,
            "star_count": 0,
            "deleted_at": null,
            "created_at": "2019-08-16T04:48:26.000Z",
            "updated_at": null
        }
    ],
    "meta": {},
    "status": "ok"
}

This endpoint returns all of the group's objects

HTTP Endpoint

GET https://3ps.ideea.io/api/v1/objects/group/{group_id}

Get Object By ID

GET /api/v1/objects/{object_id}

tps.objects.get('6f0ad6b2-e9e1-4ca7-a03e-84cdbdb9f89a').then((object) => {
  console.log(object);
})
<?php

$object = $tps->objects->get('6f0ad6b2-e9e1-4ca7-a03e-84cdbdb9f89a');
curl 'https://3ps.ideea.io/api/v1/objects/6f0ad6b2-e9e1-4ca7-a03e-84cdbdb9f89a' \
  -X GET \
  -H 'Authorization: Bearer ACCESS_TOKEN'

Response

{
    "data": {
        "id": "1f502233-08ff-4a22-9519-69ee76db0edd",
        "group_id": "2f8fdea3-b875-4926-90c8-5a1b11b818c8",
        "is_public": true,
        "name": "Nut & Bolt",
        "image": "https://ideea.io/static/img/logo.png",
        "description": null,
        "star_count": 0,
        "deleted_at": null,
        "created_at": "2019-08-16T04:48:26.000Z",
        "updated_at": null
    },
    "meta": {},
    "status": "ok"
}

This endpoint will retrun a object by it's ID

HTTP Endpoint

GET https://3ps.ideea.io/api/v1/objects/{object_id}

Update Object

POST /api/v1/objects/{object_id}

tps.objects.update({
    name: 'New Name',
    is_public: false,
    image: fs.readFileSync('./new-image.png'),
}).then((updatedObject) => {
  console.log(updatedObject);
})
<?php

$updatedObject = $tps->objects->update('2e79a2df-25e7-4a61-8e8e-f29bb96a3550', [
    'name' => 'New Name',
    'is_public' => false,
    'image' => dirname(__FILE__) . '/nut-and-bolt.png',
]);
curl 'http://3ps.ideea.io/api/v1/objects/2e79a2df-25e7-4a61-8e8e-f29bb96a3550' \
  -X POST \
  -H 'Authorization: Bearer ACCESS_TOKEN' \
  -H 'Content-Type: application/x-www-form-urlencoded' \
  -F group_id=2f8fdea3-b875-4926-90c8-5a1b11b818c8 \
  -F name=new%20test \
  -F is_public=false \
  -F cimage=@/new-image.png

Response

{
    "data": {
        "id": "1f502233-08ff-4a22-9519-69ee76db0edd",
        "group_id": "2f8fdea3-b875-4926-90c8-5a1b11b818c8",
        "is_public": false,
        "name": "New Name",
        "image": "https://ideea.io/static/img/image.png",
        "description": null,
        "star_count": 0,
        "deleted_at": null,
        "created_at": "2019-08-16T04:48:26.000Z",
        "updated_at": null
    },
    "meta": {},
    "status": "ok"
}

To update an existing object make a post request to /api/v1/objects/{object_id}. This will update the object with the provided data.

HTTP Endpoint

POST http://3ps.ideea.io/api/v1/objects/{object_id}

Request Payload

Parameter Required Description
name false The name of the object
is_public false Object accessibility
image false Object image

Delete a Object

DELETE /api/v1/objects/{object_id}/delete

tps.objects.delete('2e79a2df-25e7-4a61-8e8e-f29bb96a3550')
.then((deletedObject) => {
  console.log(deletedObject);
})
<?php

$deletedObject = $tps->objects->delete('2e79a2df-25e7-4a61-8e8e-f29bb96a3550');

curl 'http://3ps.ideea.local/api/v1/objects/2e79a2df-25e7-4a61-8e8e-f29bb96a3550/delete' \
  -X DELETE \
  -H 'Authorization: Bearer ACCESS_TOKEN'

Response

{
    "data": {
        "id": "f8284c75-74d6-4fcb-b2ff-608a9db01c28",
    },
    "meta": {},
    "status": "ok"
}

To delete a object make a DELETE request to /objects/{object_id}/delete

Search Objects

GET /api/v1/objects/search/{query}

tps.objects.search('bolt').then((searchResults) => {
  console.log(searchResults)
})
<?php

$searchResults = $tps->objects->search('bolt');

curl 'https://3ps.ideea.io/api/v1/objects/search/bolt' \
  -X GET \
  -H 'Authorization: Bearer ACCESS_TOKEN'

Response

{
    "data": [
        {
            "id": "1f502233-08ff-4a22-9519-69ee76db0edd",
            "group_id": "2f8fdea3-b875-4926-90c8-5a1b11b818c8",
            "is_public": true,
            "name": "Nut & Bolt",
            "image": "https://ideea.io/static/img/logo.png",
            "description": null,
            "star_count": 0,
            "deleted_at": null,
            "created_at": "2019-08-16T04:48:26.000Z",
            "updated_at": null
        }
    ],
    "meta": {},
    "status": "ok"
}

This endpoint will return all objects matching the query param

HTTP Endpoint

GET https://3ps.ideea.io/api/v1/objects/search/dice

Star a Object

POST /api/v1/objects/{object_id}/star

tps.objects.star('6f0ad6b2-e9e1-4ca7-a03e-84cdbdb9f89a')
.then((star) => {
  console.log(star);
})
<?php

$star = $tps->objects->star('6f0ad6b2-e9e1-4ca7-a03e-84cdbdb9f89a');
curl 'http://3ps.ideea.io/api/v1/objects/6f0ad6b2-e9e1-4ca7-a03e-84cdbdb9f89a/star' \
  -X POST \
  -H 'Authorization: Bearer ACCESS_TOKEN'

Response

{
    "data": {
        "id": "54c250cb-7c43-41dd-875a-8d8065422197",
        "user_id": "aaaaaaaa-9a34-4466-ba4c-46438def7d7f",
        "object_id": "6f0ad6b2-e9e1-4ca7-a03e-84cdbdb9f89a",
        "updated_at": "2019-08-15T22:44:39.377Z",
        "created_at": "2019-08-15T22:44:39.377Z"
    },
    "meta": {},
    "status": "ok"
}

Starring a componnet is similar to liking a post on social media.

HTTP Endpoint

POST http://3ps.ideea.io/api/v1/objects/{object_id}/star

Unstar a Object

DELETE /api/v1/objects/{object_id}/un-star

tps.objects.unStar('2e79a2df-25e7-4a61-8e8e-f29bb96a3550')
.then((unStar) => {
  console.log(unStar);
})
<?php

$unStar = $tps->objects->unStar('2e79a2df-25e7-4a61-8e8e-f29bb96a3550');

curl 'http://3ps.ideea.local/api/v1/objects/2e79a2df-25e7-4a61-8e8e-f29bb96a3550/un-star' \
  -X DELETE \
  -H 'Authorization: Bearer ACCESS_TOKEN'

Response

{
    "data": {
        "object_id": "2e79a2df-25e7-4a61-8e8e-f29bb96a3550"
    },
    "meta": {},
    "status": "ok"
}

To un-star a object make a DELETE request to /objects/{object_id}/un-star

Tag Object

POST /api/v1/objects/{object_id}/add-tag

tps.objects.addTag('6f0ad6b2-e9e1-4ca7-a03e-84cdbdb9f89a', 'foo')
.then((tag) => {
  console.log(tag);
})
<?php

$tag = $tps->objects->addTag('6f0ad6b2-e9e1-4ca7-a03e-84cdbdb9f89a', 'foo');

curl 'http://3ps.ideea.io/api/v1/objects/6f0ad6b2-e9e1-4ca7-a03e-84cdbdb9f89a/add-tag' \
  -X POST \
  -H 'Authorization: Bearer ACCESS_TOKEN' \
  -H 'Content-Type: application/x-www-form-urlencoded' \
  -d tag=foo

Response

{
    "data": {
        "id": "51eb64bd-dc74-4f28-8568-73245fee626e",
        "object_id": "6f0ad6b2-e9e1-4ca7-a03e-84cdbdb9f89a",
        "tag": "foo",
        "updated_at": "2019-08-15T23:28:35.786Z",
        "created_at": "2019-08-15T23:28:35.786Z",
    },
    "meta": {},
    "status": "ok"
}

A tag is like adding a keyword to a object

HTTP Endpoint

POST http://3ps.ideea.io/api/v1/objects/{object_id}/add-tag

Request Payload

Parameter Required Description
tag true The tag

Remove Tag

DELETE /api/v1/objects/{object_id}/remove-tag/{tag_id}

tps.objects.removeTag('2e79a2df-25e7-4a61-8e8e-f29bb96a3550', '51eb64bd-dc74-4f28-8568-73245fee626e')
.then((unStar) => {
  console.log(unStar);
})
<?php

$unStar = $tps->objects->removeTag('2e79a2df-25e7-4a61-8e8e-f29bb96a3550', '51eb64bd-dc74-4f28-8568-73245fee626e');

curl 'http://3ps.ideea.local/api/v1/objects/2e79a2df-25e7-4a61-8e8e-f29bb96a3550/remove-tag/51eb64bd-dc74-4f28-8568-73245fee626e' \
  -X DELETE \
  -H 'Authorization: Bearer ACCESS_TOKEN'

Response

{
    "data": {
        "id": "51eb64bd-dc74-4f28-8568-73245fee626e"
    },
    "meta": {},
    "status": "ok"
}

To remove a tag from a object make a DELETE request to /objects/{object_id}/remove-tag/{tag_id}

Jobs

Get Jobs By Group ID

GET /api/v1/jobs/group/{group_id}

tps.jobs.getByGroupID('a0ffedbb-ff29-5138-9b5d-cd1f6ae3bc6b').then((jobs) => {
  console.log(jobs);
})
<?php

$jobs = $tps->jobs->getByGroupID('a0ffedbb-ff29-5138-9b5d-cd1f6ae3bc6b');
curl 'https://3ps.ideea.io/api/v1/jobs/group/a0ffedbb-ff29-5138-9b5d-cd1f6ae3bc6b' \
  -X GET \
  -H 'Authorization: Bearer ACCESS_TOKEN'

Response

{
    "data": [
        {
            "id": "2f8fdea3-b875-4926-90c8-5a1b11b818c8",
            "group_id": "a0ffedbb-ff29-5138-9b5d-cd1f6ae3bc6b",
            "status": "new",
            "tracking_code": null,
            "status_note": "",
            "fulfillment_type": null,
            "printer_id": null,
            "printer_group_id": null,
            "charge": null,
            "charge_id": null,
            "is_chargeable": null,
            "address_line_1": "957 Main View Drive",
            "address_line_2": "",
            "zipcode": "33410",
            "city": "Ville",
            "state": "texas",
            "country": "US",
            "delivery_instructions": "Just throw it at my door, Ill hear it",
            "deleted_at": null,
            "created_at": "2019-08-16T13:13:00.000Z",
            "updated_at": null
        }
    ],
    "meta": {},
    "status": "ok"
}

This endpoint returns all of the group's jobs

HTTP Endpoint

GET https://3ps.ideea.io/api/v1/jobs/group/{group_id}

Create Job

POST /api/v1/jobs/create

tps.jobs.create({
    group_id: 'a0ffedbb-ff29-5138-9b5d-cd1f6ae3bc6b',
    address_type: 'default',
    fulfillment_type: 'standard',
    components: [
        {
            id: '0d9f0418-a1fe-47e6-baed-001feac9ec15',
        }
    ],
    objects: [
        {
            id: '0d9f0418-a1fe-47e6-baed-001feac9ec15',
        }
    ],
}).then((newJob) => {
  console.log(newJob);
})
<?php

$newJob = $tps->jobs->create([
    'group_id' => 'a0ffedbb-ff29-5138-9b5d-cd1f6ae3bc6b',
    'address_type' => 'default',
    'fulfillment_type' => 'standard',
    'components' => [
        [
            'id' => '0d9f0418-a1fe-47e6-baed-001feac9ec15',
        ],
    ],
    'objects' => [
        [
            'id' => '0d9f0418-a1fe-47e6-baed-001feac9ec15',
        ],
    ],
]);
curl 'http://3ps.ideea.io/api/v1/jobs/create' \
  -X POST \
  -H 'Authorization: Bearer ACCESS_TOKEN' \
  -H 'Content-Type: application/x-www-form-urlencoded' \
  -F group_id=a0ffedbb-ff29-5138-9b5d-cd1f6ae3bc6b \
  -F address_type=default \
  -F fulfillment_type=standard \
  -F 'components[1][id]=0d9f0418-a1fe-47e6-baed-001feac9ec15' \
  -F 'objects[1][id]=0d9f0418-a1fe-47e6-baed-001feac9ec15'

Response

{
    "data": {
        "id": "6f0ad6b2-e9e1-4ca7-a03e-84cdbdb9f89a",
        "group_id": "2f8fdea3-b875-4926-90c8-5a1b11b818c8",
        "status": "new",
        "tracking_code": null,
        "status_note": "",
        "fulfillment_type": null,
        "printer_id": null,
        "printer_group_id": null,
        "charge": null,
        "charge_id": null,
        "is_chargeable": null,
        "address_line_1": "957 Main View Drive",
        "address_line_2": "",
        "zipcode": "33410",
        "city": "Ville",
        "state": "texas",
        "country": "US",
        "delivery_instructions": "",
        "deleted_at": null,
        "created_at": "2019-08-16T13:13:00.000Z",
        "updated_at": null,
        "components": [
            {
                "spec": {
                    "id": "9364e733-78cc-48ca-ad10-fb3e1fc5924f",
                    "component_id": "91a84a1e-a44a-45ee-a6ca-25512c6046e4",
                    "job_id": "6f0ad6b2-e9e1-4ca7-a03e-84cdbdb9f89a",
                    "resolution": "30",
                    "material": "PLA",
                    "color": "blue",
                    "process": "FDM",
                    "infill": 60,
                    "print_charge": null,
                    "charge": null,
                    "component_stl_version": null,
                    "component_stl_id": null,
                    "source_object_id": null,
                    "source_object_index": null,
                    "source_object_index_of": null,
                    "source_object_componet_index": null,
                    "source_object_componet_index_of": null
                },
                "id": "91a84a1e-a44a-45ee-a6ca-25512c6046e4",
                "created_by": "aaaaaaaa-9a34-4466-ba4c-46438def7d7f",
                "group_id": "2f8fdea3-b875-4926-90c8-5a1b11b818c8",
                "is_public": true,
                "name": "Bolt",
                "image": "https://ideea.io/static/img/bolt.png",
                "description": null,
                "source": null,
                "star_count": 0,
                "download_count": 0,
                "resolution": "100",
                "material": "PLA",
                "color": "blue",
                "process": "FDM",
                "infill": 15,
                "stl_version": 0,
                "stl_id": null,
                "deleted_at": null,
                "created_at": "2019-08-16T13:13:00.000Z",
                "updated_at": null
            },
            {
                "spec": {
                    "id": "f21bc08d-8acc-408c-86e6-072fc6699dd7",
                    "component_id": "ede74cb5-6da1-471a-bcb7-e65d482f395c",
                    "job_id": "6f0ad6b2-e9e1-4ca7-a03e-84cdbdb9f89a",
                    "resolution": "30",
                    "material": "PLA",
                    "color": "blue",
                    "process": "FDM",
                    "infill": 60,
                    "print_charge": null,
                    "charge": null,
                    "component_stl_version": null,
                    "component_stl_id": null,
                    "source_object_id": null,
                    "source_object_index": null,
                    "source_object_index_of": null,
                    "source_object_componet_index": null,
                    "source_object_componet_index_of": null
                },
                "id": "ede74cb5-6da1-471a-bcb7-e65d482f395c",
                "created_by": "aaaaaaaa-9a34-4466-ba4c-46438def7d7f",
                "group_id": "2f8fdea3-b875-4926-90c8-5a1b11b818c8",
                "is_public": true,
                "name": "Nut",
                "image": "https://ideea.io/static/img/nut.png",
                "description": null,
                "source": null,
                "star_count": 0,
                "download_count": 0,
                "resolution": "100",
                "material": "PLA",
                "color": "blue",
                "process": "FDM",
                "infill": 15,
                "stl_version": 0,
                "stl_id": null,
                "deleted_at": null,
                "created_at": "2019-08-16T13:13:00.000Z",
                "updated_at": null
            }
        ]
    },
    "meta": {},
    "status": "ok"
}

To create a new job make a post request to /api/v1/jobs/create. This will create the job with the provided data.

HTTP Endpoint

POST http://3ps.ideea.io/api/v1/jobs/create

Request Payload

Parameter Required Description
group_id true The group ID that this job will belong to
fulfillment_type false Job fulfillment type. Set this to 'asap' for expedited shipping. Default 'standard'
address_type true Specity the type of address you would like to use. This can be 'custom', 'saved' or 'default'.
address_id false Deliver to a saved address
address.address_line_1 false Custom address
address.address_line_2 false Custom address
address.zipcode false Custom address
address.city false Custom address
address.state false Custom address
address.country false Custom address
address.delivery_instructions false Custom address
components true Array of components to print
components[].id true The component ID
components[].process false Overwrite default component printing process
components[].resolution false Overwrite default component resolution
components[].material false Overwrite default component material
components[].color false Overwrite default component color
components[].infill false Overwrite default component infill
objects true Array of objects
objects[].id true The object ID
objects[].process false Overwrite default object printing process
objects[].resolution false Overwrite default object resolution
objects[].material false Overwrite default object material
objects[].color false Overwrite default object color
objects[].infill false Overwrite default object infill

Get Job By ID

GET /api/v1/jobs/{job_id}

tps.jobs.get('6f0ad6b2-e9e1-4ca7-a03e-84cdbdb9f89a').then((job) => {
  console.log(job);
})
<?php

$job = $tps->jobs->get('6f0ad6b2-e9e1-4ca7-a03e-84cdbdb9f89a');
curl 'https://3ps.ideea.io/api/v1/jobs/6f0ad6b2-e9e1-4ca7-a03e-84cdbdb9f89a' \
  -X GET \
  -H 'Authorization: Bearer ACCESS_TOKEN'

Response

{
    "data": {
        "id": "6f0ad6b2-e9e1-4ca7-a03e-84cdbdb9f89a",
        "group_id": "2f8fdea3-b875-4926-90c8-5a1b11b818c8",
        "status": "new",
        "tracking_code": null,
        "status_note": "",
        "fulfillment_type": null,
        "printer_id": null,
        "printer_group_id": null,
        "charge": null,
        "charge_id": null,
        "is_chargeable": null,
        "address_line_1": "957 Main View Drive",
        "address_line_2": "",
        "zipcode": "33410",
        "city": "Ville",
        "state": "texas",
        "country": "US",
        "delivery_instructions": "",
        "deleted_at": null,
        "created_at": "2019-08-16T13:13:00.000Z",
        "updated_at": null,
        "components": [
            {
                "spec": {
                    "id": "9364e733-78cc-48ca-ad10-fb3e1fc5924f",
                    "component_id": "91a84a1e-a44a-45ee-a6ca-25512c6046e4",
                    "job_id": "6f0ad6b2-e9e1-4ca7-a03e-84cdbdb9f89a",
                    "resolution": "30",
                    "material": "PLA",
                    "color": "blue",
                    "process": "FDM",
                    "infill": 60,
                    "print_charge": null,
                    "charge": null,
                    "component_stl_version": null,
                    "component_stl_id": null,
                    "source_object_id": null,
                    "source_object_index": null,
                    "source_object_index_of": null,
                    "source_object_componet_index": null,
                    "source_object_componet_index_of": null
                },
                "id": "91a84a1e-a44a-45ee-a6ca-25512c6046e4",
                "created_by": "aaaaaaaa-9a34-4466-ba4c-46438def7d7f",
                "group_id": "2f8fdea3-b875-4926-90c8-5a1b11b818c8",
                "is_public": true,
                "name": "Bolt",
                "image": "https://ideea.io/static/img/bolt.png",
                "description": null,
                "source": null,
                "star_count": 0,
                "download_count": 0,
                "resolution": "100",
                "material": "PLA",
                "color": "blue",
                "process": "FDM",
                "infill": 15,
                "stl_version": 0,
                "stl_id": null,
                "deleted_at": null,
                "created_at": "2019-08-16T13:13:00.000Z",
                "updated_at": null
            },
            {
                "spec": {
                    "id": "f21bc08d-8acc-408c-86e6-072fc6699dd7",
                    "component_id": "ede74cb5-6da1-471a-bcb7-e65d482f395c",
                    "job_id": "6f0ad6b2-e9e1-4ca7-a03e-84cdbdb9f89a",
                    "resolution": "30",
                    "material": "PLA",
                    "color": "blue",
                    "process": "FDM",
                    "infill": 60,
                    "print_charge": null,
                    "charge": null,
                    "component_stl_version": null,
                    "component_stl_id": null,
                    "source_object_id": null,
                    "source_object_index": null,
                    "source_object_index_of": null,
                    "source_object_componet_index": null,
                    "source_object_componet_index_of": null
                },
                "id": "ede74cb5-6da1-471a-bcb7-e65d482f395c",
                "created_by": "aaaaaaaa-9a34-4466-ba4c-46438def7d7f",
                "group_id": "2f8fdea3-b875-4926-90c8-5a1b11b818c8",
                "is_public": true,
                "name": "Nut",
                "image": "https://ideea.io/static/img/nut.png",
                "description": null,
                "source": null,
                "star_count": 0,
                "download_count": 0,
                "resolution": "100",
                "material": "PLA",
                "color": "blue",
                "process": "FDM",
                "infill": 15,
                "stl_version": 0,
                "stl_id": null,
                "deleted_at": null,
                "created_at": "2019-08-16T13:13:00.000Z",
                "updated_at": null
            }
        ]
    },
    "meta": {},
    "status": "ok"
}

This endpoint will retrun a job by it's ID

HTTP Endpoint

GET https://3ps.ideea.io/api/v1/jobs/{job_id}

Cancel a Job

DELETE /api/v1/jobs/{job_id}/cancel

tps.jobs.cancel('2e79a2df-25e7-4a61-8e8e-f29bb96a3550')
.then((canceledJob) => {
  console.log(canceledJob);
})
<?php

$canceledJob = $tps->jobs->cancel('2e79a2df-25e7-4a61-8e8e-f29bb96a3550');

curl 'http://3ps.ideea.local/api/v1/jobs/2e79a2df-25e7-4a61-8e8e-f29bb96a3550/cancel' \
  -X DELETE \
  -H 'Authorization: Bearer ACCESS_TOKEN'

Response

{
    "data": {
        "id": "f8284c75-74d6-4fcb-b2ff-608a9db01c28",
    },
    "meta": {},
    "status": "ok"
}

To cancel a job make a DELETE request to /jobs/{job_id}/cancel. A job can only be canceld before printing has started.

HTTP Endpoint

DELETE https://3ps.ideea.io/api/v1/jobs/{job_id}/cancel

Get Job Events

GET /api/v1/jobs/{job_id}/events

tps.jobs.getEvents('6f0ad6b2-e9e1-4ca7-a03e-84cdbdb9f89a').then((job) => {
  console.log(job);
})
<?php

$job = $tps->jobs->getEvents('6f0ad6b2-e9e1-4ca7-a03e-84cdbdb9f89a');
curl 'https://3ps.ideea.io/api/v1/jobs/6f0ad6b2-e9e1-4ca7-a03e-84cdbdb9f89a/events' \
  -X GET \
  -H 'Authorization: Bearer ACCESS_TOKEN'

Response

{
    "data": [
        {
            "id": "3b6cf2b7-96fd-4a90-adcf-ca3b912bc9e8",
            "job_id": "6f0ad6b2-e9e1-4ca7-a03e-84cdbdb9f89a",
            "user_id": null,
            "author": null,
            "type": null,
            "title": "Order Recived",
            "body": "",
            "created_at": "2019-08-16T13:13:00.000Z",
            "updated_at": null
        }
    ],
    "meta": {},
    "status": "ok"
}

This endpoint will retrun a job by it's ID

HTTP Endpoint

GET https://3ps.ideea.io/api/v1/jobs/{job_id}

Addresses

Create Address

POST /api/v1/addresses/create

tps.addresses.create({
    group_id: 'a0ffedbb-ff29-5138-9b5d-cd1f6ae3bc6b',
    name: 'The Office',
    address_line_1: '30 Apple Street',
    address_line_2: '',
    zipcode: '78704',
    city: 'Austin',
    state: 'TX',
    country: 'United States',
    delivery_instructions: '',
}).then((newAddress) => {
  console.log(newAddress);
})
<?php

$newAddress = $tps->addresses->create([
    'group_id' => 'a0ffedbb-ff29-5138-9b5d-cd1f6ae3bc6b',
    'name' => 'The Office',
    'address_line_1' => '30 Apple Street',
    'address_line_2' => '',
    'zipcode' => '78704',
    'city' => 'Austin',
    'state' => 'TX',
    'country' => 'United States',
    'delivery_instructions' => '',
]);
curl 'http://3ps.ideea.io/api/v1/addresses/create' \
  -X POST \
  -H 'Authorization: Bearer ACCESS_TOKEN' \
  -H 'Content-Type: application/x-www-form-urlencoded' \
  -F 'group_id=a0ffedbb-ff29-5138-9b5d-cd1f6ae3bc6b',
  -F 'name=The Office',
  -F 'address_line_1=30 Apple Street',
  -F 'address_line_2=',
  -F 'zipcode=78704',
  -F 'city=Austin',
  -F 'state=TX',
  -F 'country=United States',
  -F 'delivery_instructions=',

Response

{
    "data": {
        "id": "9c56205e-c669-4e81-ab74-83d8142f0d57",
        "group_id": "a0ffedbb-ff29-5138-9b5d-cd1f6ae3bc6b",
        "name": "Test",
        "address_line_1": "15 Fourth Av",
        "address_line_2": "",
        "zipcode": "TQ149DS",
        "city": "Teignmouth",
        "country": "UK",
        "state": "devon",
        "is_default": false,
        "delivery_instructions": "",
        "updated_at": "2019-08-16T13:58:09.180Z",
        "created_at": "2019-08-16T13:58:09.180Z",
        "deleted_at": null
    },
    "meta": {},
    "status": "ok"
}

To create a new address make a post request to /api/v1/addresses/create. This will create the address with the provided data.

HTTP Endpoint

POST http://3ps.ideea.io/api/v1/addresses/create

Request Payload

Parameter Required Description
group_id true The group ID that this address will belong to
name true Name of the address
address_line_1 true Address line 1
address_line_2 false Address line 2
zipcode true Zipcode
city true City
state true State
country true Country
delivery_instructions false Delivery instructions

Get Addresses By Group ID

GET /api/v1/addresses/group/{group_id}

tps.addresses.getByGroupID('a0ffedbb-ff29-5138-9b5d-cd1f6ae3bc6b').then((addresses) => {
  console.log(addresses);
})
<?php

$addresses = $tps->addresses->getByGroupID('a0ffedbb-ff29-5138-9b5d-cd1f6ae3bc6b');
curl 'https://3ps.ideea.io/api/v1/addresses/group/a0ffedbb-ff29-5138-9b5d-cd1f6ae3bc6b' \
  -X GET \
  -H 'Authorization: Bearer ACCESS_TOKEN'

Response

{
    "data": [
        {
            "id": "9c56205e-c669-4e81-ab74-83d8142f0d57",
            "group_id": "a0ffedbb-ff29-5138-9b5d-cd1f6ae3bc6b",
            "name": "The Office",
            "address_line_1": "30 Apple Street",
            "address_line_2": "",
            "zipcode": "78704",
            "city": "Austin",
            "state": "TX",
            "country": "United States",
            "delivery_instructions": "",
            "is_default": false,
            "updated_at": "2019-08-16T13:58:09.180Z",
            "created_at": "2019-08-16T13:58:09.180Z",
            "deleted_at": null
        }
    ],
    "meta": {},
    "status": "ok"
}

This endpoint returns all of the group's addresses

HTTP Endpoint

GET https://3ps.ideea.io/api/v1/addresses/group/{group_id}

Get Address By ID

GET /api/v1/addresses/{address_id}

tps.addresses.get('9c56205e-c669-4e81-ab74-83d8142f0d57').then((address) => {
  console.log(address);
})
<?php

$address = $tps->addresses->get('9c56205e-c669-4e81-ab74-83d8142f0d57');
curl 'https://3ps.ideea.io/api/v1/addresses/9c56205e-c669-4e81-ab74-83d8142f0d57' \
  -X GET \
  -H 'Authorization: Bearer ACCESS_TOKEN'

Response

{
    "data": {
        "id": "9c56205e-c669-4e81-ab74-83d8142f0d57",
        "group_id": "a0ffedbb-ff29-5138-9b5d-cd1f6ae3bc6b",
        "name": "The Office",
        "address_line_1": "30 Apple Street",
        "address_line_2": "",
        "zipcode": "78704",
        "city": "Austin",
        "state": "TX",
        "country": "United States",
        "delivery_instructions": "",
        "is_default": false,
        "updated_at": "2019-08-16T13:58:09.180Z",
        "created_at": "2019-08-16T13:58:09.180Z",
        "deleted_at": null
    },
    "meta": {},
    "status": "ok"
}

This endpoint will retrun a address by it's ID

HTTP Endpoint

GET https://3ps.ideea.io/api/v1/addresses/{address_id}

Update Address

POST /api/v1/addresses/{address_id}

tps.addresses.update('9c56205e-c669-4e81-ab74-83d8142f0d57', {
    name: 'New Name',
    address_line_1: '30 Apple Street',
    address_line_2: '',
    zipcode: '78704',
    city: 'Austin',
    state: 'TX',
    country: 'United States',
    delivery_instructions: '',
}).then((updatedAddress) => {
  console.log(updatedAddress);
})
<?php

$updatedAddress = $tps->addresses->update('2e79a2df-25e7-4a61-8e8e-f29bb96a3550', [
    'name' => 'New Name',
    'address_line_1' => '30 Apple Street',
    'address_line_2' => '',
    'zipcode' => '78704',
    'city' => 'Austin',
    'state' => 'TX',
    'country' => 'United States',
    'delivery_instructions' => '',
]);
curl 'http://3ps.ideea.io/api/v1/addresses/2e79a2df-25e7-4a61-8e8e-f29bb96a3550' \
  -X POST \
  -H 'Authorization: Bearer ACCESS_TOKEN' \
  -H 'Content-Type: application/x-www-form-urlencoded' \
  -F 'name=New Name' \
  -F 'address_line_1=30 Apple Street' \
  -F 'address_line_2=' \
  -F 'zipcode=78704' \
  -F 'city=Austin' \
  -F 'state=TX' \
  -F 'country=United States' \
  -F 'delivery_instructions=' 

Response

{
    "data": {
        "id": "2e79a2df-25e7-4a61-8e8e-f29bb96a3550",
        "group_id": "2f8fdea3-b875-4926-90c8-5a1b11b818c8",
        "name": "Test",
        "address_line_1": "15 Fourth Av",
        "address_line_2": "",
        "zipcode": "TQ149DS",
        "city": "Teignmouth",
        "country": "UK",
        "state": "devon",
        "is_default": false,
        "delivery_instructions": "",
        "updated_at": "2019-08-16T13:58:09.180Z",
        "created_at": "2019-08-16T13:58:09.180Z",
        "deleted_at": null
    },
    "meta": {},
    "status": "ok"
}

To update an existing address make a post request to /api/v1/addresses/{address_id}. This will update the address with the provided data.

HTTP Endpoint

POST http://3ps.ideea.io/api/v1/addresses/{address_id}

Request Payload

Parameter Required Description
name false Name of the address
address_line_1 false Address line 1
address_line_2 false Address line 2
zipcode false Zipcode
city false City
state false State
country false Country
delivery_instructions false Delivery instructions

Set Address as Default

POST /api/v1/addresses/{address_id}/default

tps.addresses.setDefault('2e79a2df-25e7-4a61-8e8e-f29bb96a3550')
.then((default) => {
  console.log(default);
})
<?php

$default = $tps->addresses->setDefault('2e79a2df-25e7-4a61-8e8e-f29bb96a3550');

curl 'http://3ps.ideea.local/api/v1/addresses/2e79a2df-25e7-4a61-8e8e-f29bb96a3550/default' \
  -X POST \
  -H 'Authorization: Bearer ACCESS_TOKEN'

Response

{
    "data": {
        "id": "2e79a2df-25e7-4a61-8e8e-f29bb96a3550",
    },
    "meta": {},
    "status": "ok"
}

To set an address as your default address make a post request to /addresses/{address_id}/default.

HTTP Endpoint

POST http://3ps.ideea.io/api/v1/addresses/{address_id}/default

Delete a Address

DELETE /api/v1/addresses/{address_id}/delete

tps.addresses.delete('2e79a2df-25e7-4a61-8e8e-f29bb96a3550')
.then((deletedAddress) => {
  console.log(deletedAddress);
})
<?php

$deletedAddress = $tps->addresses->delete('2e79a2df-25e7-4a61-8e8e-f29bb96a3550');

curl 'http://3ps.ideea.local/api/v1/addresses/2e79a2df-25e7-4a61-8e8e-f29bb96a3550/delete' \
  -X DELETE \
  -H 'Authorization: Bearer ACCESS_TOKEN'

Response

{
    "data": {
        "id": "f8284c75-74d6-4fcb-b2ff-608a9db01c28",
    },
    "meta": {},
    "status": "ok"
}

To delete a address make a DELETE request to /addresses/{address_id}/delete

HTTP Endpoint

DELETE http://3ps.ideea.io/api/v1/addresses/{address_id}/delete

Errors

The Ideea API uses the following error codes:

Error Code Meaning
400 Bad Request -- Your request is invalid.
401 Unauthorized -- Your API key is wrong.
403 Forbidden -- The kitten requested is hidden for administrators only.
404 Not Found -- The specified kitten could not be found.
405 Method Not Allowed -- You tried to access a kitten with an invalid method.
406 Not Acceptable -- You requested a format that isn't json.
410 Gone -- The kitten requested has been removed from our servers.
418 I'm a teapot.
429 Too Many Requests -- You're requesting too many kittens! Slow down!
500 Internal Server Error -- We had a problem with our server. Try again later.
503 Service Unavailable -- We're temporarily offline for maintenance. Please try again later.