#Create new Customer $Credential = [System.Management.Automation.PSCredential]::new('USERNAME',(ConvertTo-SecureString 'PASSWORD' -AsPlainText -Force)) $Payload = "{ ""No"" : ""TEST10001"", ""Name"" : ""Test asdfgh"" }" $obj1 = Invoke-RestMethod ` -uri "https://NAVSERVERNAME:7048/NAVSERVERINSTANCE/ODatav4/Company('COMPANYNAME')/Customer?tenant=TENANTNAME$format=json" ` -Method Post ` -Body $Payload ` -Credential $Credential ` -ContentType "application/json"
Invoke-RestMethod : The remote server returned an error: (406) Not Acceptable.