API & Developers

API & Developers

Connect with other developers from around the world and collaborate on ideas using the Smartsheet API.

Smartsheet Bridge special characters not encoding in endpoint URL

✭✭✭✭✭✭
edited 09/26/24 in API & Developers

Has anyone ran into this issue?

I would like to parse an ISO formatted time into the endpoint URL, but it's not encoding "+" to %2B.

My particular use case is getting the latest CVEs from Vulnerability APIs (nist.gov)

The endpoint should be formatted as such:

https://services.nvd.nist.gov/rest/json/cves/2.0/?lastModStartDate=2021-08-04T13:00:00.000%2B01:00&lastModEndDate=2021-10-22T13:36:00.000%2B01:0

When getting the current date in Smartsheet bridge, it doesn't automatically encode the + sign to %2B in the {{data reference}} of the endpoint.

Any Suggestions?

Sincerely,

Jacob Stey

Tags:

Best Answer

  • ✭✭✭✭✭✭
    Answer ✓

    Hey all,

    If you run into this post — you can fix the issue with a single line of javascript.

    return inputString.replace(/+/g, "%2B")

    where the parameters are inputString with the appropriate value:

    Sincerely,

    Jacob Stey

Answers

  • ✭✭✭✭✭✭
    Answer ✓

    Hey all,

    If you run into this post — you can fix the issue with a single line of javascript.

    return inputString.replace(/+/g, "%2B")

    where the parameters are inputString with the appropriate value:

    Sincerely,

    Jacob Stey

Trending in API & Developers