Skip to content

Instantly share code, notes, and snippets.

View baileymatthewr's full-sized avatar
💭
Learning

Matt Bailey baileymatthewr

💭
Learning
View GitHub Profile
@baileymatthewr
baileymatthewr / fetchMethod.gs
Last active May 25, 2024 04:36
Google Script URL Fetch with Credentials for Persistent URLs
function fetchMethod()
{
var options = {};
// This code uses a "headers" option in order to pass in credentials
options.headers = {"Authorization": "Basic " + Utilities.base64Encode(username + ":" + password)};
// The code below logs the output of the following Persistent URL.
var response = UrlFetchApp.fetch("https://www.doba.com/retailer-export/get/type/product/tag/*", options);
Logger.log(response.getContentText()); //Log the download in the Google Script Logger
DriveApp.createFile("file_name_of_your_choice", response); //Download the file to Google Drive.
}
<?php
$api_url = "https://sandbox.doba.com/api/20110301/xml_retailer_api.php"; //This is Sandbox
$api_username = "username"; //Username is same between GUI and API
$api_password = "password"; //Password is same between GUI and API
$api_retailer_id = "5089840"; // This Retailer ID MUST match the URL you are posting to
$strRequest = "
<dce>
<request>
<authentication>
<username>". $api_username ."</username>
<?php
$api_url = "https://sandbox.doba.com/api/20110301/xml_retailer_api.php"; //This is Sandbox
$api_username = "username"; //Username is same between GUI and API
$api_password = "password"; //Password is same between GUI and API
$api_retailer_id = "5089840"; // This Retailer ID MUST match the URL you are posting to
$strRequest = "
<dce>
<request>
<authentication>
<username>". $api_username ."</username>
<?php
$api_url = "https://sandbox.doba.com/api/20110301/xml_retailer_api.php"; //This is Sandbox
$api_username = "username"; //Username is same between GUI and API
$api_password = "password"; //Password is same between GUI and API
$api_retailer_id = "5089840"; // This Retailer ID MUST match the URL you are posting to
$strRequest = "
<dce>
<request>
<authentication>
<username>". $api_username ."</username>
<?php
$api_url = "https://sandbox.doba.com/api/20110301/xml_retailer_api.php"; //This is Sandbox
$api_username = "username"; //Username is same between GUI and API
$api_password = "password"; //Password is same between GUI and API
$api_retailer_id = "5089840"; // This Retailer ID MUST match the URL you are posting to
$strRequest = "
<dce>
<request>
<authentication>
<username>". $api_username ."</username>
<?php
$api_url = "https://sandbox.doba.com/api/20110301/xml_retailer_api.php"; //This is Sandbox
$api_username = "username"; //Username is same between GUI and API
$api_password = "password"; //Password is same between GUI and API
$api_retailer_id = "5089840"; // This Retailer ID MUST match the URL you are posting to
$strRequest = "
<dce>
<request>
<authentication>
<username>". $api_username ."</username>
<?php
$api_url = "https://sandbox.doba.com/api/20110301/xml_retailer_api.php"; //This is Sandbox
$api_username = "username"; //Username is same between GUI and API
$api_password = "password"; //Password is same between GUI and API
$api_retailer_id = "5089840"; // This Retailer ID MUST match the URL you are posting to
$strRequest = "
<dce>
<request>
<authentication>
<username>". $api_username ."</username>
<?php
$api_url = "https://sandbox.doba.com/api/20110301/xml_retailer_api.php"; //This is Sandbox
$api_username = "username"; //Username is same between GUI and API
$api_password = "password"; //Password is same between GUI and API
$api_retailer_id = "5089840"; // This Retailer ID MUST match the URL you are posting to
$strRequest = "
<dce>
<request>
<authentication>
<username>". $api_username ."</username>
<?php
$api_url = "https://sandbox.doba.com/api/20110301/xml_retailer_api.php";
$api_username = "username";
$api_password = "password";
$api_retailer_id = "5089840";
$strRequest = "
<dce>
<request>
<authentication>
<username>". $api_username ."</username>
<?php
$api_url = "https://sandbox.doba.com/api/20110301/xml_retailer_api.php"; // This is Sandbox
$api_username = "username"; //Username is the same between GUI and API
$api_password = "password"; //Password is the same between GUI and API
$api_retailer_id = "5089840"; //Retailer ID MUST match URL you are posting to
$strRequest = "
<dce>
<request>
<authentication>
<username>". $api_username ."</username>