User API guide/da: Difference between revisions

FuzzyBot (talk | contribs)
Updating to match new version of source page
Tags: Mobile edit Mobile web edit
Created page with "Bemærk, at adgangstokenet er gyldigt i én time. Dette er af sikkerhedsmæssige årsager. Du skal genoprette det mindst én gang i timen. <br><br><br>"
Line 1: Line 1:
<languages/>
<languages/>
<div lang="en" dir="ltr" class="mw-content-ltr">
{{#seo: |title=Brugervejledning til API - SimplyBook.me |description=Brug SimplyBook.me Bruger-API til at oprette avancerede integrationer. Følg vores vejledning for problemfri implementering. Få mere at vide her! |titlemode=tilføj |keywords=faq, ofte stillede spørgsmål, reservationssoftware, spørgsmål om aftalesystem, onlineaftaler, kalendersoftware, reservationssystem, reservationskalender, planlægningssoftware, onlineaftaleplanlægning, onlineplanlægning, plugins, tilpassede funktioner, link til tilpasset reservationsside, domænenavn, tilpasset domænenavn, tilpasset url }}
{{#seo:
|title=User API guide - SimplyBook.me
|description=Use the SimplyBook.me User API to create advanced integrations. Follow our guide for seamless implementation. Learn more here!
|titlemode=append
|keywords=faq, frequently asked questions, booking software, appointment system questions, appointments online, calendar software, booking system, booking calendar, scheduling software, online appointment scheduling, online scheduling, plugins, custom features, custom booking page link, domain name, custom domain name, custom url
}}
</div>
<br><br>
<br><br>


<div lang="en" dir="ltr" class="mw-content-ltr">
Brug vores udvikler-API til at oprette din egen bookinggrænseflade. Du kan designe enhver løsning, du ønsker, lige fra den enkleste widget til multifunktionelle applikationer med funktionalitet, der er tilpasset din virksomheds specifikke behov.
Use our developer API to create your own booking interface. You can design any solution you want varying from the simplest widget to multifunctional application with functionality customized according to your business specific.
</div>


<div lang="en" dir="ltr" class="mw-content-ltr">
Simplybook Application Programming Interface bruger [https://en.wikipedia.org/wiki/JSON-RPC#Version_2.0 JSON-RPC 2.0-protokollen].
Simplybook Application Programming Interface uses [https://en.wikipedia.org/wiki/JSON-RPC#Version_2.0 JSON-RPC 2.0 protocol].
</div>


<div lang="en" dir="ltr" class="mw-content-ltr">
Se [https://simplybook.me/api_example/index.html et eksempel på en API-baseret bookinggrænseflade], og læs også [https://simplybook.me/api_example/scheduler.js kildekoden] til denne løsning.
See [https://simplybook.me/api_example/index.html an example of API-based booking interface], and also read [https://simplybook.me/api_example/scheduler.js the source code] of this solution.
<br><br><br>
<br><br><br>
</div>




<div lang="en" dir="ltr" class="mw-content-ltr">
= '''AUTORISATION''' =
='''AUTHORIZATION'''=
<br><br>
<br><br>
Using Simplybook API methods require an authentication. To authorize in Simplybook API you need to get an access key access-token. In order to get this access-token you should call the JSON-RPC method getToken on https://user-api.simplybook.me/login service passing your personal API-key. You can copy your API-key at admin interface: go to the 'Custom Features' link and select API Custom Feature 'Settings'. Then you have to init remote access to Simplybook API. Your request should contain the following headers: 'X-Company-Login', 'X-Token'.
Brug af Simplybook API-metoder kræver godkendelse. For at godkende i Simplybook API skal du få en adgangsnøgle adgangstoken. For at få denne adgangstoken skal du kalde JSON-RPC-metoden getToken https://user-api.simplybook.me/login service og indtaste din personlige API-nøgle. Du kan kopiere din API-nøgle i admin-grænsefladen: gå til linket 'Custom Features' og vælg API Custom Feature 'Settings'. Derefter skal du initialisere fjernadgang til Simplybook API. Din anmodning skal indeholde følgende headere: 'X-Company-Login', 'X-Token'.
</div>


<div lang="en" dir="ltr" class="mw-content-ltr">
Adgangstoken kan implementeres enten fra klientsiden eller fra din server, hvilket er den mest sikre løsning.
Getting the access-token can be implemented either from client side or from your server which is the more secure solution.
</div>




<div lang="en" dir="ltr" class="mw-content-ltr">
Du kan bruge [https://simplybook.me/api_example/json-rpc-client.js javascript JSON-RPC-klientbibliotek] og [https://simplybook.me/api_example/JsonRpcClient.zip php JSON-RPC-klientbibliotek] fra vores eksempler til udvikling af din egen løsning.
You may use [https://simplybook.me/api_example/json-rpc-client.js javascript JSON-RPC-client library] and [https://simplybook.me/api_example/JsonRpcClient.zip php JSON-RPC-client library] from our examples for your own solution development.
</div>


<div lang="en" dir="ltr" class="mw-content-ltr">
Bemærk, at adgangstokenet er gyldigt i én time. Dette er af sikkerhedsmæssige årsager. Du skal genoprette det mindst én gang i timen.
Please note access-token has one hour one time. This is done for security reasons. You will need to regenerate it at least once per hour.
<br><br><br>
<br><br><br>
</div>




<div lang="en" dir="ltr" class="mw-content-ltr">
= '''KLIENT-API ([https://simplybook.me/api/doc#/admin OFFENTLIG TJENESTE]) AUTORISATION''' =
='''CLIENT API([https://simplybook.me/api/doc#/admin COMPANY PUBLIC SERVICE])AUTHORIZATION'''=
<br><br>
<br><br>
=='''Authorization from client side code'''==
== '''Autorisation fra klientens kode''' ==
<br><br>
<br><br>
'''Getting the token-key'''.
'''Hent token-nøglen'''.
<br><br>
<br><br>
  <nowiki>var loginClient = new JSONRpcClient({
  <nowiki>var loginClient = new JSONRpcClient({
Line 58: Line 36:
var token = loginClient.getToken(YOUR_COMPANY_LOGIN, YOUR_API_KEY);</nowiki>
var token = loginClient.getToken(YOUR_COMPANY_LOGIN, YOUR_API_KEY);</nowiki>
<br><br>
<br><br>
'''Initialization JSON-RPC-client.'''
'''Initialisering af JSON-RPC-klient.'''
<br><br>
<br><br>
  <nowiki>this.client = new JSONRpcClient({
  <nowiki>this.client = new JSONRpcClient({
Line 69: Line 47:
});</nowiki>
});</nowiki>
<br><br>
<br><br>
=='''Authorization from server side code'''==
== '''Autorisation fra serverkode''' ==
<br><br>
<br><br>
'''Getting the token-key.'''<br><br>
'''Hentning af token-nøglen.'''<br><br>
  <nowiki>$loginClient = new JsonRpcClient('https://user-api.simplybook.me' . '/login/');
  <nowiki>$loginClient = new JsonRpcClient('https://user-api.simplybook.me' . '/login/');
$token = $loginClient->getToken(YOUR_COMPANY_LOGIN, YOUR_API_KEY);</nowiki>
$token = $loginClient-&gt;getToken(YOUR_COMPANY_LOGIN, YOUR_API_KEY);</nowiki>
<br><br>
<br><br>
'''Initialization JSON-RPC-client.'''
'''Initialisering af JSON-RPC-klient.'''
<br><br>
<br><br>
  <nowiki>$client = new JsonRpcClient('https://user-api.simplybook.me' . '/', array(
  <nowiki>$client = new JsonRpcClient('https://user-api.simplybook.me' . '/', array(
    'headers' => array(
  'headers' =&gt; array(
        'X-Company-Login: ' . YOUR_COMPANY_LOGIN,
      'X-Company-Login: ' . YOUR_COMPANY_LOGIN,
        'X-Token: ' . $token
      'X-Token: ' . $token
    )
  )
));</nowiki>
));</nowiki>
<br><br><br>
<br><br><br>
</div>


<div lang="en" dir="ltr" class="mw-content-ltr">
= '''BRUGER/ADMIN API ([https://simplybook.me/api/doc#/admin VIRKSOMHEDSADMINISTRATIONSTJENESTE]) AUTORISATION''' =
='''USER/ADMIN API ([https://simplybook.me/api/doc#/admin COMPANY ADMINISTRATION SERVICE]) AUTHORIZATION'''=
<br><br>
<br><br>
=='''Authorization from client side code'''==
== '''Autorisation fra klientens kode''' ==
<br><br>
<br><br>
'''Getting the token-key.'''
'''Hent token-nøglen.'''
<br><br>
<br><br>
  <nowiki>var loginClient = new JSONRpcClient({
  <nowiki>var loginClient = new JSONRpcClient({
Line 99: Line 75:
var token = loginClient.getUserToken(YOUR_COMPANY_LOGIN, YOUR_USER_LOGIN, YOUR_USER_PASSWORD);</nowiki>
var token = loginClient.getUserToken(YOUR_COMPANY_LOGIN, YOUR_USER_LOGIN, YOUR_USER_PASSWORD);</nowiki>
<br><br>
<br><br>
</div>


<div lang="en" dir="ltr" class="mw-content-ltr">
<div lang="en" dir="ltr" class="mw-content-ltr">