PcoWSkbVqDnWTu_dm2ix
Collapse Sidebar

GetUserInfosByUserIdsAsync

This function enables developers to request information about users outside of the current Datamodel in bulk, which is why both the input and output values are arrays.

  • The order of the UserInfosResponse objects in the return value’s array may not match the order of the UserIds sent in the input parameter’s array. Use the Id field of the UserInfosResponse object to identify your input array with the output array.
  • It’s possible to receive less UserInfoResponse objects than requested if one or more of the userIds in the request array are invalid, such as negative numbers or user ID’s that don’t have accounts associated with them. It’s possible to receive a response with zero results if all userIds are invalid.
  • If a Roblox user does not have a display name associated with their account, the function will return instead the same string as the user’s username in the DisplayName field. See Player.DisplayName. While a user’s UserId will never change, a user may change their username or display name. The same input UserIds may return a different string for these fields from one day to another.
  • Since GetUserInfosByUserIdsAsync() makes an external web request, it will yield and may fail if the backend service is experiencing interruptions. Ensure you can handle downtime appropriately by wrapping the method with a pcall.

Parameters

Name Type Default Description

An array of userIds requested.

Returns

Return Type Summary

An array of dictionary objects that contain the user’s names


Code Samples


The signature of a singular UserInfoResponse object is:

Type Name Description
number Id The Id associated with the UserInfoResponse object
string Username The username associated with the UserInfoResponse object
string DisplayName The display name associated with the UserInfoResponse object