Lukasz
Lukasz

Reputation: 33

Dynamics 365 list lead statuscode enums by REST API

I'm trying to figure out how to list enum options for lead statuscode by REST API. I do request like:

GET [Organization URI]/api/data/v8.2/EntityDefinitions(LogicalName='lead')/Attributes(LogicalName='statuscode')/Microsoft.Dynamics.CRM.PicklistAttributeMetadata?$select=LogicalName&$expand=OptionSet

but I get an error like:

"Navigation property Attributes With Id = LogicalName='statuscode' does not exist on Metadata Entity with ID = LogicalName='lead'"

What is the proper endpoint to achive this?

Upvotes: 1

Views: 776

Answers (1)

Dave Clark
Dave Clark

Reputation: 2303

Use StatusAttributeMetadata instead of PicklistAttributeMetadata:

GET [Organization URI]/api/data/v8.2/EntityDefinitions(LogicalName='lead')/Attributes/Microsoft.Dynamics.CRM.StatusAttributeMetadata?$select=LogicalName&$expand=OptionSet($select=Options)

Upvotes: 1

Related Questions