Create a marker

As seen before, Basic Authentication header should be set to authenticate every call to the API. Please read this article for more details.

BEAR API being a REST one (look here for more details), we will have to use a POST request to create a marker.

In order to create a new marker you must first know the ID of the campaign which the marker will be added to. Learn how to create a new campaign here. To get a list of existing campaigns, you can call GET

There are 2 options to provide actual image to be used as a marker - over URL or by selecting file from the local drive.


Creating marker from an URL (example is written in JavaScript with jQuery)

var user = 'user';

var password = 'test';

var auth = "Basic " + btoa(user + ":" + password); 

var urlApi = '';

// Users allowed to add markers to their own campaigns or to campaigns of their company

var campaignId = 649; // user's campaign (Your First Campaign)

// Note: you can get list of your campaings by calling GET 

var params = {





   processData: true,

   type: 'POST',

   url: urlApi,

   headers: {"Authorization": auth},

   data: JSON.stringify(params),

   dataType: 'json',

   success: function(data){

       var marker = data[0];


       $('body').html('#' + ' ' + marker.page_num);


   error: function(data){

       $('body').html( 'Marker has been created!' );

       $('body').html( data.responseJSON.error + ' ' + data.responseJSON.description );




Sending marker from file

<form action="" method="POST" enctype="multipart/form-data">

   <p>campaign id:<input name="book_id" type="text" value="649"/></p>

   <p>marker:<input name="file" type="file" /></p>

   <p><button type="submit">Submit</button></p>




Please sign in to leave a comment.