Error utilizando una WebAPI para hacer delete de records

Certified Associate Developer

Buenas, tengo un problema y es que probando la webapi desde Appian directamente si me borra el registro que le paso por parámetro con id, pero estoy haciendo pruebas desde Postman para ver que funcionan las webapis de manera externa y cuando lanzo la de Delete me devuelve un 404 - Not Found y no hace nada, tengo otras webapis de tipo get y post que desde Postman me funcionan perfectamente con mis credenciales, no se si el problema estará en algún aspecto de la seguridad de la webapi de delete.

Muchas gracias de antemano

  Discussion posts and replies are publicly visible

Parents
  • 0
    Certified Lead Developer

    We would need a few more details about that API. Does that API check whether a valid value is passed and return a 404 if not?

  • 0
    Certified Associate Developer
    in reply to Stefan Helzle

    This is the code of the API:

    a!localVariables(
    local!value: a!queryRecordType(
    recordType: 'recordType!{5c6be7a8-ccde-4a6c-81fe-1a328e67f94e}PA QueryRequest',
    pagingInfo: a!pagingInfo(startIndex: 1, batchSize: 50),
    filters: a!queryFilter(
    field: 'recordType!{5c6be7a8-ccde-4a6c-81fe-1a328e67f94e}PA QueryRequest.fields.{28bcd982-b3cc-434d-b7d6-1852f2472506}id',
    operator: "=",
    value: tointeger(http!request.queryParameters.id),
    applywhen: not(
    isnull(
    tointeger(http!request.queryParameters.id)
    )
    )
    )
    ).data,
    a!deleteRecords(
    records: local!value,
    /*
    * Construct an HTTP response to return to the caller
    */
    onSuccess: a!httpResponse(
    statusCode: 200,
    /*
    * Set an HTTP header that tells the client that the body of the response will be in JSON format
    */
    headers: {
    a!httpHeader(
    name: "Content-Type",
    value: "application/json"
    )
    },
    ),
    onError: a!httpResponse(
    statusCode: 500,
    headers: {
    a!httpHeader(
    name: "Content-Type",
    value: "application/json"
    )
    },
    body: a!toJson(
    a!map(
    message: "Delete request has failed",
    error: fv!error
    )
    )
    )
    )
    )

    The API only asks for the id of the record to delete

  • 0
    Certified Lead Developer
    in reply to adolfo.rodriguez

    Interesting implementation. What would happen when I do not pass an ID?

    So the API does not return a 404. For me this looks like a problem in the postman setup.

Reply Children