twilio-node icon indicating copy to clipboard operation
twilio-node copied to clipboard

[Bug]: Sync Map retrieval errors on URLs as keys

Open Blackglade opened this issue 9 months ago • 2 comments

Here is the code I am using to store/retrieve data from my sync maps.

await client.sync.v1
    .services(SYNC_SERVICE_SID)
    .syncMaps(ENVIRONMENT_MAP_SID)
    .syncMapItems.create({
      key: "https://test.example.com",
      data: {
        lastUpdated: new Date().toISOString(),
      },
    });

// Retrieval

await client.sync.v1
    .services(SYNC_SERVICE_SID)
    .syncMaps(ENVIRONMENT_MAP_SID)
    .syncMapItems("https://test.example.com")
    .fetch();

Despite me double checking the key does indeed exist on the sync map, I can't access it via the API. I get the following error:

/Users/harshbaid/Desktop/twilio/node_modules/twilio/lib/rest/sync/v1/service/syncMap/syncMapItem.js:35
            throw new Error("Parameter 'key' is not valid.");
                  ^

Error: Parameter 'key' is not valid.
    at new SyncMapItemContextImpl (/Users/harshbaid/Desktop/twilio/node_modules/twilio/lib/rest/sync/v1/service/syncMap/syncMapItem.js:35:19)

Blackglade avatar Mar 18 '25 03:03 Blackglade

So, this seems to be a case. While you can create a Sync Map object with a DNS address because the object is passed as Url form encoded in request body. During retrieval, the object is retrieved using path params, where DNS address is not allowed. We will see what could be the next steps

manisha1997 avatar Jun 26 '25 14:06 manisha1997

This issue is stale because it has been open for 30 days with no activity. Please remove stale label or comment or this issue will be closed in 30 days.

github-actions[bot] avatar Oct 09 '25 09:10 github-actions[bot]