Jump to content
Claris Engage 2025 - March 25-26 Austin Texas ×

This topic is 3800 days old. Please don't post here. Open a new topic instead.

Recommended Posts

  • Newbies
Posted

Hi All

 

Win7, FM12 Advanced.   I'm having issues creating shortened URLs and bitmarks using bit.ly's API. (http://dev.bitly.com/links.html#v3_user_link_save)

 

I set the required URL as a variable in a script (mainly for debugging) and then use that to either "Insert from URL" or set the URL of a web viewer. The response of either is the same error e.g.

<?xml version="1.0" encoding="UTF-8"?>
<response>
<status_code>500</status_code>
<status_txt>INVALID_URI</status_txt>
</response>

Sample URL (api key omitted and line breaks added for legibility):

https://api-ssl.bitly.com/v3/user/link_save?access_token=my_api_key&format=xml&title=Baillieu%20
Print%20Collection%3A%200000.1067.000.000&longUrl=http%3A%2F%2Fgallery.its.unimelb.edu.au%2Fumbl
prints%2Fimu.php%3Frequest%3Dload%26irn%3D105133%26ecatalogue%3Don%26view%3Ddetails

If I copy and paste the result of the calculation into IE (or any other browser) I get the correct response (bitmark created with the specified title and short URLs returned). Same also applies to using the "Open URL" script step.

 

Any ideas? URL encoding or HTTPS issue?

 

Ben

Posted

I'm having a similar issue - Win 7, FMP12.

 

I'm using 'set url' in web-viewer to post data to a a web-site. I build the url in a common field and 'set url' in Web Viewer to the common field.

 

The url is 1598 characters long.

 

The receiving site accepts the post, but ignores the last 500 characters of the post. It successfully and accurately processes the first 1098.

 

If I copy the url from the field in FMPA12 and paste it directly into a browser, the entire url is processed correctly.

 

 

Is there a size limit on the url the web viewer can handle? Or an issue when using a field or $var to 'Set URL' in Web Viewer?

 

 

If I use Open URL it works, but I don't want my user to have to manage meaningless windows that open and stay open in their browser as a result of Open URL.

 

Here's the url with credentials and site names edited out:

 

https://api.xxxxxxxxxxxx.com/upload/qqqqqqqqqqqq/yyyyyyyyyyyyyyyyy.asp?line1="wwwwwwwwww","zzzzzzzzzz","1","1","7/22/2013","362"&line2="RV","101","RV","3","3","3","3","3","3","3","3","3","3","3","3","3","4","4","4","4","4","4","4","4","4","4","4","4","4","4","4","4","4","4","4","4","4","4","4","4","4","4","4","4","4","4","3","3","3","3","3","3","3","3","3","3","3","3","3","3","4","4","4","4","4","4","4","4","4","4","4","4","4","4","4","4","4","4","4","4","4","4","4","4","4","4","4","4","4","4","4","4","4","4","4","4","4","4","4","4","4","4","4","4","4","4","4","4","4","4","4","4","4","4","4","4","4","4","4","4","4","4","4","4","4","4","4","4","4","4","4","4","4","4","4","4","4","4","4","4","4","4","4","4","4","4","4","4","4","4","4","4","4","4","4","4","4","4","4","4","4","4","4","4","4","4","4","4","4","4","4","4","4","4","4","4","4","4","4","4","4","4","4","4","4","4","4","4","4","4","4","4","4","4","4","4","4","4","4","4","4","4","4","4","4","4","4","4","4","4","4","4","4","4","4","4","4","4","4","4","4","4","4","4","4","4","4","4","4","4","4","4","4","4","4","4","4","4","4","4","4","4","4","4","4","4","4","4","4","4","4","4","4","4","4","4","4","4","4","4","4","4","4","4","4","4","4","4","4","4","4","4","4","4","4","4","4","4","4","4","4","4","4","4","4","4","4","4","4","4","4","4","4","4","4","4","4","4","4","4","4","4","4","4","4","4","4","4","4","4","4","4","4","4","3","3","3","3","3","3","3","3","3","3","3","3","3","3","4","4","4","4","4","4","4","4","4","4","4","4","4","4","4","4","4","4","4","4","4","4","4","4","4","4","4","4","4","4","3","3","3","3","3","3","3"

 

 

  • 11 months later...
Posted

It sounds like the infamous automatic URL encoding bug in Insert From URL. In your sample URI, you have properly already encoded special characters. Unfortunately, the Insert From URL is then double-encoding certain characters like the percent symbol, so the service is getting mangled values for those parameters. 

Here's what it is probably sending (notice your % are now %25): 

https://api-ssl.bitly.com/v3/user/link_save?access_token=my_api_key&format=xml&title=Baillieu%2520
Print%2520Collection%253A%25200000.1067.000.000&longUrl=http%253A%252F%252Fgallery.its.unimelb.edu.au%252Fumbl
prints%252Fimu.php%253Frequest%253Dload%2526irn%253D105133%2526ecatalogue%253Don%2526view%253Ddetails

In your case, you might be able to work around this (although I see this was from July 2013, so maybe you've already done this or given up) by NOT encoding the URI: 

https://api-ssl.bitly.com/v3/user/link_save?access_token=my_api_key&format=xml&title=Baillieu  Print Collection: 0000.1067.000.000&longUrl=http://gallery.its.unimelb.edu.au/umbl prints/imu.php?request=load&irn=105133&ecatalogue=on&view=details

Unfortunately for some of us who have cases where we have a mix of characters that need to be encoded, this work-around doesn't help, but it might for this situation. 

This topic is 3800 days old. Please don't post here. Open a new topic instead.

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.