Comments (14)
Hi @liorhar,
We escape identity attributes like name
on output in the API, but it looks like we weren't unescaping HTML input on the /companies
endpoint. We are doing this now so this issue shouldn't compound itself. Will you be able to fix up your data? Perhaps by searching for companies with HTML entities in their name?
from intercom-java.
I'm not sure I understand your response. Are you saying that the read endpoint will now return the company name escaped, so when I update the company it should all just work?
My data is sanitized, I never send HTML elements in the name
from intercom-java.
from intercom-java.
We escape name
in the API, so if your company name was Foo & Bar
, it would be rendered as Foo & Bar
in the API response.
So if you read that name in the intercom-java client, and submitted an update, it would be stored as Foo & Bar
, and then re-rendered as Foo & Bar
.
Now, after the bug fix if you submit Foo & Bar
, it will stay stored as Foo & Bar
, and be rendered as Foo & Bar
. Does that make sense?
from intercom-java.
Yes, it does.
So is the bug fixed already on your end?
Do I have to encode the name before updating the company using the java client or does it do it automatically?
from intercom-java.
The bug is fixed on our end. You can either submit Foo & Bar
or Foo & Bar
and it will be stored as Foo & Bar
in the datastore.
from intercom-java.
I'm sorry but I'm still getting the following error when updating companies with special characters:
updating Banes & Spot, message: custom_attributes invalid, length too long: name
from intercom-java.
Is it possible that you have a really long custom attribute called name
? Could you print out the Company object you are trying to save?
from intercom-java.
It is possible, see the screenshot attached to the issue. But that's only because your endpoint has expanded a single ampersand into dozens of them.
I set the new name which is short Banes & Spot
yet it fails to update probably cause of the previous value.
from intercom-java.
But that's a custom_attribute? custom_attributes
are key/value pairs that you can set arbitrarily. Are you using that alongside a normal name
field?
from intercom-java.
yes, I'm using custom attributes but those are either boolean or numeric so their value can't be long. This is the code snippet:
company.setName(companyStats.name)
company.addCustomAttribute(CustomAttribute.newBooleanAttribute("hasDemoData", companyStats.hasDemoData))
company.addCustomAttribute(CustomAttribute.newIntegerAttribute("filledFinancialInfo", companyStats.hasSignificantData))
company.addCustomAttribute(CustomAttribute.newIntegerAttribute("employees", companyStats.numberOfEmployees))
company.addCustomAttribute(CustomAttribute.newIntegerAttribute("size", companyStats.size))
company.addCustomAttribute(CustomAttribute.newDoubleAttribute("averageAge", companyStats.averageAge))
company.setRemoteCreatedAt(companyStats.createdAt.atZone(ZoneOffset.UTC).toEpochSecond)
if (companyStats.numberOfDaysLeftToTrial.isDefined) company.addCustomAttribute(CustomAttribute.newIntegerAttribute("numberOfDaysLeftToTrial", companyStats.numberOfDaysLeftToTrial.get))
Company.update(company)
```
from intercom-java.
OK - could you give me some information to track down the failing request. Do you have an app_id, or better yet a request_id from the failed call?
from intercom-java.
can we move this discussion to a private channel?
from intercom-java.
Yep, feel free to get in touch through the Intercom widget (ask for bob)
from intercom-java.
Related Issues (20)
- Please add possibility to update OWNER_ID field in contact and user HOT 1
- NotFoundException user not found when creating a user HOT 1
- Document what version of the Intercom API this SDK supports HOT 3
- Unable to fetch Admin objects using list(Map<String, String> params) method HOT 2
- Why doesn't conversation object contain a statistics object?
- Multiple CVE's exists on the jackson version used by the intercom library. HOT 2
- Missing "external_id" in the `Contact` model HOT 3
- Restore Company.delete method HOT 2
- Bintray deprecation - move artifacts elsewhere HOT 2
- InvalidDefinitionException: Joda date/time type `org.joda.time.DateTime` not supported by default HOT 1
- Finding Contacts or Users Returns Deserialization Error HOT 4
- Support for version 2.3
- Contact.update() doesn't work HOT 2
- joda_zoneinfomap FATAL EXCEPTION HOT 1
- List for tags and contacts returns empty response (no data)
- Monthly spend value doesn't update when the value is set to zero
- Is this library dead? HOT 3
- Tagging API seems odd, or maybe needs more documentation HOT 2
- conversationId not returned from Conversation.Create
- Intercom-java SDK is not compatible with recent versions of Jackson HOT 3
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from intercom-java.