GithubHelp home page GithubHelp logo

Comments (7)

dehora avatar dehora commented on June 19, 2024

Hi @luposlip,I think you're seeing this because of a particular behavior in Intercom which is reflected in the API - when the company has no users the company doesn't appear in API data or the product. It's mentioned http://doc.intercom.io/api/#list-companies (Note that the API does not include companies who have no associated users in list responses.) but that's easy to miss. I'm hoping this will get addressed but it'll be a change in Intercom rather than a client library change.

If you see this with a company that has users (eg a company that's visible in the product), please let me know.

from intercom-java.

luposlip avatar luposlip commented on June 19, 2024

Alright @dehora . Just tried below code:

    HashMap<String, String> map = new HashMap<String, String>();
    map.put("name", "Blue Sun");
    Company company2 = Company.find(map);

    Map<String, String> params = new HashMap<String, String>();
    params.put("email", "[email protected]");
    User user = User.find(params);

    user.addCompany(company2);
    User.update(user);

Both company2 and user seems fine in the debugger, so data seem to be read correctly from the API.

But The last line of code - User.update(user) - throws the following:

Exception in thread "main" io.intercom.api.ClientException: bad 'updated_at' parameter
at io.intercom.api.HttpClient.throwException(HttpClient.java:198)
at io.intercom.api.HttpClient.handleError(HttpClient.java:154)
at io.intercom.api.HttpClient.runRequest(HttpClient.java:147)
at io.intercom.api.HttpClient.post(HttpClient.java:93)
at io.intercom.api.DataResource.update(DataResource.java:24)
at io.intercom.api.User.update(User.java:61)

from intercom-java.

dehora avatar dehora commented on June 19, 2024

@luposlip thanks! I can replicate what you're seeing, working on a fix.

from intercom-java.

luposlip avatar luposlip commented on June 19, 2024

Appreciate it @dehora! :-)

from intercom-java.

dehora avatar dehora commented on June 19, 2024

@luposlip There's a 0.0.3 version in jcenter now if you want to try it out.

from intercom-java.

luposlip avatar luposlip commented on June 19, 2024

It works now, thanks for the speedy response! :)

from intercom-java.

bledari avatar bledari commented on June 19, 2024

Hi I have some issues.
I was trying to create companies through Postman and it didn't work, then with curl code it worked! I can retrieve companies by id and understand the list of companies displays only those with user. Now users I see are contacts. I was able to associate a contact to a company (difficult because doc has error, mark it as a POST) but still nothing in list companies.

You can try to reproduce this or just pass me some working Postman collection and I figure out why

from intercom-java.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.