So I was wanting to automatically upload a file, to one of my projects, via the CurseForge API. I ran into an issue where it gave me the error code of:
{'errorCode': 1002, 'errorMessage': 'Error in field `metadata`:\nInvalid JSON.'}
I did not run into issues with this. The only reason why I could see this happening is that you are sending the api request to www.cursforge.com instead of gamename.curseforge.com.
Actually, my script works for around one month(I encountered the cloudflare challenge from the beginning), and it failed to upload addon file couple days ago. I have no idea how to fix it, so I have to upload my addon manually.
I use the correct game url and cloudflare is always there to block me >"<
So I was wanting to automatically upload a file, to one of my projects, via the CurseForge API. I ran into an issue where it gave me the error code of:
Here is the metadata:
Request:
I am using python with the request library. Does anyone know why this would happen?
Wait I needed to make the changelog type just a string and dump the metadata as a string.
How did you pass the cloudflare checking?
In reply to 阿斯蘭:
I did not run into issues with this. The only reason why I could see this happening is that you are sending the api request to www.cursforge.com instead of gamename.curseforge.com.
Actually, my script works for around one month(I encountered the cloudflare challenge from the beginning), and it failed to upload addon file couple days ago. I have no idea how to fix it, so I have to upload my addon manually.
I use the correct game url and cloudflare is always there to block me >"<
getversion_url = "https://wow.curseforge.com/api/game/versions?token=%s" % token
upload_url = "https://wow.curseforge.com/api/projects/%s/upload-file" % project_id
You might need to create a curseforge support ticket for this.