Jump to content

Search the Community

Showing results for tags 'unity'.

  • Search By Tags

    Type tags separated by commas.
  • Search By Author

Content Type


Forums

  • General
    • Announcements
    • Emby Premiere Purchase/Subscription Support
    • Feature Requests
    • Tutorials and Guides
  • Emby Server
    • General/Windows
    • Android Server
    • Asustor
    • FreeBSD
    • Linux
    • NetGear ReadyNAS
    • MacOS
    • QNAP
    • Synology
    • TerraMaster NAS
    • Thecus
    • Western Digital
    • DLNA
    • Live TV
  • Emby Apps
    • Amazon Alexa
    • Android
    • Android TV / Fire TV
    • Windows & Xbox
    • Apple iOS / macOS
    • Apple TV
    • Kodi
    • LG Smart TV
    • Linux & Raspberry Pi
    • Roku
    • Samsung Smart TV
    • Sony PlayStation
    • Web App
    • Windows Media Center
    • Plugins
  • Language-specific support
    • Arabic
    • Dutch
    • French
    • German
    • Italian
    • Portuguese
    • Russian
    • Spanish
    • Swedish
  • Community Contributions
    • Ember for Emby
    • Fan Art & Videos
    • Tools and Utilities
    • Web App CSS
  • Testing Area
    • WMC UI (Beta)
  • Other
    • Non-Emby General Discussion
    • Developer API
    • Hardware
    • Media Clubs

Blogs

  • Emby Blog

Find results in...

Find results that contain...


Date Created

  • Start

    End


Last Updated

  • Start

    End


Filter by number of...

Found 1 result

  1. ginjaninja

    Help with using api from unity

    Can anyone help with this please? I am learning Unity and the emby api, and diving in well past the deep end.. I am getting a 400 bad response when trying to use "/emby/Users/AuthenticateByName" when i manually use the same headers and json data on the http://swagger.emby.media page, i get a successful response. from that i understand i need to set a header and post some json data i can get a successful response in Unity from simpler api methods like /System/Info which dont require posting json and setting headers. anyone out there got a unity app to work on the api? that could a post a unity example on using /emby/Users/AuthenticateByName sucessfully (or something similar with headers and json? using System.Collections; using System.Collections.Generic; using UnityEngine; using UnityEngine.Networking; public class EmbyAPIComp : MonoBehaviour { [System.Serializable] public class MyClass { string Username = "MyUsername"; string Pw = "Mypassword"; } static MyClass myObject = new MyClass(); string json = JsonUtility.ToJson(myObject); IEnumerator AuthenticateCoroutine() { using (UnityWebRequest www = UnityWebRequest.Put("http://192.168.0.10:8096/emby/Users/AuthenticateByName", json)) { www.method = UnityWebRequest.kHttpVerbPOST; www.SetRequestHeader("X-Emby-Authorization" , "Emby UserId='91d851f075f44ae59bc499bc4ebb54e6', Client='Android', Device='Samsung Galaxy SIII', DeviceId='NickskApp', Version='1.0.0.0'"); www.SetRequestHeader("accept" , "application/json"); www.SetRequestHeader("Content-Type" , "application/json"); yield return www.SendWebRequest(); if(www.isNetworkError || www.isHttpError) { Debug.Log(www.error); } else { Debug.Log(www.responseCode); } } } thanks for your help
×
×
  • Create New...