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

Invalid :Type XeroContact #10

Open
saniya1741 opened this issue May 8, 2018 · 0 comments
Open

Invalid :Type XeroContact #10

saniya1741 opened this issue May 8, 2018 · 0 comments

Comments

@saniya1741
Copy link

Hi benedwards44,

I want to integrate salesforce contact with xero I copied your code but it showing an error invalid Type XeroContact.

Could you please help me with this?
Here is my code

public class casToXero {

    public static XeroContact createContact (String contactBody) {

    // The created contact to return
    XeroContact createdContact;

    // Execute the callout to the Contacts resource
    HttpResponse response = XeroCalloutUtility.executeCallout('POST', 'Contacts', contactBody);

    // If successful response
    if (response.getStatusCode() == 200) {

        // Use the parser to convert the response into Xero objects
        createdContact = XeroCalloutResponseParser.parseContacts(response.getBody())[0];
    }
    else {

        // Raise error
        throw new XeroAccountingApiException(response.getStatusCode() + ': ' + response.getBody());
    }

    return createdContact;
}

public class XeroAccountingApiException extends Exception {}

}

Please help me with this.

Many Thanks,
Saniya

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