| Quintiq file version 2.0 | 
| #parent: #root | 
| Method GetLoginToken () as String | 
| { | 
|   TextBody: | 
|   [* | 
|     value := ''; | 
|      | 
|     path := '/iam/login?action=get_auth_params'; | 
|     nvtrequest := LibInt_MessageAccessor::CreateEmptyMessage(); | 
|     LibInt_MessageAccessor::SetHeaderProperty( nvtrequest, '_QI.ContentType', 'RAW' ); | 
|     LibInt_MessageAccessor::SetHeaderProperty( nvtrequest, 'HttpEndpointMethod', 'GET' ); | 
|     LibInt_MessageAccessor::SetHeaderProperty( nvtrequest, 'HttpEndpointPath', path ); | 
|     LibInt_MessageAccessor::SetHeaderProperty( nvtrequest, 'HTTPHeader.Accept', 'application/json' ); | 
|      | 
|     nvtresponse := LibInt_IntegratorProxy::SyncNvtRequest( 'ThreeDPassport', 'ThreeDPassport', nvtrequest ); | 
|     code := LibInt_MessageAccessor::GetHeaderPropertyAsNumber( nvtresponse, 'HTTPResponseCode' ); | 
|     response := LibInt_MessageAccessor::GetBodyValueAsString( nvtresponse ); | 
|      | 
|     if( code = 200 and response.StartsWith( '{' ) ) | 
|     { | 
|       jsonresponse := JSON::Parse( response ); | 
|       lt := jsonresponse.Get( 'lt' ); | 
|       if( not isnull( lt ) ) | 
|       { | 
|         value := lt.GetString(); | 
|       } | 
|     } | 
|      | 
|     return value; | 
|   *] | 
|   InterfaceProperties { Accessibility: 'Module' } | 
| } |