As always, to authenticate a call Basic Authentication header should be set. See this TNO for details.
As soon as BEAR API is REST one (read here for details), to create an asset we have to use POST request to assets.
To create an assets you have to know ID of the marker this asset will be added to. See how to create a marker here. To get list of markers, you can call GET http://apidev.bear2b.com/markers?book_id=
There are few types of assets can be created in BEAR:
ID | name | type | Description |
---|---|---|---|
1 | file | media | 3D object |
2 | button | ||
3 | url | button | URL button |
4 | phone | button | Phone button |
5 | video | media | Video |
6 | image | media | Image |
7 | Webview | media | Web-view |
9 | audio | media | Audio |
10 | vcard | button | vCard |
11 | button | ||
12 | button | ||
13 | agenda | button | Agenda |
14 | file | media | File |
Assets positioning is quite tricky and described in dedicated document here.
Code snippets:
We will work with marker #21187 of campaign #649
Create 3D object asset
Video(asset_type=5) and image(asset_type=6) created similarly. The only difference is another asset_type.
File-android used for 3D objects only.
Live example here
Create Email asset
url (asset_type=3), phone(asset_type=4) and text(asset_type=8) created similarly. The only difference is another asset_type
Live example here
Comments
Please sign in to leave a comment.