MobAppCreator API

Bearer Authentication

Bearer authentication (also called token authentication) is an HTTP authentication scheme that involves security tokens called bearer tokens. The name “Bearer authentication” can be understood as “give access to the bearer of this token.” The bearer token is a cryptic string, usually generated by the server in response to a login request. The client must send this token in the Authorization header when making requests to protected resources:

Authorization: Bearer <token>

The Bearer authentication scheme was originally created as part of OAuth 2.0 in RFC 6750, but is sometimes also used on its own. Similarly to Basic authentication, Bearer authentication should only be used over HTTPS (SSL).

Getting Token

Remove authorization (delete Token)

API methods

List app items

curl --request GET --header 'Authorization: Bearer MOBAPP_API_TOKEN' https://app.mobappcreator.com/api/items

List screen items

curl --request GET --header 'Authorization: Bearer MOBAPP_API_TOKEN' https://app.mobappcreator.com/api/items/?screenId=SCREEN_ID

How do I get my SCREEN_ID?

Get item

curl --request GET --header 'Authorization: Bearer MOBAPP_API_TOKEN' https://app.mobappcreator.com/api/items/item_id

You can get the item_id by calling the List item API call.

Create item

curl --request POST -H 'Content-Type: application/json' -H 'Authorization: Bearer MOBAPP_API_TOKEN' --data @item.json https://app.mobappcreator.com/api/items

Item.json contents:

News item

{
   "screenId": "SCREEN_ID",
   "title": "my test title",
   "subtitle": "my test subtitle",
   "extraData": {
      "image": "image_url",
   }
}
Map item
{
   "screenId": "SCREEN_ID",
   "title": "my test title",
   "subtitle": "my test subtitle",
   "extraData": {
      "address": "MyStreet 333, Miami, FL"
      "image": "image_url",
      "lng": "-80.2994996",
      "lat": "25.7823907"
   }
}
Product item

{
   “screenId”: “SCREEN_ID”,
   “title”: “my test title”,
   “subtitle”: “my test subtitle”,
   “extraData”: {
      “price”: “100”,
      “stock”: 1,
      “sku”: “SKU_NUMBER”,
      “image”: “image_url”,
   }
}

Update item

curl --request PUT -H 'Content-Type: application/json' -H 'Authorization: Bearer MOBAPP_API_TOKEN' --data @item.json https://app.mobappcreator.com/api/items/item_id

You can get the item_id by calling the List item API call.

Item.json contents (just include what you need to update):

{
  "title": "my updated test title",
  "subtitle": "my updated test subtitle",
  "extraData": {
    "address": "",
    "price": "",
    "stock": "",
    "sku": "",
    "image": "",
    "lng": "",
    "lat": ""
  }
}

Get Users

curl --request GET --header 'Authorization: Bearer MOBAPP_API_TOKEN' https://app.mobappcreator.com/api/users

Create User

curl --request POST -H 'Content-Type: application/json' -H 'Authorization: Bearer MOBAPP_API_TOKEN' --data @user.json https://app.mobappcreator.com/api/users

user.json content

{
   "password": "mysecretpassword",
   "email": "test@mail.com",
   "name": "test user",
   "tester": false,
   "disabled": false
}

Update User

curl --request PUT -H 'Content-Type: application/json' -H 'Authorization: Bearer MOBAPP_API_TOKEN' --data @user.json https://app.mobappcreator.com/api/users/user_id

Where user_id is the uid from the user object. You can get a list of user objects by calling the Get Users API call.

user.json content (just include what you need to update)

{
"password": "mysecretpassword",
"name": "test user",
"tester": false,
"disabled": false
}

Create notification

curl --request POST -H 'Content-Type: application/json' -H 'Authorization: Bearer MOBAPP_API_TOKEN' --data @notification.json https://app.mobappcreator.com/api/notifications

notification.json content:

{
"actionType" : "none",
"android" : true,
"body" : "This is a test push",
"deliverOn" : UNIX_TIMESTAMP,
"iOS" : true,
"title" : "Test push"
}

Create user notification

curl --request POST -H 'Content-Type: application/json' -H 'Authorization: Bearer MOBAPP_API_TOKEN' --data @notification.json https://app.mobappcreator.com/api/notifications/user_id

Where user_id is the uid from the user object. You can get a list of user objects by calling the Get Users API call.

notification.json content:

{
"actionType" : "none",
"body" : "This is a test push",
"deliverOn" : UNIX_TIMESTAMP,
"title" : "Test push"
}

Posted

in

by

Tags:

en_US