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=')",
...
}