SharePoint lookup fields actually store the list item ID of the linked to item in the lookup list. So, for instance, you are querying the list
ListName, but let’s say your
Name field is a lookup to a list called
NameID is the item ID of the item in
LookupList that is linked to via the
Name lookup field.
You could use that directly – you gave an example of an item having
NameID: 49. You could query the lookup list directly:
and then get field values off of that.
Or, you can pull in those values in the same query you make to
ListName. In order to get values from fields in the lookup list, you have to use a combination of
$expand. The format in a generalized sense is:
So, let’s say you wanted to get the values of the
Title field and
OtherField from the item linked to in your
Name field. You would construct your query like:
In order for this to work, though, you do need to know the field names of the fields in the lookup list that you want to retrieve.
You should be able to find plenty of information on this if you search for “how to get values from lookup field in REST API” (or something similar).
After some clarification in the comments, it seems that the field in question is a User (“Person or Group”) field.
This type of field is, at its essence, a Lookup field, except that it is a lookup to a very specific hidden list in the SharePoint site that stores user information. Because you need to know the names of the fields in the lookup list that you want to “expand”, and the lookup list in this case is hidden, it can be difficult to know what fields you can choose.
This other question and answer here on SP.SE provide a good list.
In the comments you also link to a user voice issue that is about Managed Metadata fields. Managed Metadata fields (a.k.a. Taxonomy fields) are a bit more complex than regular Lookup or User fields, and might take more than a simple
$expand in order to get usable/readable data from them.