Skip to content

Commit

Permalink
updated RICOH360 Cloud API example
Browse files Browse the repository at this point in the history
  • Loading branch information
codetricity committed Nov 14, 2024
1 parent b553326 commit fc007b6
Showing 1 changed file with 28 additions and 4 deletions.
32 changes: 28 additions & 4 deletions docs/cloudapi.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,12 +6,28 @@ The RICOH360 Viewer uses the RICOH360 Cloud API.
All the demonstrations use the content API to get a list
of images with their associated content_id.

Although the transformations such as enhancement are
in the viewer API, other transforms may require direct calls
to the Cloud API.
This is an example of using the RICOH360 Cloud API to get
a listing of
40 images. In the example below, `get_token_for_cloud_content()` is
a method that I made to access Amazon Cognito to get a RICOH360
Cloud token.

```python
# Function to query content from the RICOH360 API
def get_content():
get_token_for_cloud_content()
cloud_content_token = session["ricoh_cloud_token"]
# Fetch content using the token
content_headers = {"Authorization": f"Bearer {cloud_content_token}"}
content_response = requests.get(
"https://api.ricoh360.com/contents?limit=40", headers=content_headers
)
content_data = content_response.json()
return content_data
```

When using the RICOH360 Viewer to do the transform, you
add the name of the enhancement after the property `transform`.
add the name of the transform, `enhancement`, after the property `transform`.

```javascript
viewer.switchScene(
Expand All @@ -22,6 +38,14 @@ viewer.switchScene(
)
```

Once the RICOH360 Viewer is set up, the API is nice and easy.
You can see from the example above, that the transform and placement
of the image to the right pane, index 1, is very easy.

Although the transformations such as enhancement are
in the viewer API, other transforms may require direct calls
to the Cloud API.

You can also do transforms that are not available through the
viewer.

Expand Down

0 comments on commit fc007b6

Please sign in to comment.