Skip to content

Documentation on NewClient is unclear #83

Open

Description

@empijei

The NewClient function currently accepts two parameters: appID and apiKey. If the user is using an API token, the appid and api token have to be passed in reverse order:

instead of calling

NewClient(appID,apitoken)

the correct way to use the library is to call

NewClient(apitoken,appID)

even if the function is declared with the following signature:

func NewClient(appID, apiKey string) *Client {

This is stated in the README.md, but conflicts with the current variable naming. Documentation on the NewClient function should be added or the names should be changed.

Activity

  1. added and removed on Jul 5, 2018
  2. added and removed on Jul 5, 2018
  3. sealcommerce commented on Dec 13, 2018

    @sealcommerce

    My code is something like this:

    c := intercom.NewClient("my-access-token", "")	
    user, err := ic.Users.FindByUserID("807786")
    fmt.Println(user)
    fmt.Printf("INTERCOM GO \n")
    fmt.Printf("%s \n", user.Email)
    _ = err
    

    However, it's returning a blank result like this:

    [intercom] user { id:  name: , user_id: , email:  }
    INTERCOM GO
    

    I'm not sure why we cannot connect to intercom with latest api version of go, could you please take a look

  4. jonbretman commented on Apr 17, 2019

    @jonbretman

    I think I've also just stumbled on this. Seems like if we set the API version to 1.1 in the console then FindByEmail doesn't work anymore. It returns a blank email and no error.

    The changelog for the API says that the find by email response type has changed so I assume this lib has to change to reflect that but then it would need to know what version of the API you are targeting.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions