Creating new tasks with the Wrike API and


I'm having trouble creating new Wrike tasks using and the Wrike API. I however, am able to connect to Wrike to GET a list of folders so I know I'm able to successfully authenticate.



Dim accessToken As String = API_Token
Dim apiVersion As String = "v4"
Dim ApiBaseUrl As String = ""
Dim folderID As String = "Some Folder ID"
Dim address As String = ApiBaseUrl & "/api/" & apiVersion & "/folders/" & folderID & "/tasks"
Dim result As String
Dim task_str_ As String = "description=Test task description&title=Task Created With VS"
Dim request As HttpWebRequest = WebRequest.Create(address)
request.Headers.Add("Authorization", "Bearer " & accessToken)
request.Method = "POST"
request.ContentType = "application/json"
Using requestWriter2 As New StreamWriter(request.GetRequestStream())
End Using
Dim webResp As WebResponse = request.GetResponse()
Using reader = New StreamReader(webResp.GetResponseStream)
result = reader.ReadToEnd()
End Using
TextBox1.Text = (result)
Catch __unusedException1__ As Exception
TextBox1.Text = task_str_ & vbCrLf & vbCrLf & (__unusedException1__.ToString)
End Try


Here is the error I'm receiving:

System.Net.WebException: The remote server returned an error: (400) Bad Request

1 комментарий
Spot On Innovative Approach Stellar Advice

Hi Nicholas, welcome to the Community, happy to see you here 🙂

Please let me know if you'd like me to raise a Support ticket for you, I'll be happy to assist 🙌

Lisa Community Team at Wrike Wrike Product Manager Become a Wrike expert with Wrike Discover

Lisa Wrike Team member Become a Wrike expert with Wrike Discover

Действия с комментариями Постоянная ссылка

Folllowing List for Post: Creating new tasks with the Wrike API and
[this list is visible for admins and agents only]

Didn’t find what you were looking for? Write new post