Nearspeak API Documentation (Version: 0.1.0)

Login

POST /api/v1/login/getAuthToken

Example Request

{
  *"email": "user@example.com",
  *"password": "supersecretpassword",
}

Example curl command

curl -XPOST -H 'Content-Type: application/json' http://nearspeak.cloudapp.net/api/v1/login/getAuthToken -d '{ "email": "demo@example.com", "password": "secret" }'

Example Success Response

{  
   "auth_token":"urjufyi4MFDXyitZM9Tx"
}

Example Error Response

  {
      "error": {
          "message": "User not found.",
          "code": "InvalidRequest"
      }
  }

POST /api/v1/login/signInWithFacebook

Example Request

{
  *"auth_token" : "zeHDoz4ixg9BNi5mvZmB"
}

POST /api/v1/login/signOut

Example Request

{
  *"email": "user@example.com",
  *"auth_token": "zeHDoz4ixg9BNi5mvZmB"
}

Example curl command

curl -XPOST -H 'Content-Type: application/json' http://nearspeak.cloudapp.net/api/v1/login/signOut -d '{ "email": "user@example.com", "auth_token": "urauMyiM2F3XydtKM9Td" }'

Example Success Response

{  
   "message":"Logout was successful.",
   "code":"OK"
}

Example Error Response

  {  
     "error":{  
        "message":"Logout went wrong.",
        "code":"LogoutError"
     }
  }

Tags

POST /api/v1/tags/create

Parameters

Example Request

{
  "auth_token": "zeHDoz4ixg9BNi5mvZmB",
  *"lang": "de",
  *"purchase_id": "4ea93515-5a84-4add-bf81-293b306b968f",
  *"text": "What does the fox say"
}

Example curl command

curl -XPOST -H 'Content-Type: application/json' http://nearspeak.cloudapp.net/api/v1/tags/create -d '{ "auth_token": "urjuMyiMMFEXyitKMaFx", "purchase_id": "4ea932415-5e84-4aff-bf81-293b306b9463f", "text": "Whats up", "lang": "de" }'

Example Success Response

{  
   "tags":[  
      {  
         "id":175,
         "tag_identifier":"c29483d3e4de",
         "gender":"m",
         "translation":{  
            "text":"Whats up",
            "lang":"de"
         }
      }
   ]
}

Example Error Response

  {  
     "error":{  
        "message":"Request values are missing",
        "values":[  
           "lang"
        ],
        "code":"InvalidRequest"
     }
  }

POST /api/v1/tags/addHardwareIdToTag

Parameters

Example curl command

curl -XPOST -H 'Content-Type: application/json' http://nearspeak.cloudapp.net/api/v1/tags/addHardwareIdToTag -d '{ "auth_token": "urjuMyiMMFEXyitKMaFx", "id": "4ea93241563f", "hardware_id": "EFC-2", "hardware_type": "qr" }'

Example Success Response

{  
   "tags":[  
      {  
         "id":175,
         "tag_identifier":"c29483d3e4de",
         "gender":"m",
         "translation":{  
            "text":"Whats up",
            "lang":"de"
         }
      }
   ]
}

Example Error Response

  {  
     "error":{  
        "message":"Request values are missing",
        "values":[  
           "lang"
        ],
        "code":"InvalidRequest"
     }
  }

GET /api/v1/tags/show

Parameters

Example curl command

curl -XGET -H 'Content-Type: application/json' http://nearspeak.cloudapp.net/api/v1/tags/show -d '{ "id": "urjuMyiMMFEXyitKMaFx" }'

Example Success Response

{  
   "tags":[  
      {  
         "id":123,
         "tag_identifier":"c2b5cd49a8ad",
         "description":"Summer Party",
         "name":{  
            "text":"Store Screenshot 2 - Holidays",
            "lang":"de"
         },
         "gender":"m",
         "image_url":"http://nearspeak.at/images/2-holidays.jpg",
         "text_url":"http://www.nearspeak.at/",
         "translation":{  
            "text":"Win your next holiday trip!",
            "lang":"en"
         }
      }
   ]
}

Example Error Response

  {  
     "error":{  
        "message":"Tag not found",
        "code":"InvalidRequest"
     }
  }

GET /api/v1/tags/showByHardwareId

Parameters

Example curl command

curl -XGET -H 'Content-Type: application/json' http://nearspeak.cloudapp.net/api/v1/tags/showByHardwareId -d '{ "id": "048F7A81A72780", "type": "nfc" }'

Example Success Response

{  
   "tags":[  
      {  
         "id":55,
         "tag_identifier":"2fdcb41bdad4",
         "name":{  
            "text":"Multi NFC Tag",
            "lang":"de"
         },
         "image_url":"http://heidicohen.com/wp-content/uploads/Big-Fat-Cat-.jpg",
         "text_url":"www.appaya.at",
         "translation":{  
            "text":"das ist ein mehrfach online Pack",
            "lang":"de"
         },
         "hardware":[  
            {  
               "type":"nfc",
               "identifier":"048F7A81A72780"
            },
            {  
               "type":"nfc",
               "identifier":"678D3200"
            },
            {  
               "type":"nfc",
               "identifier":"04DB6D89A72780"
            }
         ]
      }
   ]
}

Example Error Response

  {  
     "error":{  
        "message":"Tag not found",
        "code":"InvalidRequest"
     }
  }

GET /api/v1/tags/showMyTags

Example Request

{
  *"auth_token": "afggwwUE7324422"
}

Example curl command

curl -XGET -H 'Content-Type: application/json' http://nearspeak.cloudapp.net/api/v1/tags/showMyTags -d '{ "auth_token": "048F7A81A72780" }'

Example Success Response

{  
   "tags":[  
      {  
         "id":55,
         "tag_identifier":"2fdcb41bdad4",
         "name":{  
            "text":"Multi NFC Tag",
            "lang":"de"
         },
         "image_url":"http://heidicohen.com/wp-content/uploads/Big-Fat-Cat-.jpg",
         "text_url":"www.appaya.at",
         "translation":{  
            "text":"das ist ein mehrfach online Pack",
            "lang":"de"
         },
         "hardware":[  
            {  
               "type":"nfc",
               "identifier":"048F7A81A72780"
            },
            {  
               "type":"nfc",
               "identifier":"678D3200"
            },
            {  
               "type":"nfc",
               "identifier":"04DB6D89A72780"
            }
         ]
      }
   ]
}

Example Error Response

  {  
     "error":{  
        "message":"User not found.",
        "code":"UserNotFound"
     }
  }

GET /api/v1/tags/supportedLanguageCodes

Example curl command

curl -XGET -H 'Content-Type: application/json' http://nearspeak.cloudapp.net/api/v1/tags/supportedLanguageCodes

Example Success Response

{  
   "language_codes":[  
      "ar",
      "bg",
      "ca",
      "zh-CHS",
      "zh-CHT",
      "cs",
      "da",
      "nl",
      "en",
      "et",
      "fi",
      "fr",
      "de",
      "el",
      "ht",
      "he",
      "hi",
      "mww",
      "hu",
      "id",
      "it",
      "ja",
      "tlh",
      "tlh-Qaak",
      "ko",
      "lv",
      "lt",
      "ms",
      "mt",
      "no",
      "fa",
      "pl",
      "pt",
      "ro",
      "ru",
      "sk",
      "sl",
      "es",
      "sv",
      "th",
      "tr",
      "uk",
      "ur",
      "vi",
      "cy"
   ]
}

GET /api/v1/tags/supportedBeaconUUIDs

Example curl command

curl -XGET -H 'Content-Type: application/json' http://nearspeak.cloudapp.net/api/v1/tags/supportedBeaconUUIDs

Example Success Response

{  
   "uuids":[  
      "699EBC80E1F311E39A0F0CF3EE3BC012",
      "CEFCC021E45F4520A3AB9D1EA22873AD",
      "F7826DA6-4FA2-4E98-8024-BC5B71E0893E"
   ]
}