¿Con qué podemos ayudarte?

Por ejemplo Diagramas de Gantt, Crear tareas, Compartir carpetas

JSON syntax for GET/tasks with optional fields

3 comentarios

  • Spot On! 👍 Innovative Approach 💡 Stellar Advice 💪
    Avatar
    Ben Koplin

    Same issue here. Using the same field parameter specified in the API, my returned tasks include *none* of the fields listed. 

    Is this helpful? 0
    Acciones de comentarios Permalink
  • Spot On! 👍 Innovative Approach 💡 Stellar Advice 💪
    Avatar
    Laura Boylan

    (Editado )

    Doug Allinger

    In your example curl, you've included some generic example keys for metadata. Try replacing the URL portion of your curl with:

    https://www.wrike.com/api/v4/tasks?createdDate={"start":"2019-07-30T15:40:55Z"}&dueDate={"start":"2019-06-30"}&sortOrder=Desc&sortField=CreatedDate&scheduledDate={"start":"2019-06-30","end":"2019-08-31"}&updatedDate={"start":"2019-07-30T15:40:55Z","end":"2019-08-01T15:40:55Z"}&fields=["authorIds","briefDescription","dependencyIds","attachmentCount","description","customFields","metadata","responsibleIds","superParentIds","recurrent","hasAttachments","parentIds","sharedIds","superTaskIds","subTaskIds"]&descendants=true&startDate={"end":"2019-08-31T18:40:55"}&status=Active

    This is an exact copy of your example, with just the metadata parameter removed, so it assumes you are intentionally filtering the tasks returned by including all of these filter parameters.

    Is this helpful? 1
    Acciones de comentarios Permalink
  • Spot On! 👍 Innovative Approach 💡 Stellar Advice 💪
    Avatar
    Doug Allinger

    Thanks, Laura,

     

    Here is the JSON that I came up with to define these filters for the Scribe Online solution I am working with. To use the filter parameters in Scribe, I use the statement below, where the "Id" of the custom field is: "IEACPQK2JUAA7RR6" and the value I'm filtering for is "Ultra Complex". 



    "/tasks": {
    "get": {
    "produces": [ "application/json" ],
    "description": "Search among all tasks in all accounts.",
    "parameters": [
    {
    "name": "descendants",
    "in": "query",
    "description": "Adds all descendant folders to search scope",
    "required": false,
    "type": "boolean"
    },
    {
    "name": "title",
    "in": "query",
    "description": "Title filter, exact match",
    "required": false,
    "type": "string"
    },
    {
    "name": "status",
    "in": "query",
    "description": "Status filter, match with any of specified constants",
    "required": false,
    "type": "string",
    "enum": [ "Active", "Completed", "Deferred", "Cancelled" ]
    },
    {
    "name": "importance",
    "in": "query",
    "description": "Importance filter, exact match.",
    "required": false,
    "type": "string",
    "enum": [ "High", "Normal", "Low" ]
    },
    {
    "name": "startDate",
    "in": "query",
    "description": "\nStart date filter, date match or range (Timestamp semi-open interval) \\n\n- start (Optional): Range start \\n\n- equal (Optional): Date exact match value \\n\n- end (Optional): Range end \\n\n\"Format: yyyy-MM-dd'T'HH:mm:ss'Z' ('T'HH:mm:ss is optional)\"\n",
    "required": false,
    "type": "string"
    },
    {
    "name": "dueDate",
    "in": "query",
    "description": "\nDue date filter, date match or range (Timestamp semi-open interval) \\n\n- start (Optional): Range start \\n\n- equal (Optional): Date exact match value \\n\n- end (Optional): Range end \\n\n\"Format: yyyy-MM-dd'T'HH:mm:ss'Z' ('T'HH:mm:ss is optional)\"\n",
    "required": false,
    "type": "string"
    },
    {
    "name": "scheduledDate",
    "in": "query",
    "description": "\nScheduled date filter, date match or range (Timestamp semi-open interval) \\n\n- start (Optional): Range start \\n\n- equal (Optional): Date exact match value \\n\n- end (Optional): Range end \\n\n\"Format: yyyy-MM-dd'T'HH:mm:ss'Z' ('T'HH:mm:ss is optional)\"\n",
    "required": false,
    "type": "string"
    },
    {
    "name": "createdDate",
    "in": "query",
    "required": false,
    "type": "string",
    "x-example": "{\"start\":\"2019-10-07T12:04:48Z\",\"end\":\"2019-10-15T12:04:48Z\"}"
    },
    {
    "name": "updatedDate",
    "in": "query",
    "description": "\nUpdated date filter, date match or range (Timestamp semi-open interval) \\n\n- start (Optional): Range start \\n\n- equal (Optional): Date exact match value \\n\n- end (Optional): Range end \\n\n\"Format: yyyy-MM-dd'T'HH:mm:ss'Z' ('T'HH:mm:ss is optional)\"\n",
    "required": false,
    "type": "string"
    },
    {
    "name": "completedDate",
    "in": "query",
    "description": "\nCompleted date filter, date match or range (Timestamp semi-open interval) \\n\n- start (Optional): Range start \\n\n- equal (Optional): Date exact match value \\n\n- end (Optional): Range end \\n\n\"Format: yyyy-MM-dd'T'HH:mm:ss'Z' ('T'HH:mm:ss is optional)\"\n",
    "required": false,
    "type": "string"
    },
    {
    "name": "authors",
    "in": "query",
    "required": false,
    "type": "string",
    "x-example": "[\"KUAFVCAD\"]"
    },
    {
    "name": "responsibles",
    "in": "query",
    "description": "Responsibles filter, match of any",
    "required": false,
    "type": "array",
    "items": {
    "type": "string"
    },
    "collectionFormat": "csv"
    },
    {
    "name": "shareds",
    "in": "query",
    "description": "Shared users filter, match of any",
    "required": false,
    "type": "array",
    "items": {
    "type": "string"
    },
    "collectionFormat": "csv"
    },
    {
    "name": "permalink",
    "in": "query",
    "description": "Task permalink, exact match",
    "required": false,
    "type": "string"
    },
    {
    "name": "type",
    "in": "query",
    "description": "Task type.",
    "required": false,
    "type": "string",
    "enum": [ "Backlog", "Milestone", "Planned" ]
    },
    {
    "name": "limit",
    "in": "query",
    "description": "Limit on number of returned tasks",
    "required": false,
    "type": "integer"
    },
    {
    "name": "sortField",
    "in": "query",
    "description": "Sort field.",
    "required": false,
    "type": "string",
    "enum": [ "CreatedDate", "UpdatedDate", "CompletedDate", "DueDate", "Status", "Importance", "Title" ]
    },
    {
    "name": "sortOrder",
    "in": "query",
    "description": "Sort order.",
    "required": false,
    "type": "string",
    "default": "Asc",
    "enum": [ "Asc", "Desc" ]
    },
    {
    "name": "subTasks",
    "in": "query",
    "description": "Adds subtasks to search scope",
    "required": false,
    "type": "boolean"
    },
    {
    "name": "pageSize",
    "in": "query",
    "description": "Page size",
    "required": false,
    "type": "number",
    "format": "float"
    },
    {
    "name": "nextPageToken",
    "in": "query",
    "description": "Next page token, overrides any other parameters in request.",
    "required": false,
    "type": "string"
    },
    {
    "name": "metadata",
    "in": "query",
    "description": "Metadata filter, exact match for metadata key or key-value pair",
    "required": false,
    "type": "string"
    },
    {
    "name": "customField",
    "in": "query",
    "description": "Custom field filter (id/value). JSON object with 'id' and 'value' properties.",
    "required": false,
    "schema": {
    "$ref": "#/definitions/CustomFields"
    }
    },
    {
    "name": "customStatuses",
    "in": "query",
    "description": "Custom statuses filter. JSON array with a list of Custom status IDs.",
    "required": false,
    "type": "string"
    },
    {
    "name": "fields",
    "in": "query",
    "description": "[authorIds,hasAttachments,attachmentCount,parentIds,superParentIds,sharedIds,responsibleIds,description,briefDescription,recurrent,superTaskIds,subTaskIds,dependencyIds,customFields]",
    "required": false,
    "type": "array",
    "items": {
    "type": "string"
    }
    }
    ],
    "responses": {
    "200": {
    "description": "Definition generated from Swagger Inspector",
    "schema": {
    "$ref": "#/definitions/Task_Data"
    }
    }
    },
    "security": [
    {
    "Secured": []
    }
    ]
    },

    Is this helpful? 0
    Acciones de comentarios Permalink

Iniciar sesión para dejar un comentario.

Folllowing List for Post: JSON syntax for GET/tasks with optional fields
[this list is visible for admins and agents only]

Community

Welcome 🖖

Hi there! 🙂 Want to become a black belt Wrike Ninja? Here's how to earn a Wrike badge

Welcome 🖖 Have you checked out this week's Release Notes yet?

Hey! 👋 Curious about something? Visit How To to search and ask the Community for answers.

Welcome! 👋 Figured out a good tip or trick? Share it in Best Practices.

Want to connect your existing software to Wrike? Learn and ask how in the API section.