Created
September 28, 2017 07:39
-
-
Save m4tlch/6ea93f1a1ae886394005d8bb009e76aa to your computer and use it in GitHub Desktop.
Auth token from amo
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(function(m, id, cb){ | |
$.ajax({ | |
method: "GET", | |
headers: {"X-Auth-Token": m.auth_token}, | |
url: m.server_base + "/ui/api/v1.1/ajax/mail/attach/" + id, | |
success: cb | |
}); | |
})( | |
// Объект авторизации AmoMail | |
AMOCRM.constant('amomail'), | |
// ID аттача из data-id | |
"98723861", | |
// Callback-функция для работы с полученным URL на скачивание аттача | |
function (data) { | |
console.log(data); | |
} | |
); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment