How can we help you today? How can we help you today?

REST API error for BulkClassification

Hello,

A few environment specifics to get this started: We're on SQL 2019 on all servers, Data Catalog is on 2.0.15.25662, I am using VS 2017 for SSIS package work, and I use the ZappySys SSIS tools to make REST API calls from within SSIS.

I am working to automate the classification of a particular system. I do understand that PowerShell is an option here, but it's my understanding this should all be doable through REST API calls and so I'd like to do that from SSIS if possible .To keep it simple, I am testing the process on a database that automatically generates new tables for auditing operations. I only need to apply two specific tags to any of the columns in newly created tables, so there is no need to check data type or anything like that. 

I've set up an authorization token. I have been able to successfully send GET requests to retrieve the columnIDs I need to work with (/api/v1.0/columns?). The issue I am having is when I send a PATCH request for BulkClassification there is a 400 error returned. And these appears to be the offending lines:
  • 2023-02-16 09:54:01.746 -06:00 [INFO] Antiforgery token validation failed. The required antiforgery cookie ".AspNetCore.Antiforgery.xmlG6Io3-iw" is not present. Microsoft.AspNetCore.Antiforgery.AntiforgeryValidationException: The required antiforgery cookie ".AspNetCore.Antiforgery.xmlG6Io3-iw" is not present. at Microsoft.AspNetCore.Antiforgery.DefaultAntiforgery.ValidateRequestAsync(HttpContext httpContext) at Microsoft.AspNetCore.Mvc.ViewFeatures.Filters.ValidateAntiforgeryTokenAuthorizationFilter.OnAuthorizationAsync(AuthorizationFilterContext context)
  • 2023-02-16 09:54:01.747 -06:00 [INFO] Authorization failed for the request at filter 'Microsoft.AspNetCore.Mvc.ViewFeatures.Filters.AutoValidateAntiforgeryTokenAuthorizationFilter'.
The same authorization token used in the PATCH for BulkClassification is used for the GET on columns. When comparing the cURL requests displayed by the API section of the site I am not seeing any specific headers I am missing. And the JSON body I am sending through the REST API works perfectly fine if I paste it in to the API section of the site, so it seems the JSON body is valid. For the PATCH request on BulkClassification I am sending these headers:
  1. accept -- with a value of */*
  2. X-XSRF-TOKEN -- with a value that matches the exact token generated in the site
  3. Content-Type -- with a value of application/json
Any thoughts or assistance is appreciated.
pharrell
0

Comments

3 comments

  • Eddie D
    Hi, thank you for your forum post.

    A support ticket has been created for you and I will contact you via the support ticket created, as I need to request log files that you most likely do not want to post on this public forum.

    Many Thanks
    Eddie
    Eddie D
    0
  • saul01

    Hello,

    Encountering a 400 error during your PATCH request for BulkClassification suggests an issue with the request's syntax or data. Ensure the Content-Type is set to application/json and the JSON payload is correctly structured. For example, when sending a JSON body, it should be properly formatted to match the expected schema. Additionally, verify that all required headers, such as authorization tokens, are correctly included. If the issue persists, consider consulting the API documentation or reaching out to the support community for further assistance.

    saul01
    0
  • ubaid11221

    Encountering a REST API error for BulkClassification often indicates data inconsistencies, rate limits, or authentication failures. Verifying request payload, headers, and API configurations can help troubleshoot and ensure smooth bulk processing without disrupting classification workflows.

    ubaid11221
    0

Add comment

Please sign in to leave a comment.