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

com.twilio.exception.ApiConnectionException: Unable to deserialize response: Can not deserialize value of type java.net.URI from String #577

Open
vteja11 opened this issue Sep 9, 2020 · 2 comments
Assignees
Labels
status: work in progress Twilio or the community is in the process of implementing type: bug bug in the library

Comments

@vteja11
Copy link

vteja11 commented Sep 9, 2020

Return the above exception

when using this code

import com.twilio.Twilio;
import com.twilio.base.ResourceSet;
import com.twilio.rest.api.v2010.account.IncomingPhoneNumber;

public class Example {
    // Find your Account Sid and Token at twilio.com/console
    // DANGER! This is insecure. See http://twil.io/secure
    public static final String ACCOUNT_SID = "ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX";
    public static final String AUTH_TOKEN = "your_auth_token";

    public static void main(String[] args) {
        Twilio.init(ACCOUNT_SID, AUTH_TOKEN);
        ResourceSet<IncomingPhoneNumber> incomingPhoneNumbers =
            IncomingPhoneNumber.reader()
            .limit(20)
            .read();

        for(IncomingPhoneNumber record : incomingPhoneNumbers) {
            System.out.println(record.getSid());
        }
    }
}

Error details:

com.twilio.exception.ApiConnectionException: Unable to deserialize response: Can not deserialize value of type java.net.URI from String 
 "voice_url": "http://sb360.com/forward?PhoneNumber=208-209-3062&FailUrl=http://sb360.com/[email protected]&Message=Thanks for calling Jiseki. Please leave a message and%we will get back to you shortly.&Transcribe=true&",  is not a valid textual representation ,problem: Malformed escape pair at index 199```
@childish-sambino
Copy link
Contributor

Think we need a special deserializer that's able to URI-encode the returned URL which could contain spaces since we're attempting to represent it as a URI.

This issue has been added to our internal backlog to be prioritized. Pull requests and +1s on the issue summary will help it move up the backlog.

@childish-sambino childish-sambino added status: help wanted requesting help from the community type: bug bug in the library labels Sep 15, 2020
WillBDaniels pushed a commit to WillBDaniels/twilio-java that referenced this issue Oct 2, 2020
…pplied to any url field of your choosing.
@childish-sambino childish-sambino added status: work in progress Twilio or the community is in the process of implementing and removed status: help wanted requesting help from the community labels Oct 2, 2020
@sbansla sbansla self-assigned this Jul 30, 2024
@sbansla
Copy link
Contributor

sbansla commented Jul 30, 2024

@vteja11
I am doing testing for voice_url
I am trying to set VoiceUrl, but it looks like backend is not allowing to set VoiceUrl if there are spaces in between.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
status: work in progress Twilio or the community is in the process of implementing type: bug bug in the library
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants