AOTG API Authenticate: Difference between revisions

No edit summary
 
(3 intermediate revisions by the same user not shown)
Line 1:
Method: {{AOTGApiMethodsSpec|POST|/api/public/v1/TokenAuth/Authenticate}}
 
==API==
Method: /api/public/v1/TokenAuth/Authenticate
 
Http Method: POST
 
Content-Type: application/json
 
<br/>
Line 13 ⟶ 7:
The '''AccessToken''' has an expiry date and time.<br/>
Which means programmer only need to authenticate with AOTG Cloud Server once, and make subsequent request until it is expired.
 
{|class="wikitable"
|-|
|'''Username and password'''
|Authentication is required to identify the requester. Username and password can be obtained after registration.<br/>To register see [[Begin AutoCount Accounting Integration via AOTG API]].
|-|
|'''API Key'''
|It is essential to identify the account book that has been registered with AOTG Server.<br/>See [[Begin AutoCount Accounting Integration via AOTG API]] on activate Account Book.
|}
 
==Code Snippets==
{{AOTGApiCodeSnippetTab
<tabber>
C# (with |RestSharp)=
<syntaxhighlight lang="C#">
var client = new RestClient("http://aotg.cloud:8080/api/public/v1/TokenAuth/Authenticate");
Line 25 ⟶ 28:
IRestResponse response = client.Execute(request);
</syntaxhighlight>
|PHPcURL=
|-|
PHP cURL=
<syntaxhighlight lang="PHP">
<?php
Line 59 ⟶ 61:
}
</syntaxhighlight>
|PHPHttp=
|-|
PHP Http Request=
<syntaxhighlight lang="PHP">
<?php
Line 88 ⟶ 89:
}
</syntaxhighlight>
}}
</tabber>
 
==Response==