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

deal_associations #24

Open
maelle opened this issue Oct 21, 2019 · 17 comments
Open

deal_associations #24

maelle opened this issue Oct 21, 2019 · 17 comments
Labels

Comments

@maelle
Copy link
Contributor

maelle commented Oct 21, 2019

@stephlocke is it expected that deal_associations() returns 0 row?

@stephlocke
Copy link
Collaborator

Nope!

@maelle
Copy link
Contributor Author

maelle commented Oct 21, 2019

Ah! I got zero row before my edits as well. Do you have an expected output that you could copy paste here?

@stephlocke
Copy link
Collaborator

> deal_associations(deals = get_deals(apikey ,max_iter = 10, 
+                                     max_properties = 1,
+                                     associations = "true"))
Error: Input must be list of vectors

@maelle
Copy link
Contributor Author

maelle commented Oct 21, 2019

The issue might start in get_deals actually, see below, I get no associations, I'll look at the raw JSON now.

library("hubspot")
deals <- get_deals(
  max_iter = 10,
  max_properties = 1,
  associations = "true"
)
deals
#> $`931633510`
#> $`931633510`$portalId
#> [1] 62515
#> 
#> $`931633510`$dealId
#> [1] 931633510
#> 
#> $`931633510`$isDeleted
#> [1] FALSE
#> 
#> $`931633510`$associations
#> $`931633510`$associations$associatedVids
#> list()
#> 
#> $`931633510`$associations$associatedCompanyIds
#> list()
#> 
#> $`931633510`$associations$associatedDealIds
#> list()
#> 
#> $`931633510`$associations$associatedTicketIds
#> list()
#> 
#> 
#> $`931633510`$properties
#> $`931633510`$properties$amount_in_home_currency
#> $`931633510`$properties$amount_in_home_currency$value
#> [1] "100"
#> 
#> $`931633510`$properties$amount_in_home_currency$timestamp
#> [1] 1.565734e+12
#> 
#> $`931633510`$properties$amount_in_home_currency$source
#> [1] "CALCULATED"
#> 
#> $`931633510`$properties$amount_in_home_currency$sourceId
#> NULL
#> 
#> $`931633510`$properties$amount_in_home_currency$versions
#> $`931633510`$properties$amount_in_home_currency$versions[[1]]
#> $`931633510`$properties$amount_in_home_currency$versions[[1]]$name
#> [1] "amount_in_home_currency"
#> 
#> $`931633510`$properties$amount_in_home_currency$versions[[1]]$value
#> [1] "100"
#> 
#> $`931633510`$properties$amount_in_home_currency$versions[[1]]$timestamp
#> [1] 1.565734e+12
#> 
#> $`931633510`$properties$amount_in_home_currency$versions[[1]]$source
#> [1] "CALCULATED"
#> 
#> $`931633510`$properties$amount_in_home_currency$versions[[1]]$sourceVid
#> list()
#> 
#> $`931633510`$properties$amount_in_home_currency$versions[[1]]$sourceMetadata
#> [1] ""
#> 
#> 
#> 
#> 
#> 
#> $`931633510`$imports
#> list()
#> 
#> $`931633510`$stateChanges
#> list()
purrr::map(deals, "association")
#> $`931633510`
#> NULL

Created on 2019-10-21 by the reprex package (v0.3.0)

@maelle
Copy link
Contributor Author

maelle commented Oct 21, 2019

@maelle
Copy link
Contributor Author

maelle commented Oct 21, 2019

Mmmh @stephlocke https://api.hubapi.com/deals/v1/deal/paged?hapikey=demo&includeAssociations=true&limit=2&properties=dealname does not show associations so is there an issue with the API itself?

It's the URL from the docs but the JSON I see is different from the one in the docs...

@stephlocke
Copy link
Collaborator

@maelle
Copy link
Contributor Author

maelle commented Oct 21, 2019

set by whom?

@stephlocke
Copy link
Collaborator

actually no, it's only got a single object interface not a list interface

@maelle
Copy link
Contributor Author

maelle commented Oct 21, 2019

do you agree that it's weird not to get the same object as the docs website? should I raise an issue "there"? (not sure where, prob the forum)

@stephlocke
Copy link
Collaborator

yeah, that seems sensible

@maelle
Copy link
Contributor Author

maelle commented Oct 21, 2019

well my "bug report" was marked as spam 🙃 I wrote a bug report for that too, let's see if my question gets through eventually 😅

@maelle
Copy link
Contributor Author

maelle commented Oct 22, 2019

Given the answer on the forum, it seems I won't be able to get associations for deals with the demo API key. I'll try next week with the LD API key, but what does this mean for external contributors? I hope there won't often be the case where something just can't be tackled with the demo API key.

@stephlocke
Copy link
Collaborator

We could create our own example account?

@maelle
Copy link
Contributor Author

maelle commented Oct 22, 2019

How much work would it be to create the fake data?

@stephlocke
Copy link
Collaborator

Not a huge amount. We only need a couple of contacts and deals to begin with :) we can expand as required

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

No branches or pull requests

2 participants