Edits history of script submission #163 for ' List user IDs (ocs)'

  • deno
    One script reply has been approved by the moderators
    Ap­pro­ved
    // Should return an XML document on success
    type Nextcloud = {
      baseUrl: string;
      username: string;
      password: string;
    };
    export async function main(nextcloud_res: Nextcloud) {
      const resp = await fetch(`${nextcloud_res.baseUrl}/ocs/v1.php/cloud/users`, {
        headers: {
          Authorization:
            "Basic " + btoa(nextcloud_res.username + ":" + nextcloud_res.password),
          "OCS-APIRequest": "true",
        },
      });
      if (!resp.ok) {
        throw Error(`HTTP Error ${resp.status} - ${await resp.text()}`);
      }
      return await resp.text();
    }
    

    Submitted by hugo697 380 days ago

  • deno
    // Should return an XML document on success
    type Nextcloud = {
      baseUrl: string;
      username: string;
      password: string;
    };
    export async function main(nextcloud_res: Nextcloud) {
      const resp = await fetch(`${nextcloud_res.baseUrl}/ocs/v1.php/cloud/users`, {
        headers: {
          Authorization:
            "Basic " + btoa(nextcloud_res.username + ":" + nextcloud_res.password),
          "OCS-APIRequest": "true",
        },
      });
      if (!resp.ok) {
        throw Error(`HTTP Error ${resp.status} - ${await resp.text()}`);
      }
      return await resp.text();
    }
    

    Submitted by admin 1013 days ago

  • deno
    
    // Should return an XML document on success
    type Nextcloud = {
      baseUrl: string;
      username: string;
      password: string;
    };
    export async function main(nextcloud_res: Nextcloud) {
      const resp = await fetch(`${nextcloud_res.baseUrl}/ocs/v1.php/cloud/users`, {
        headers: {
          'Authorization': 'Basic ' + btoa(nextcloud_res.username + ':' + nextcloud_res.password),
          'OCS-APIRequest': 'true',
        }
      });
      if (!resp.ok) {
        throw Error(`HTTP Error ${resp.status} - ${await resp.text()}`);
      }
      return await resp.text();
    }
    

    Submitted by admin 1016 days ago

  • deno
    import * as wmill from "https://deno.land/x/[email protected]/mod.ts"
    
    // Should return an XML document on success
    export async function main(nextcloud_res: wmill.Resource<"c_nextcloud">) {
      const resp = await fetch(`${nextcloud_res.baseUrl}/ocs/v1.php/cloud/users`, {
        headers: {
          'Authorization': 'Basic ' + btoa(nextcloud_res.user + ':' + nextcloud_res.password),
          'OCS-APIRequest': 'true',
        }
      });
      if (!resp.ok) {
        throw Error(`HTTP Error ${resp.status} - ${await resp.text()}`);
      }
      return await resp.text();
    }
    

    Submitted by adam186 1144 days ago

  • deno
    import * as wmill from "https://deno.land/x/[email protected]/mod.ts"
    
    // Should return an XML document on success
    export async function main(nextcloud_res: wmill.Resource<"c_nextcloud">) {
      const resp = await fetch(`${nextcloud_res.baseUrl}/ocs/v1.php/cloud/users`, {
        headers: {
          'Authorization': 'Basic ' + btoa(nextcloud_res.user + ':' + nextcloud_res.password),
          'OCS-APIRequest': 'true',
        }
      });
      if (!resp.ok) {
        throw Error(`HTTP Error ${resp.status} - ${await resp.text()}`);
      }
      return await resp.text();
    }
    

    Submitted by adam186 1179 days ago

  • deno
    import * as wmill from "https://deno.land/x/[email protected]/mod.ts"
    
    // Should return an XML document on success
    export async function main(nextcloud_res: wmill.Resource<"c_nextcloud">) {
      const resp = await fetch(`${nextcloud_res.baseUrl}/ocs/v1.php/cloud/users`, {
        headers: {
          'Authorization': 'Basic ' + btoa(nextcloud_res.user + ':' + nextcloud_res.password),
          'OCS-APIRequest': 'true',
        }
      });
      if (!resp.ok) {
        throw Error(`HTTP Error ${resp.status} - ${await resp.text()}`);
      }
      return await resp.text();
    }
    

    Submitted by jaller94 1329 days ago