<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic &amp;quot;status&amp;quot;: &amp;quot;error&amp;quot;, &amp;quot;messages&amp;quot;: [&amp;quot;Use JSON in parameter service.&amp;quot;], &amp;quot;code&amp;quot;: 500 in ArcGIS REST APIs and Services Questions</title>
    <link>https://community.esri.com/t5/arcgis-rest-apis-and-services-questions/quot-status-quot-quot-error-quot-quot-messages/m-p/1586983#M4949</link>
    <description>&lt;P&gt;I am trying to update the ouput directory of a service via powershell. Long story short domain changed and only have a few hundred to do. I get the following error when running the script&amp;nbsp;&lt;STRONG&gt;"status": "error", "messages": ["Use JSON in parameter service."], "code": 500&lt;/STRONG&gt;&lt;/P&gt;&lt;BLOCKQUOTE&gt;&lt;P&gt;&lt;SPAN&gt;$editServiceUrl = "https://&amp;lt;myserverdomain&amp;gt;//server/admin/services/Hosted/&amp;lt;myFeatureClass&amp;gt;.FeatureService/edit"&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;updateBody = @{&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;"outputDir:" "\\server.domain.com\arcgisserver\arcgisoutput"&lt;/P&gt;&lt;P&gt;# I have also tried&amp;nbsp;"outputDir:" "\\\\server.domain.com\\arcgisserver\\arcgisoutput"&lt;BR /&gt;} | ConvertTo-Json&lt;/P&gt;&lt;P&gt;$response = Invoke-RestMethod -Uri $editServiceUrl -Method Post -Body $updateBody -Headers @{&lt;BR /&gt;"Authorization" = "Bearer $token"&lt;BR /&gt;} -ContentType "application/x-www-form-urlencoded"&lt;/P&gt;&lt;/BLOCKQUOTE&gt;&lt;P&gt;I have not tried to update services this way before. I can publish/delete services no issues (I know not apples to apples) .&amp;nbsp;&lt;/P&gt;&lt;P&gt;Is it my formatting of the json string or do I have to update the entire service properties with just the one change?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Wed, 19 Feb 2025 15:26:59 GMT</pubDate>
    <dc:creator>ALGIS</dc:creator>
    <dc:date>2025-02-19T15:26:59Z</dc:date>
    <item>
      <title>"status": "error", "messages": ["Use JSON in parameter service."], "code": 500</title>
      <link>https://community.esri.com/t5/arcgis-rest-apis-and-services-questions/quot-status-quot-quot-error-quot-quot-messages/m-p/1586983#M4949</link>
      <description>&lt;P&gt;I am trying to update the ouput directory of a service via powershell. Long story short domain changed and only have a few hundred to do. I get the following error when running the script&amp;nbsp;&lt;STRONG&gt;"status": "error", "messages": ["Use JSON in parameter service."], "code": 500&lt;/STRONG&gt;&lt;/P&gt;&lt;BLOCKQUOTE&gt;&lt;P&gt;&lt;SPAN&gt;$editServiceUrl = "https://&amp;lt;myserverdomain&amp;gt;//server/admin/services/Hosted/&amp;lt;myFeatureClass&amp;gt;.FeatureService/edit"&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;updateBody = @{&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;"outputDir:" "\\server.domain.com\arcgisserver\arcgisoutput"&lt;/P&gt;&lt;P&gt;# I have also tried&amp;nbsp;"outputDir:" "\\\\server.domain.com\\arcgisserver\\arcgisoutput"&lt;BR /&gt;} | ConvertTo-Json&lt;/P&gt;&lt;P&gt;$response = Invoke-RestMethod -Uri $editServiceUrl -Method Post -Body $updateBody -Headers @{&lt;BR /&gt;"Authorization" = "Bearer $token"&lt;BR /&gt;} -ContentType "application/x-www-form-urlencoded"&lt;/P&gt;&lt;/BLOCKQUOTE&gt;&lt;P&gt;I have not tried to update services this way before. I can publish/delete services no issues (I know not apples to apples) .&amp;nbsp;&lt;/P&gt;&lt;P&gt;Is it my formatting of the json string or do I have to update the entire service properties with just the one change?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 19 Feb 2025 15:26:59 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-rest-apis-and-services-questions/quot-status-quot-quot-error-quot-quot-messages/m-p/1586983#M4949</guid>
      <dc:creator>ALGIS</dc:creator>
      <dc:date>2025-02-19T15:26:59Z</dc:date>
    </item>
  </channel>
</rss>

