none
How do you add a task to an existing project via httpntlmauth and requests in python? RRS feed

  • Question

  • I am using this url: http://projectserver/_api/ProjectServer/Projects('"+uuid+"')/Tasks/Draft/Add

    This is the post(etag and form digest are found from querying and posting to the projectserver context info)

    r = requests.post(
    resturlTask,
    verify=False,
    auth=auth,
    data=json.dumps({
    "Name":  "TestwithApi",
    }),
    headers={
    'X-RequestDigest': form_digest,
    'content-type': "application/json;odata=verbose",
    'Accept': "application/json",
    "X-HTTP-Method": "CREATE",
    "IF-MATCH": etag,
    },
    )

    I get this response: 

    <Response [400]>
    {"odata.error":{"code":"-1, Microsoft.SharePoint.Client.InvalidClientQueryException","message":{"lang":"en-US","value":"The parameter Name does not exist in method Add."}}}

    Any help would be appreciated.

    Thanks

    Thursday, October 11, 2018 12:16 PM

Answers