Org Units with + and # in their names can not be gotten · Issue #2579 · googleapis/google-api-python-client · GitHub | Latest TMZ Celebrity News & Gossip | Watch TMZ Live
Skip to content

Org Units with + and # in their names can not be gotten #2579

Open
@taers232c

Description

@taers232c

GAM is using the Google API Python client and making calls like this: cd is the Directory service object.

      result = callGAPI(cd.orgunits(), 'get',                                                                                                                                                        
                        customerId=GC.Values[GC.CUSTOMER_ID], orgUnitPath=orgUnitPath)                                                                                            

If the orgUnitPath contains + or #, the URL is not correct.

1: Get OU "Test/Test % Percent"
send: b'GET /admin/directory/v1/customer/my_customer/orgunits/Test/Test%20%25%20Percent?prettyPrint=true&alt=json HTTP/1.1\r\nHost: admin.googleapis.com\r\naccept: application/json\r\naccept-encoding: gzip, deflate\r\nuser-agent: GAM 7.05.08 - https://github.com/GAM-team/GAM / GAM Team <google-apps-manager@googlegroups.com> / Python 3.13.2 final / macOS-15.3.2-arm64-arm-64bit-Mach-O arm64 / (gzip)\r\nx-goog-api-client: gdcl/2.164.0 gl-python/3.13.2 cred-type/u\r\ncontent-length: 0\r\nauthorization: Bearer ya29.xxx\r\n\r\n'
reply: 'HTTP/1.1 200 OK\r\n'

Works

2: Get OU "Test/Test + Plus"
send: b'GET /admin/directory/v1/customer/C03pmm8ne/orgunits/Test/Test%20+%20Plus?prettyPrint=true&alt=json HTTP/1.1\r\nHost: admin.googleapis.com\r\naccept: application/json\r\naccept-encoding: gzip, deflate\r\nuser-agent: GAM 7.05.08 - https://github.com/GAM-team/GAM / GAM Team <google-apps-manager@googlegroups.com> / Python 3.13.2 final / macOS-15.3.2-arm64-arm-64bit-Mach-O arm64 / (gzip)\r\nx-goog-api-client: gdcl/2.164.0 gl-python/3.13.2 cred-type/u\r\ncontent-length: 0\r\nauthorization: Bearer ya29.xxx\r\n\r\n'
reply: 'HTTP/1.1 404 Not Found\r\n'

Fails, + was not URL encoded, it should be 'Test%20%2B%20Plus'

3: Get OU "Test/Test # Sharp"
send: b'GET /admin/directory/v1/customer/my_customer/orgunits/Test/Test%20 HTTP/1.1\r\nHost: admin.googleapis.com\r\naccept: application/json\r\naccept-encoding: gzip, deflate\r\nuser-agent: GAM 7.05.08 - https://github.com/GAM-team/GAM / GAM Team <google-apps-manager@googlegroups.com> / Python 3.13.2 final / macOS-15.3.2-arm64-arm-64bit-Mach-O arm64 / (gzip)\r\nx-goog-api-client: gdcl/2.164.0 gl-python/3.13.2 cred-type/u\r\ncontent-length: 0\r\nauthorization: Bearer ya29.xxx\r\n\r\n'
reply: 'HTTP/1.1 404 Not Found\r\n'

Fails, '%23%20Sharp?prettyPrint=true&alt=json' is all missing before HTTP

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions

    TMZ Celebrity News – Breaking Stories, Videos & Gossip

    Looking for the latest TMZ celebrity news? You've come to the right place. From shocking Hollywood scandals to exclusive videos, TMZ delivers it all in real time.

    Whether it’s a red carpet slip-up, a viral paparazzi moment, or a legal drama involving your favorite stars, TMZ news is always first to break the story. Stay in the loop with daily updates, insider tips, and jaw-dropping photos.

    🎥 Watch TMZ Live

    TMZ Live brings you daily celebrity news and interviews straight from the TMZ newsroom. Don’t miss a beat—watch now and see what’s trending in Hollywood.