0
votes

Similar question to here however I am using the v1.0 Office 365 Rest API and it looks like that question was based on accessing the EWS Managed API.

Anyways, as I discussed in the comments with @RohitNagarmal-MSFT, we are trying to use the Rest APIs to create a contact in a contact_folder.

Code sample is using ruby and RestClient gem.

folder_id = "...AAA="
url =  "https://outlook.office365.com/api/v1.0/me/contactfolders/#{folder_id}/contacts"
response = RestClient.post url, params.to_json, authorization: auth

Expected behavior: contact created in the specified contact folder

Observed behavior: contact is created but in the user's main contact folder. However the response would make it seem that it has something to do with the trailing '=' on the folder_id.

   response #=> 
{
"@odata.context"=>  "https://outlook.office365.com/api/v1.0/$metadata#Me/ContactFolders('...AAA%3D')/Contacts/$entity",
"@odata.id"=>"https://outlook.office365.com/api/v1.0/Users('[email protected]')/Contacts('...AAA=')",
 ...
 }
1
@RohitNagarmal-MSFT as discussed. Would love any thoughts you may have. Thanks so much!jgraft
how we can update contact with same APISunil Mathari

1 Answers

1
votes

Duplicate to Contacts are getting created only in root folder. This is a known problem with the API. I have a bug filed with our dev team. I don't have a timeframe to share on a fix at this point, but I can update this thread when I know more.