Joomag API 2.0 Dokumentation

Kontakte

Kontaktliste abrufen

Zeigt eine Liste aller Kontakte Ihres Kontos an.

GET /api/2.0/contacts

Beispiel:

# Include the API wrapper class (see "Libraries" for instructions)
require 'JoomagREST.php';

# Instantiate the client.
$jmClient = new JoomagREST(
    'api_de81b9eb3ff797796edc0cd00020b6c8',
    'sec_e8ff4e7e74c64fcfd63dcf728040ba3e5b29aa398e5cc1cb414011661c75fd19'
);

# Make the call to the client.
$result = $jmClient->getContactsList();

Antwort:

{
  "error": 0,
  "message": "OK",
  "data": [
    {
      "email": "john@example.com"
    },
    {
      "email": "ketty@example.com"
    },
    {
      "email": "baz@example.com"
    },
    {
      "email": "foo@example.com"
    }
  ]
}

Neuen Kontakt erstellen

Erstellt einen Kontakt in diesem Konto.

POST /api/2.0/contacts
Parameter Typ Erklärung
email string E-Mail Adresse des Kontakts
full_name string Vollständiger Name des Kontakts
country string Land des Kontakts
city string Stadt
street string Straße
zip string PLZ

Beispiel:

# Include the API wrapper class (see "Libraries" for instructions)
require 'JoomagREST.php';

# Instantiate the client.
$jmClient = new JoomagREST(
    'api_de81b9eb3ff797796edc0cd00020b6c8',
    'sec_e8ff4e7e74c64fcfd63dcf728040ba3e5b29aa398e5cc1cb414011661c75fd19'
);

# Make the call to the client.
$result = $jmClient->post( "contacts", array(
    "email"     => "john@example.com",
    "full_name" => "John Smith",
    "country"   => "US",
    "city"      => "New York",
    "street"    => "2250 Lexington Avenue",
    "zip"       => "10035"
) );

Antwort:

{
  "error": 0,
  "message": "OK",
  "data": {
    "email": "john@example.com"
  }
}

Ein Kürzel erstellen

Erstellt ein Zugriffskürzel für einen Kontakt.

POST /api/2.0/contacts/<email>/token
Parameter Typ Erklärung
is_single_use bool Boolean Flag um anzugeben, dass das Kürzel für einmalige Benutzung ist. Der Wert muss entweder no oder yes sein.
expiration_date string Beschreibe das Ablaufdatum des Kürzels. Gültiges Format: 2015-03-29 oder 2015-03-29 17:55:34.

Beispiel:

# Include the API wrapper class (see "Libraries" for instructions)
require 'JoomagREST.php';

# Instantiate the client.
$jmClient = new JoomagREST(
    'api_de81b9eb3ff797796edc0cd00020b6c8',
    'sec_e8ff4e7e74c64fcfd63dcf728040ba3e5b29aa398e5cc1cb414011661c75fd19'
);

# Subscriber email
$email = 'john@example.com';

# Make the call to the client.
$result = $jmClient->createToken( $email, array(
    "is_single_use"     => 'yes',
    "expiration_date"   => "2015-03-29"
) );

Antwort:

{
  "error": 0,
  "message": "OK",
  "data": {
    "email": "john@example.com",
    "token": "r5ekPZLBUo/qNcPEAvB+3piXmSkFfoTORvI4VznS7yN29d/hrZwfBgvHLSfqC09+Zct7FZ/m5rM/X9Bp3qBEnKvZsXDsYIVs",
    "is_single_use": true,
    "expiration_date": "2015-03-29"
  },
}

Einzelne Ausgabe versenden

Eine einzelne Ausgabe an bestimmten Kontakt ausliefern.

POST /api/2.0/contacts/<email>/issue/<issue_id>

Beispiel:

# Include the API wrapper class (see "Libraries" for instructions)
require 'JoomagREST.php';

# Instantiate the client.
$jmClient = new JoomagREST(
    'api_de81b9eb3ff797796edc0cd00020b6c8',
    'sec_e8ff4e7e74c64fcfd63dcf728040ba3e5b29aa398e5cc1cb414011661c75fd19'
);

# Subscriber email
$email = 'john@example.com';

# ID of the issue
$issueID = '0980693001409324380';

# Make the call to the client.
$result = $jmClient->post( "contacts/$email/issue/$issueID" );

Antwort:

{
  "error": 0,
  "message": "OK",
  "data": []
}

Magazin-Abonnement versenden

Ein Magazin-Abonnement an bestimmten Kontakt ausliefern.

POST /api/2.0/contacts/<email>/subscription/<magazine_id>

Beispiel:

# Include the API wrapper class (see "Libraries" for instructions)
require 'JoomagREST.php';

# Instantiate the client.
$jmClient = new JoomagREST(
    'api_de81b9eb3ff797796edc0cd00020b6c8',
    'sec_e8ff4e7e74c64fcfd63dcf728040ba3e5b29aa398e5cc1cb414011661c75fd19'
);

# Subscriber email
$email = 'john@example.com';

# ID of the magazine
$magazineID = 'M0166830001409317679';

# Make the call to the client.
$result = $jmClient->post( "contacts/$email/subscription/$magazineID" );

Antwort:

{
  "error": 0,
  "message": "OK",
  "data": []
}

Kontakt löschen

Löscht den Kontakt.

DELETE /api/2.0/contacts/<email>

Beispiel:

# Include the API wrapper class (see "Libraries" for instructions)
require 'JoomagREST.php';

# Instantiate the client.
$jmClient = new JoomagREST(
    'api_de81b9eb3ff797796edc0cd00020b6c8',
    'sec_e8ff4e7e74c64fcfd63dcf728040ba3e5b29aa398e5cc1cb414011661c75fd19'
);

# Subscriber email
$email = 'john@example.com';

# Make the call to the client.
$result = $jmClient->deleteContact( $email );

Antwort:

{
  "error": 0,
  "message": "OK",
  "data": []
}

Kürzel Löschen

DELETE /api/2.0/contacts/<email>/tokens

Beispiel:

# Include the API wrapper class (see "Libraries" for instructions)
require 'JoomagREST.php';

# Instantiate the client.
$jmClient = new JoomagREST(
    'api_de81b9eb3ff797796edc0cd00020b6c8',
    'sec_e8ff4e7e74c64fcfd63dcf728040ba3e5b29aa398e5cc1cb414011661c75fd19'
);

# Subscriber email
$email = 'john@example.com';

# Make the call to the client.
$result = $jmClient->deleteAllTokens( $email );

Antwort:

{
  "error": 0,
  "message": "OK",
  "data": []
}