Orbitvu Public Support Site

Lista pobrań

Updated on

Downloads API zwraca listę pobrań przygotowaną przez użytkowników na danym koncie:

URL: https://orbitvu.co/api/v1/downloads [.json|.xml]

Metoda: GET

{
    "count": 2,
    "next": null,
    "previous": null,
    "results": [
        {
            "created_at": "2018-08-08T14:54:57",
            "file_name": "kNYSKJPWkwqmyx66Dug3PU.zip",
            "complete": true,
            "viewer": "ORBITVU VIEWER My360",
            "presentations": [
                "xyzxyzxyzxyzxyzXYZ1233"
            ],
            "url": "https://orbitvu.co/api/v1/downloads/1",
            "download_url": "https://orbitvu.co/api/v1/downloads/1/download",
            "user_email": "[email protected]",
            "user_url": "https://orbitvu.co/api/v1/account/users/1"
        },
        {
            "created_at": "2018-08-08T11:44:30",
            "file_name": "jqYpnFNsjKuok22XGrFx4G.zip",
            "complete": true,
            "viewer": "ORBITVU VIEWER Free360",
            "presentations": [
                "xyzxyzxyzxyzxyzXYZ1234",
                "xyzxyzxyzxyzxyzXYZ1235",
                "xyzxyzxyzxyzxyzXYZ1236",
                "xyzxyzxyzxyzxyzXYZ1237"
            ],
            "url": "https://orbitvu.co/api/v1/downloads/2",
            "download_url": "https://orbitvu.co/api/v1/downloads/2/download",
            "user_email": "[email protected]",
            "user_url": "https://orbitvu.co/api/v1/account/users/2"
        }]
}
Click to copy

Wyszukiwanie

  • exact
    Szukaj według statusu ukończenia lub według UID prezentacji
# match downloads that are completed
https://orbitvu.co/api/v1/downloads.json?complete=true

# match downloads that are not yet completed
https://orbitvu.co/api/v1/downloads.json?complete=false

# match downloads containing presentation with uid xyzxyzxyzxyzxyzXYZ1235
https://orbitvu.co/api/v1/downloads.json?uid=xyzxyzxyzxyzxyzXYZ1235
Click to copy

Porządkowanie

Porządek przez: created_at, complete

# ascending
https://orbitvu.co/api/v1/downloads/?ordering=created_at
https://orbitvu.co/api/v1/downloads/?ordering=complete

# descending
https://orbitvu.co/api/v1/downoads/?ordering=-created_at
https://orbitvu.co/api/v1/downloads/?ordering=-complete
Click to copy

Utwórz nowe pobieranie

Inicjuje tworzenie nowego obiektu Download. Obiekt do pobrania składa się z prezentacji, Orbitvu Viewera i plików HTML.

URL: https://orbitvu.co/api/v1/downloads [.json|.xml]

Metoda: POST

Parametry:

  • viewer_license_id - wymagany; id Orbitvu Viewera do pobrania wraz z prezentacjami (można pobrać z punktu końcowego API przeglądarki)
  • presentation_ids - wymagany; identyfikatory prezentacji do pobrania
  • format_flat - 1 lub 0 - format archiwum
  • extra_emails - lista oddzielonych przecinkami adresów e-mail, które otrzymają link do pobrania

Zwrócone wartości:

id - identyfikator pobierania

message - wiadomość

status - OK | ERROR


Przykład kodu (Python):

import requests
requests.post(
    'https://orbitvu.co/api/v1/downloads.json',
    data={'viewer_license_id': 1, 'presentation_ids': [1, 2]},
    headers={'Authorization': 'token xxxxxxxxxxxxxxxxxxxx'})
Click to copy

Przykład kodu PHP:

5, 'ordering' => 'sku']); 

// GET VIEWER LICENSES
$viewerLicenses = callApi("https://orbitvu.co/api/v1/account/viewers");
if ($viewerLicenses && $presentations['results']) {
    // choose first presentation to download
    $prToDownload = $presentations['results'][1]; 
    // choose another presentation to download
    $prToDownload2 = $presentations['results'][4]; 
    // choose some viewer license
    $vLicense = $viewerLicenses[0];  
    // set request data
    $data =  "viewer_license_id=".$vLicense['id']."&presentation_ids=".$prToDownload['id']."&presentation_ids=".$prToDownload2['id'];

    // generate downloads
    $download = callApi("https://orbitvu.co/api/v1/downloads", [], 'post', $data); 
}
Click to copy

Szczegóły pobierania

Zwraca szczegóły konkretnego pobrania

URL: https://orbitvu.co/api/v1/downloads/<id>/ [.json|.xml]

Metoda: GET

Przykładowe zwrócone dane:

{
    "created_at": "2018-08-08T11:44:30",
    "file_name": "jqYpnFNsjKuok22XGrFx4G.zip",
    "complete": true,
    "viewer": "ORBITVU VIEWER Free360",
    "presentations": [
        "xyzxyzxyzxyzxyzXYZ1234",
        "xyzxyzxyzxyzxyzXYZ1235",
        "xyzxyzxyzxyzxyzXYZ1236",
        "xyzxyzxyzxyzxyzXYZ1237"
    ],
    "url": "https://orbitvu.co/api/v1/downloads/2",
    "download_url": "https://orbitvu.co/api/v1/downloads/2/download",
    "user_email": "[email protected]",
    "user_url": "https://orbitvu.co/api/v1/account/users/2"
}
Click to copy

Usuwanie pobierania

Usuń określony obiekt Download zidentyfikowany przez id

URL: https://orbitvu.co/api/v1/downloads/<id>/ [.json|.xml]

Metoda: DELETE

Kod zwrócenia: 204 (bez kontentu)

Przykład kodu Python:

import requests
requests.delete('https://orbitvu.co/api/v1/downloads/1/.json', headers={'Authorization': 'token xxxxxxxxxxxxxxxxxxxxxx'})
Click to copy
Previous Article Szczegóły konta
Still Need Help? Contact Us