M-Files / MFilesSamplesAndLibraries

A series of samples and libraries to help developers build applications upon the M-Files Information Management System.
http://developer.m-files.com
MIT License
66 stars 100 forks source link

Alias endpoint examples #13

Closed OzBob closed 3 years ago

OzBob commented 3 years ago

Propose new sample code for Alias endpoints:

1 Property definition ID by alias https://developer.m-files.com/APIs/REST-API/Reference/resources/structure/properties/itemidbyalias/alias/ /structure/properties/itemidbyalias/(alias) Resolves a single property definition alias to its ID.

The alias should be URI-encoded. If resolving multiple aliases, or your alias contains the character \, then it is recommended to use /structure/properties/itemidbyalias, or /structure/metadatastructure/itemidbyalias.

GET Output: int Returns the ID of property definition with the given alias, or -1 if none could be found. If multiple property definitions have the same alias then -1 will be returned.

2 Value list ID by alias https://developer.m-files.com/APIs/REST-API/Reference/resources/structure/valuelists/itemidbyalias/alias/ /structure/valuelists/itemidbyalias/(alias) Resolves a single value list alias to its ID.

The alias should be URI-encoded. If resolving multiple aliases, or your alias contains the character \, then it is recommended to use /structure/valuelists/itemidbyalias, or /structure/metadatastructure/itemidbyalias.

GET Output: int Returns the ID of value list with the given alias, or -1 if none could be found. If multiple value lists have the same alias then -1 will be returned.

3. Object type ID by alias https://developer.m-files.com/APIs/REST-API/Reference/resources/structure/objecttypes/itemidbyalias/alias/ /structure/objecttypes/itemidbyalias/(alias) Resolves a single object type alias to its ID.

The alias should be URI-encoded. If resolving multiple aliases, or your alias contains the character \, then it is recommended to use /structure/objecttypes/itemidbyalias, or /structure/metadatastructure/itemidbyalias.

GET Output: int Returns the ID of object type with the given alias, or -1 if none could be found. If multiple object types have the same alias then -1 will be returned.

OzBob commented 3 years ago

Found in https://github.com/M-Files/Libraries.MFWSClient/blob/cff89080ebae45193c6908fc3cd99ce99d4a48b8/MFaaP.MFWSClient.Tests/MFWSVaultClassOperations.cs