Accessing a namespace with the REST API

Content Platform Tenant Management Help

Version
9.7.x
File Size
4269 KB
Audience
anonymous
Part Number
MK-95HCPH002-19

For access to namespaces, HCP supports a RESTful implementation of HTTP called the REST API. To access a namespace through this protocol, you can write applications that use any standard HTTP client library, or you can use a command-line tool, such as cURL, that supports HTTP. You can also use a web browser to access the namespace. The namespace configuration determines whether you need to use HTTP with SSL (HTTPS).

Using the REST API, you can store, view, retrieve, and delete objects. You can specify certain metadata when you store new objects and change the metadata for existing objects. You can add, replace, and delete custom metadata and ACLs and retrieve information about namespaces.

The REST API is compliant with HTTP/1.1, as specified by RFC 2616.

For you to access a namespace using the REST API, the API must be enabled in the namespace configuration. If you cannot use the REST API to access the namespace, contact your tenant administrator.

This chapter explains how to use the REST API to access and perform operations in namespaces.

The REST API examples in this book use cURL and Python with PycURL, a Python and Java® interface that uses the libcurl library. cURL and PycURL are both freely available open-source software. You can download them from http://curl.haxx.se.

Note: In version 7.12.1 of PycURL, the PUT method was deprecated and replaced with UPLOAD. The Python examples in this book show UPLOAD but work equally well with PUT.