microsoftgraph/msgraph-beta-sdk-php

How do you build a URL with a $sign?

fzhan opened this issue · 2 comments

fzhan commented

Hi,

I've been crazy about trying to find the solution to access user photo, I've tried with all these URLs:

GET /me/photo/$value
GET /users/{id | userPrincipalName}/photo/$value
GET /groups/{id}/photo/$value
GET /me/contacts/{id}/photo/$value
GET /users/{id | userPrincipalName}/contacts/{id}/photo/$value
GET /me/contactfolders/{contactFolderId}/contacts/{id}/photo/$value
GET /users/{id | userPrincipalName}/contactfolders/{contactFolderId}/contacts/{id}/photo/$value

The response is always "null", not sure whether it's the issue with escaping the $ sign or not.

@fzhan you'd need to either escape the $ in your URL string or use a single-quoted string e.g. "/me/photo/\$value" OR '/me/photo/$value'

fzhan commented

@fzhan you'd need to either escape the $ in your URL string or use a single-quoted string e.g. "/me/photo/\$value" OR '/me/photo/$value'

it turns how that is not an issue with microsoft, rather that our company had not assign value to this attribute. Strange!