Resource

Get Resource JSON Format

GET http://localhost/api_v1/targets/:target_name:/resources/:resource_id:.json/

This endpoint allows you to get the details of a resource with a given resource_id in JSON format

Path Parameters

NameTypeDescription

target_name

string

Name of the Target

resource_id

string

ID of the Resource

Headers

NameTypeDescription

presqt-source-token

string

User's Target Token

{
    "kind": "item",
    "kind_name": "file",
    "id": "5cd98518f244ec001ee8606b",
    "title": "23296359282_934200ec59_o.jpg",
    "date_created": "2019-05-13T14:54:17.129170Z",
    "date_modified": "2019-05-13T14:54:17.129170Z",
    "hashes": {
        "md5": "aaca7ef067dcab7cb8d79c36243823e4",
        "sha256": "ea94ce54261720c16abb508c6dcd1fd481c30c09b7f2f5ab0b79e3199b7e2b55"
    },
    "extra": {
        "last_touched": null,
        "materialized_path": "/Images/23296359282_934200ec59_o.jpg",
        "current_version": 1,
        "provider": "osfstorage",
        "path": "/5cd98518f244ec001ee8606b",
        "current_user_can_comment": true,
        "guid": null,
        "checkout": null,
        "tags": [],
         "size": 1773294,
    },
    "download_url": http://localhost/api_v1/targets/osf/resources/5cd98518f244ec001ee8606b.zip/" 
}

Get Resource Zip Format

GET http://localhost/api_v1/targets/:target_name:/resources/:resource_id:.zip/

This endpoint allows you to get the resource with the given resource_if as a ZIP file.

Path Parameters

NameTypeDescription

target_name

string

Name of the Target

resource_id

string

ID of the Resource

Headers

NameTypeDescription

presqt-source-token

string

User's Target Token

Upload Resource To Container

POST http://localhost/api_v1/targets/:target_name:/resources/:resource_id:/

This endpoint allows you to upload resources to an existing container

Path Parameters

NameTypeDescription

target_name

string

Name of the Target

resource_id

string

ID of the Resource

Headers

NameTypeDescription

duplicate-file-action

string

Flag for handling file duplication. Must be either 'ignore' or 'update'.

presqt-detination-token

string

User's token for the destination target

Request Body

NameTypeDescription

presqt-file

object

Zip of the resources to upload

{
    "ticket_number": "some_uuid"
    "message": "The server is processing the request."
}

Last updated