Score:0

ConfigMgr WebService API Calls

ae flag

at the moment I try to connect my application via api with the ConfigMgr Webservice, but send my SOAP API request via curl I always get a 400 error.

We are writting our own application to "talk" with the SCCM and because we cannot use PowerShell (cause of company restrictions) we are trying to use the ConfigMgr Webservice. Is anyone here, that have some experience with this little API and can point me in the right direction for speaking with it?

At the moment I try to get this endpoint GetCWVersion.

If you need further infos, just ask!

Score:0
ae flag

I solved this by using python instead of testing around in curl. With the requests library it is quite simple.

"""Just an example for a soap request"""
import requests

host = "host"
secret = "secret"
filter = "filter"

url = "https://" + host + "/ConfigMgrWebService/ConfigMgr.asmx"
payload ="""<?xml version="1.0" encoding="utf-8"?>
            <soap12:Envelope xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:soap12="http://www.w3.org/2003/05/soap-envelope">
                <soap12:Body>
                    <GetCMDeviceCollections xmlns="http://www.scconfigmgr.com">
                    <secret>{secret}</secret>
                    <filter>{filter}</filter>
                    </GetCMDeviceCollections>
                </soap12:Body>
            </soap12:Envelope>""".format(secret=secret, filter=filter)
headers = {
     'Content-Type': 'application/soap+xml; charset=utf-8'
}
    
response = requests.request("POST", url, headers=headers, data=payload, verify = False)
print(response.text)
I sit in a Tesla and translated this thread with Ai:

mangohost

Post an answer

Most people don’t grasp that asking a lot of questions unlocks learning and improves interpersonal bonding. In Alison’s studies, for example, though people could accurately recall how many questions had been asked in their conversations, they didn’t intuit the link between questions and liking. Across four studies, in which participants were engaged in conversations themselves or read transcripts of others’ conversations, people tended not to realize that question asking would influence—or had influenced—the level of amity between the conversationalists.