<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0"><channel><title><![CDATA[&#x2F;api&#x2F;user&#x2F;code endpoint with private servers?]]></title><description><![CDATA[<p>I have been trying to configure my private server to be able to use the /api/user/code endpoint to update my scripts.</p>
<p>I have installed the screepsmod-auth mod and its working correctly (as i can reach the /authmod/password/ endpoint and i was also able to set a password with the cli by using setPassword('username', 'password'))</p>
<p>But when i try to actually use any of the api endpoints, they all return {&quot;error&quot;:&quot;unauthorized&quot;}. I have tried using query params in the browser (eg /api/user/code?user=username&amp;pass=password) and i've tried using curl with -u username:password.</p>
<p>I know much of the web api is undocumented, and some of it reads like you need to use an api token and not a username and password, but there doesn't seem to be a way to get an api token when you are logged into a private server?</p>
<p>How are others utilizing the web apis with their private servers? Am i missing a major piece of configuration somewhere?</p>
]]></description><link>http://screeps.com/forum/topic/3313/api-user-code-endpoint-with-private-servers</link><generator>RSS for Node</generator><lastBuildDate>Mon, 16 Mar 2026 11:46:32 GMT</lastBuildDate><atom:link href="http://screeps.com/forum/topic/3313.rss" rel="self" type="application/rss+xml"/><pubDate>Thu, 23 May 2024 12:08:48 GMT</pubDate><ttl>60</ttl><item><title><![CDATA[Reply to &#x2F;api&#x2F;user&#x2F;code endpoint with private servers? on Invalid Date]]></title><description><![CDATA[<p>I have been trying to configure my private server to be able to use the /api/user/code endpoint to update my scripts.</p>
<p>I have installed the screepsmod-auth mod and its working correctly (as i can reach the /authmod/password/ endpoint and i was also able to set a password with the cli by using setPassword('username', 'password'))</p>
<p>But when i try to actually use any of the api endpoints, they all return {&quot;error&quot;:&quot;unauthorized&quot;}. I have tried using query params in the browser (eg /api/user/code?user=username&amp;pass=password) and i've tried using curl with -u username:password.</p>
<p>I know much of the web api is undocumented, and some of it reads like you need to use an api token and not a username and password, but there doesn't seem to be a way to get an api token when you are logged into a private server?</p>
<p>How are others utilizing the web apis with their private servers? Am i missing a major piece of configuration somewhere?</p>
]]></description><link>http://screeps.com/forum/post/16806</link><guid isPermaLink="true">http://screeps.com/forum/post/16806</guid><dc:creator><![CDATA[YoItsRexxy]]></dc:creator><pubDate>Invalid Date</pubDate></item><item><title><![CDATA[Reply to &#x2F;api&#x2F;user&#x2F;code endpoint with private servers? on Invalid Date]]></title><description><![CDATA[<p>Does anybody have any insights to this problem? I highly doubt im the first one to try and use the api for a private server?</p>
]]></description><link>http://screeps.com/forum/post/16808</link><guid isPermaLink="true">http://screeps.com/forum/post/16808</guid><dc:creator><![CDATA[YoItsRexxy]]></dc:creator><pubDate>Invalid Date</pubDate></item><item><title><![CDATA[Reply to &#x2F;api&#x2F;user&#x2F;code endpoint with private servers? on Tue, 16 Jul 2024 04:03:14 GMT]]></title><description><![CDATA[<p>Step 1: Sign in. You will get a TOEKN in response if email and password are correct.</p>
<pre><code>requests.post(
    &quot;http://{}/api/auth/signin&quot;.format(SERVER_URL),
    json={
        &quot;email&quot;: USERNAME,
        &quot;password&quot;: PASSWORD,
    }
)
</code></pre>
<p>Step 2: Put the TOKEN in the API request headers.</p>
<pre><code>requests.post(
    &quot;{}/api/user/code&quot;.format(SERVER_URL),
    headers = {
        &quot;X-Token&quot;: TOKEN,
        &quot;X-Username&quot;: TOKEN,
    },
    json={
        &quot;modules&quot;: CODE_TEXT,
        &quot;branch&quot;: BRANCH_NAME,
    },
)
</code></pre>
<p>Here is a list about all API I could found (written in Python). Most of them are tested.
<a href="https://github.com/Qionglu735/screeps_tool/blob/master/screeps_api.py#L185" rel="nofollow">https://github.com/Qionglu735/screeps_tool/blob/master/screeps_api.py#L185</a></p>
]]></description><link>http://screeps.com/forum/post/16819</link><guid isPermaLink="true">http://screeps.com/forum/post/16819</guid><dc:creator><![CDATA[Qionglu735]]></dc:creator><pubDate>Tue, 16 Jul 2024 04:03:14 GMT</pubDate></item></channel></rss>