-
Notifications
You must be signed in to change notification settings - Fork 35
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
Json syntax error parsing "from" field from retrieved template #52
Comments
Thank you for reporting this. We will fix this in the next release. |
I ran RetrieveAllTemplatesSample and it worked. But looking at the So yes the code needs to be smarter when parsing that template response. Currently it assumes it is the object form of the from address. Can you tell me how you created that template so I can make sure I run and test your specific use-case? Can you provide the JSON that is returned for the template that is failing? You can sanitize it by replacing your domain names with "example.com" and substitute strings for any other personal/confidential information. Thanks. |
@yepher so it seems that this might be an issue with the template being "old". Some of them return
But others return
|
@yepher interesting. If I take one of the templates that return |
@yepher I just confirmed that solves my problem (just re-publishing the templates). It's up to you whether you want the smarter parser or not :) |
@pinaf, Awesome glad this is not holding you up. I think the code should handle the full spec so yes I think I will add it but I will make it a little lower priority now. |
Using
sparkpost-lib 0.16.1
.When using
ResourceTemplates.retrieve
to retrieve a template, the followingJsonSyntaxException
occurs when parsing thefrom
field.It seems like the java code expects a JSON object but the API returns a simple string.
Here is what the from field looks like when manually hitting the API at
https://api.sparkpost.com/api/v1/templates/mytemplate
with postman"from": "My Company <info@mycompany.com>",
The text was updated successfully, but these errors were encountered: