Bug Fix: Organization ID type as string

DexterLaBora
Meraki Employee
Meraki Employee

Bug Fix: Organization ID type as string

 

Date of Change: 24 June 2019 [updated]

Endpoint Affected:   /organizations

 

Dashboard API uses various IDs both in the path and in the response bodies. Each ID should always be treated as a string even if the value only consists of numbers. This is detailed in our documentation.

 

The endpoint to return a list of organizations as well as create, update and delete, did not explicitly set the ID value as a string and this may cause issues with parsing the JSON properly in certain application languages. For example, this was commonly observed with JavaScript, where the default parser would interpret the value as a number, rounding the large ID number to an integer, causing the ID to change in value and no longer keeping the identifier exact.

 

On Monday, June 24th (updated from June 17th), Meraki will be making a change to address this issue by modifying the endpoint, wrapping the ID value in double quotes to ensure proper parsing.

 

Example of how JSON parsing would interpret the ID value:

 

Before Fix

 

 

[
 {
   "id": 643451796760550000,
   "name": "My organization"
 }
]

 

After Fix

 

 

[
 {
   "id": "643451796760551234",
   "name": "My organization"
 }
]

 



PLEASE NOTE

If you have written a custom workaround to the previous behavior, you may want to revisit that code. If you were using the popular Node module json-bigint, your code should continue to work as expected.

1 Reply 1
BrechtSchamp
Kind of a big deal

Good to hear!

Get notified when there are additional replies to this discussion.