Question

Accessing Copper from Google Apps Script (GAS)

  • 6 October 2022
  • 2 replies
  • 37 views

Are there any examples of how to call Copper API from a Google Apps Script?


2 replies

Userlevel 2
Badge +2

Hi @DavKirsch,

Thank you for submitting your question to the Copper Community.

You can find all of our API Documentation in our Copper API Developer Portal. We currently do not have specific documentation in regards to Google Apps Script. If you have any specific questions or run into a roadblock calling the Copper API, please reach out to our Copper Support Team by Starting a Conversation via the in-app Chat visible while logged into Copper.

Thank you for engaging in the Copper Community!

-Chris

I have tried the following:

 

function getCopperLeads() {

var apiUrl = "https://api.copper.com/developer_api/v1/leads";

var apiKey = "MY_API_KEY"; 

var options = {

  "headers": {

    "X-PW-AccessToken": apiKey,

    "X-PW-Application": "developer_api",

    "Content-Type": "application/json"

  },

  "method": "get",

  "muteHttpExceptions": true

};

var response = UrlFetchApp.fetch(apiUrl, options);

var data = JSON.parse(response.getContentText());

Logger.log(data); // Prints the list of leads to the Apps Script logs

}

The resultant log is:   {error=not_found}

 

I don’t understand what I am doing wrong. please help.

Reply