API
FAQ
Dokumentacja API dostępna jest na naszej stronie: https://www.idobooking.com/pl/developers/api/administration-panel-api/
Składowe parametru system_key:
sha1(date('Ymd') . sha1('hasło użytkownika panelu'))
date('Ymd') jest datą wygenerowaną według następującego formatu: RRRRMMDD
Przykład użycia w języku C#:
using System;
using System.Collections.Generic;
using System.Text;
namespace WebApiTest
{
class Session
{
/// <summary>
/// Generates SHA1 session key string
/// </summary>
/// <param name="password">SHA1 hashed password
/// <returns>SHA1 hash string</returns>
public static string GenerateKey(string hashedPassword)
{
System.Security.Cryptography.HashAlgorithm hash = System.Security.Cryptography.SHA1.Create();
string date = System.String.Format("{0:yyyyMMdd}", System.DateTime.Now);
string strToHash = date + hashedPassword;
byte[] keyBytes, hashBytes;
keyBytes = System.Text.Encoding.UTF8.GetBytes(strToHash);
hashBytes = hash.ComputeHash(keyBytes);
string hashedString = string.Empty;
foreach (byte b in hashBytes)
{
hashedString += String.Format("{0:x2}", b);
}
return hashedString;
}
/// <summary>
/// Hashes specified password with SHA1 algorithm
/// </summary>
/// <param name="password">User password
/// <returns>SHA1 hash string</returns>
public static string HashPassword(string password)
{
System.Security.Cryptography.HashAlgorithm hash = System.Security.Cryptography.SHA1.Create();
byte[] keyBytes, hashBytes;
keyBytes = System.Text.Encoding.UTF8.GetBytes(password);
hashBytes = hash.ComputeHash(keyBytes);
string hashedString = string.Empty;
foreach (byte b in hashBytes)
{
hashedString += String.Format("{0:x2}", b);
}
return hashedString;
}
}
class Test
{
public static ApiGetCategories.responseType GetCategories(string url, string login, string pass)
{
var authenticate = new WebApiTest.ApiGetCategories.authenticateType();
var request = new WebApiTest.ApiGetCategories.requestType();
var service = new WebApiTest.ApiGetCategories.getCategoriesService();
service.Url = url;
authenticate.system_login = login;
authenticate.system_key = WebApiTest.Session.GenerateKey(Session.HashPassword(pass));
request.authenticate = authenticate;
return service.getCategories(request);
}
}
}
Maksymalny rozmiar żądania do API nie może przekroczyć 10 MB.
Wszelkie zgłoszenia dotyczące funkcjonowania API Panelu Administracyjnego IdoBooking, w szczególności zgłoszenia dotyczące błędów zwracanych przez bramki, należy zgłaszać za pomocą komunikatów w BOK.
Analizując tego typu zgłoszenia, jako absolutne minimum potrzebujemy następujących informacji:
nazwę bramki
wersję api
metodę
zapytanie
odpowiedź