Skip to content

Endpoints

Sakib Sami edited this page Aug 7, 2017 · 14 revisions

Endpoints

1. Create Bucket [ POST -> /api/v1/bucket/create ]

Request # application/json

{
    "bucket_name": "my bucket name"
}

Header : [ "user_hash": "user_hash_id", "access_token": "user_access_token" ]

Response #

{
    "code": 200,
    "response": "success",
    "message": "{bucket-name} has been created."
}

or

{
    "code": 201,
    "response": "failed"
}

2. List Buckets [ GET -> /api/v1/bucket/list ]

Header : [ "user_hash": "user_hash_id", "access_token": "user_access_token" ]

Response #

{
    "code": 200,
    "response": "success",
    "data": [
         {
             "bucket_name": "my bucket name 1",
             "bucket_creation_date": 2132312312
         },
         {
             "bucket_name": "my bucket name 2",
             "bucket_creation_date": 2132312312
         },
         {
             "bucket_name": "my bucket name 3",
             "bucket_creation_date": 2132312312
         }
         .....
    ]
}

or

{
    "code": 201,
    "response": "failed"
}

3. Remove Bucket [ DELETE -> /api/v1/bucket/remove/{bucket-name} ]

Header : [ "user_hash": "user_hash_id", "access_token": "user_access_token" ]

Response #

{
    "code": 200,
    "response": "success",
    "message": "{bucket-name} has been removed.",
    "data": true
}

or

{
    "code": 201,
    "response": "failed"
}

4. Check Bucket [ GET -> /api/v1/bucket/check/{bucket-name} ]

Header : [ "user_hash": "user_hash_id", "access_token": "user_access_token" ]

Response #

{
    "code": 200,
    "response": "success",
    "message": "{bucket-name} exists.",
    "data": true
}

or

{
    "code": 201,
    "response": "failed"
}

5. Create Object [ POST -> /api/v1/{bucket-name}/object/create ]

Request # File as multipart data

Header : [ "user_hash": "user_hash_id", "access_token": "user_access_token" ]

Response #

{
    "code": 200,
    "response": "success",
    "message": "{object-name} has been created."
    "data": {
         "object_name": "{object_name}",
         "object_url": "{object_url}"
    }
}

or

{
    "code": 201,
    "response": "failed"
}

6. List Objects [ GET -> /api/v1/{bucket-name}/object/list ]

Header : [ "user_hash": "user_hash_id", "access_token": "user_access_token" ]

Response #

{
    "code": 200,
    "response": "success",
    "data": [
        {
            "object_name": "{object_name_1}",
            "object_size": "{1MB}",
            "object_modified": "{object_modified_date}"
        },
        {
            "object_name": "{object_name_1}",
            "object_size": "{1MB}",
            "object_modified": "{object_modified_date}"
        },
        {
            "object_name": "{object_name_1}",
            "object_size": "{1MB}",
            "object_modified": "{object_modified_date}"
        },
        .......
    ]
}

or

{
    "code": 201,
    "response": "failed"
}

7. Remove Object [ DELETE -> /api/v1/{bucket-name}/object/remove ]

Header : [ "user_hash": "user_hash_id", "access_token": "user_access_token" ]

Request # application/json

{
    "object_name": "my object name"
}

Response #

{
    "code": 200,
    "response": "success",
    "message": "{object-name} has been removed."
}

or

{
    "code": 201,
    "response": "failed"
}

8. Stats Object [ GET -> /api/v1/{bucket-name}/object/stats/{object-name} ]

Header : [ "user_hash": "user_hash_id", "access_token": "user_access_token" ]

Response #

{
    "code": 200,
    "response": "success",
    "data": {
        "object_name": "{object_name}"
    }
}

or

{
    "code": 201,
    "response": "failed"
}

9. List Incomplete upload objects [ GET -> /api/v1/object/list/incomplete ]

10. Remove Incomplete upload objects [ DELETE -> /api/v1/object/remove/incomplete ]

11. Get object [ GET -> /api/v1/bucket/{bucket-name}/object/{object-name} ]

Header : [ "user_hash": "user_hash_id", "access_token": "user_access_token" ]

Response # Raw File Stream

Clone this wiki locally