Prepare JSON passing & get all device ids