Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

marcus/gcontacts3 Google Contacts Ballerina library gives only few contacts when all contatcs requested #1

Open
SupunS opened this issue Aug 23, 2018 · 0 comments

Comments

@SupunS
Copy link

SupunS commented Aug 23, 2018

Reported by @HishanIndrajith
Original issue: ballerina-platform/ballerina-lang#10153

Description:
marcus/gcontacts3 Google Contacts Ballerina library gives only few contacts when all contatcs requested. Also erandig/gcontacts3 library doesn't work with my ballerina version. My version is 0.981.0.

Steps to reproduce:
This is my code

import ballerina/config;
import ballerina/log;
import ballerina/io;
import marcus/gcontacts3;

documentation{A valid access token with google contact access.}
string accessToken = config:getAsString("ACCESS_TOKEN");

documentation{The client ID for your application.}
string clientId = config:getAsString("CLIENT_ID");

documentation{The client secret for your application.}
string clientSecret = config:getAsString("CLIENT_SECRET");

documentation{A valid refreshToken with gmail and google sheets access.}
string refreshToken = config:getAsString("REFRESH_TOKEN");

documentation{Sender email address.}
string email = config:getAsString("USER");

endpoint gcontacts3:Client contactsClient {
    clientConfig: {
        auth: {
            accessToken: accessToken,
            refreshToken: refreshToken,
            clientId: clientId,
            clientSecret: clientSecret
        }
    }
};


function getCustomerDetailsFromGSheet() returns (xml) {
    //Read all the values from the sheet.
    xml values = check contactsClient->getAllContacts(email);
    log:printInfo("Retrieved contacts xml from mail"+ sheetName);
    return values;
}

function main(string... args) {
    log:printDebug("getting contacts");
    xml result = getCustomerDetailsFromGSheet();
    xml x =result.entry.title;
    io:println(x.getTextValue());
    //io:println(result);
}

Affected Versions:
0.981.0
OS, DB, other environment details and versions:
Windows 10

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant