Create an asset

Create a new Asset

Add a new asset to the application.
Below is an example that creates a JSON asset containing the following data

{
  "foo" : "bar"
}

Before creating this asset, we need to first convert the asset data into a Base64 encoded string. The encoded string can then be set to the content field of the JSON payload object used to create the asset.

curl -i --user "543cce56-c950-4c7f-9dcc-53bcb3e90a4a:Mry2oK3GSjy78O2WyORgJQ" -X PUT -H "Content-Type: application/json" https://api.lumenpath.com/api/asset/c0eb26da-f39e-4211-9964-095d020dfe7b/asset/ -d '{"content_type": "application/javascript", "metadata": {"default": {"name": "Test Json"}},  "content": "ew0KICAiZm9vIiA6ICJiYXIiDQp9"}'

Response
========
{"id":"92a572b1-35ea-40e1-a871-0934efeb210a","created_on":"2014-11-07T20:04:45.872Z","modified_on":"2014-11-07T20:04:45.872Z","content_type":"application/javascript","size":21,"metadata":{"default":{"name":"Test Json"}},"content_url":"https://api.lumenpath.com/api/asset/543cce56-c950-4c7f-9dcc-53bcb3e90a4a/asset/92a572b1-35ea-40e1-a871-0934efeb210a/content/"}

#Retrieve the contents of the asset fron content_url
curl -v -i --user "543cce56-c950-4c7f-9dcc-53bcb3e90a4a:Mry2oK3GSjy78O2WyORgJQ" https://api.lumenpath.com/api/asset/543cce56-c950-4c7f-9dcc-53bcb3e90a4a/asset/92a572b1-35ea-40e1-a871-0934efeb210a/content/

Response
========
> GET /api/asset/1:543cce56-c950-4c7f-9dcc-53bcb3e90a4a/asset/92a572b1-35ea-40e1-a871-0934efeb210a/content/ HTTP/1.1
> Authorization: Basic NTQzY2NlNTYtYzk1MC00YzdmLTlkY2MtNTNiY2IzZTkwYTRhOm0zS0l5SmhhU0pLbS1uR0RCSFdYekE=
...
...
< HTTP/1.1 200 OK
< Content-Length: 21
< Content-Type: application/javascript
....
{
  "foo" : "bar"
}
Language
Credentials
Basic
base64
: