Skip to content

Instantly share code, notes, and snippets.

@Geri-Borbas
Created November 16, 2018 20:59
Show Gist options
  • Save Geri-Borbas/477c01c06f66282f27a45159c1105243 to your computer and use it in GitHub Desktop.
Save Geri-Borbas/477c01c06f66282f27a45159c1105243 to your computer and use it in GitHub Desktop.
Upload CloudCode scripts to GameSparks using REST API via command line.
#!/bin/sh
# Zip CloudCode folders
zip -r scripts.zip event modules response
# Send to GameSparks
curl \
--verbose \
--header 'Content-Type: multipart/form-data' \
--header 'Accept: application/json' \
--header 'Authorization: Basic <BASE64_USERNAME:PASSWORD>' \
--form '[email protected]' \
--form 'body={ "selectedFiles" : [ "*" ] }' \
'https://config2.gamesparks.net/restv2/game/<API_KEY>/admin/scripts/import/accept'
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment