Skip to content

New-MgUserContactFolderContact - BodyParamater issue with Number #3258

@PSFux25

Description

@PSFux25

Describe the bug

I am trying to create a contact in outlook (in folder) per powershell using New-MgUserContactFolderContact.
The contact should have a "PersonalNote" with a number. For example: 123456

Error:
New-MgUserContactFolderContact : were unable to deserialize
Status: 400 (BadRequest)
ErrorCode: UnableToDeserializePostBody

  • FullyQualifiedErrorId : UnableToDeserializePostBody,Microsoft.Graph.PowerShell.Cmdlets.NewMgUserContactFolderContact_Create

Expected behavior

New Contact created in a contact folder in outlook.

How to reproduce

$params = @{
GivenName = "A"
Surname = "B"
PersonalNotes = "123456"
}

Get-MgUserContactFolder -userid mr.test@contoso.com

$ContactFolderId = "........"

New-MgUserContactFolderContact -UserId mr.test@contoso.com -ContactFolderId $ContactFolderId -BodyParameter $params

SDK Version

2.26.1

Latest version known to work for scenario above?

2.25

Known Workarounds

PersonalNotes must include text, like "a123356".

$params = @{
GivenName = "A"
Surname = "B"
PersonalNotes = "text123456"
}

New-MgUserContactFolderContact -UserId "mr.test@contoso.com" -ContactFolderId $ContactFolderId -BodyParameter $params

Debug output

Click to expand log ```
</details>


### Configuration

_No response_

### Other information

_No response_

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions