To access the Betting API, you must utilize an X.509 certificate. Please reach out to your integration manager to obtain the necessary certificates and for any additional information.
Check that certificate works
Send request via curl for create demo users token (refer to the Token section for detail).
packagemainimport("bytes""crypto/tls""encoding/json""fmt""io""net/http")funcmain(){constbettingAPIHost="{betting-api-host}"certificate,err:=tls.LoadX509KeyPair("client.crt","client.key")iferr!=nil{panic(fmt.Sprintf("Failed to read X509 key pair: %s",err))}httpClient:=&http.Client{Transport:&http.Transport{TLSClientConfig:&tls.Config{Certificates:[]tls.Certificate{certificate},},},}typetokenRequeststruct{Localestring`json:"locale"`Currencystring`json:"currency"`}body,err:=createReaderForAny(tokenRequest{Locale:"en",Currency:"EUR",})iferr!=nil{panic(fmt.Sprintf("Failed to create reader: %s",err))}url:=fmt.Sprintf("https://%s/token/create",bettingAPIHost)resp,err:=httpClient.Post(url,"application/json",body)iferr!=nil{panic(fmt.Sprintf("Failed to get response: %s",err))}data,err:=io.ReadAll(resp.Body)iferr!=nil{panic(fmt.Sprintf("Failed to read all body: %s",err))}fmt.Printf("%s\n",resp.Status)fmt.Printf("Body:\n%s",data)}funccreateReaderForAny(vany)(io.Reader,error){data,err:=json.Marshal(v)iferr!=nil{returnnil,fmt.Errorf("marshal data: %w",err)}returnbytes.NewBuffer(data),nil}