API-Dokumentation Webhosting für alle LWS besuchen

Guthaben zu einem bestimmten Kontakt hinzufügen (nur Testumgebung)

PUT https://api.lws.net/v1/contact/{contact}/credit

operationIdputContactCredit

Außerhalb der Testumgebung nicht implementiert. Senden Sie den Header X-Test-Mode, um die funktionale Implementierung dieser Operation zu erreichen; ohne diesen gibt dieser Endpunkt immer 501 zurück.

Pfadparameter

contact integer erforderlich

LWS-ID des Kontakts, dem Guthaben hinzugefügt werden soll

Anfrage-Body

  • amount integer

    Höhe des hinzuzufügenden Guthabens

    optional
Beispielanfrage
{
  "amount": 0
}

Antworten

401

Nicht autorisiert - Authentifizierungs-Header fehlen

{
  "code": 401,
  "info": "Unauthorized access to the API. Please specify X-Auth-Pass and X-Auth-Login to proceed."
}
Felder der Antwort 2
  • code integer

    Beispiel: 401

  • info string

    Beispiel: Unauthorized access to the API. Please specify X-Auth-Pass and X-Auth-Login to proceed.

429

Anfragelimit überschritten

{
  "code": 429,
  "info": "Rate limit exceeded. Please try again later."
}
Felder der Antwort 2
  • code integer

    Beispiel: 429

  • info string

    Beispiel: Rate limit exceeded. Please try again later.

501

Außerhalb der Testumgebung nicht implementiert

Wird außerhalb der Testumgebung zurückgegeben. Diese Operation läuft nur mit aktiviertem X-Test-Mode.

{
  "code": 405,
  "info": "Not implemented. Make sure you are using the Test Environment for this action to work"
}
Felder der Antwort 2
  • code integer

    Beispiel: 405

  • info string

    Beispiel: Not implemented. Make sure you are using the Test Environment for this action to work

Codebeispiele und Testkonsole anzeigen
PUT /contact/{contact}/credit
LWS_AUTH_LOGIN='…'LWS_AUTH_PASS='…'curl -X PUT \  "https://api.lws.net/v1/contact/{contact}/credit" \  -H "X-Auth-Login: $LWS_AUTH_LOGIN" \  -H "X-Auth-Pass: $LWS_AUTH_PASS" \  -H "Content-Type: application/json" \  -d '{"amount":0}'
$lwsAuthLogin = '…';$lwsAuthPass = '…';$ch = curl_init("https://api.lws.net/v1/contact/{contact}/credit");curl_setopt($ch, CURLOPT_CUSTOMREQUEST, "PUT");curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);curl_setopt($ch, CURLOPT_HTTPHEADER, [    "X-Auth-Login: " . $lwsAuthLogin,    "X-Auth-Pass: " . $lwsAuthPass,    "Content-Type: application/json",]);curl_setopt($ch, CURLOPT_POSTFIELDS, '{"amount":0}');$res = json_decode(curl_exec($ch), true);
import requestsLWS_AUTH_LOGIN = "…"LWS_AUTH_PASS = "…"res = requests.put(    "https://api.lws.net/v1/contact/{contact}/credit",    headers={        "X-Auth-Login": LWS_AUTH_LOGIN,        "X-Auth-Pass": LWS_AUTH_PASS,    },    json={"amount": 0},)print(res.json())
const LWS_AUTH_LOGIN = "…";const LWS_AUTH_PASS = "…";const res = await fetch("https://api.lws.net/v1/contact/{contact}/credit", {  method: "PUT",  headers: {    "X-Auth-Login": LWS_AUTH_LOGIN,    "X-Auth-Pass": LWS_AUTH_PASS,    "Content-Type": "application/json",  },  body: JSON.stringify({"amount":0}),});const data = await res.json();
lwsAuthLogin := "…"lwsAuthPass := "…"body := strings.NewReader(`{"amount":0}`)req, _ := http.NewRequest("PUT",    "https://api.lws.net/v1/contact/{contact}/credit", body)req.Header.Set("X-Auth-Login", lwsAuthLogin)req.Header.Set("X-Auth-Pass", lwsAuthPass)req.Header.Set("Content-Type", "application/json")resp, err := http.DefaultClient.Do(req)