REST.Backend.EMSApi.TEMSClientAPI.AddResource
Delphi
procedure AddResource(const AResource: string; const AJSON: TJSONObject; const AAddParameters: TProc = nil);
C++
void __fastcall AddResource(const System::UnicodeString AResource, System::Json::TJSONObject* const AJSON, const System::Sysutils::_di_TProc AAddParameters = System::Sysutils::_di_TProc());
Properties
| Type | Visibility | Source | Unit | Parent | 
|---|---|---|---|---|
| procedure function | protected | REST.Backend.EMSApi.pas REST.Backend.EMSApi.hpp | REST.Backend.EMSApi | TEMSClientAPI | 
Description
Adds to the EMS server a resource of the specified resource type with the specified data.
AddResource receives the following parameters:
- AResourceis the target type of resource.
- AJSONis a JSON object that contains the data for the new resource.
- AAddParameters(optional) is a procedure without parameters that you can use to update the request. For example, you can add parameters to the request.
Exceptions
| Exception | Message | Description | 
|---|---|---|
| MasterSecret required | Authentication is TAuthentication.MasterSecret and ConnectionInfo.MasterSecret is an empty string. | |
| Session token required | Authentication is TAuthentication.Session and you did not log in or the session authentication token that you provided to Login is an empty string. |