Automic Workload Automation

 View Only
  • 1.  API REST : how to force the media/type (AWI 12.3)

    Posted Jan 27, 2022 04:59 AM
    Hello,

    I need to use an API in order to load some data on a "remote URL".
    I have to use CSV data, it is what it is allowed  by the remote (no choice with this "type")

    But in AWI 12.3 I have not this choice (I have several choices but not CSV)


    the log :
     An error occured - after the request
    2022-01-27 10:44:06             Response error code: 409 (Response family:CLIENT_ERROR), Exception: [{"errorCode":"BULK_API_ERROR","message":"Wrong content-type for batch (text/xml), job is of type: text/csv"}]:Conflict

    i have to use the "text/csv" type and I can not.
    Also I have tried to put it in Headers, but no way.

    Can you help please ?

    Marc Broussard
    INEO Equans


  • 2.  RE: API REST : how to force the media/type (AWI 12.3)

    Posted Jan 28, 2022 02:37 AM
    Hi @marc broussard

    i think the solution for you is to use the *:put_att* function.

    Do you have a curl example for the upload?

    Regards,
    Remo


  • 3.  RE: API REST : how to force the media/type (AWI 12.3)

    Posted Jan 31, 2022 09:21 AM
    thanks
    I managed with (in the pre process):

    :put_att mediaType = "text/csv"

    but i do not do any curl upload

    :
    Walkthrough for Bulk Upsert | Bulk API 2.0 and Bulk API Developer Guide | Salesforce Developers


    I managed to do the first 4 points , but not the 5 (Close the job)
    because I have not "PATCH" method (only GET, POST, PUT, delete, head, option)

    do you know how to force the method?




  • 4.  RE: API REST : how to force the media/type (AWI 12.3)

    Posted Jan 31, 2022 09:27 AM
    I have tried with
    :PUT_ATT method = "PATCH"     (in the pre process)

    and the error message  is :



    2022-01-31 14:11:31             Request:PATCH https://xxxxxxxxxxxxxxxxx/v51.0/jobs/ingest/7500E00000AH0y5QAD/
    2022-01-31 14:11:31             Request headers:[[Accept-Language, fr-FR,fr;q=0.9,en-US;q=0.8,en;q=0.7], [Authorization, Bearer xxxxxxxxxxxxxxxxxxxxxxxxxxxx], [Content-Type, application/json; charset=UTF-8], [accept, application/json]]
    2022-01-31 14:11:31             Sending request...
    2022-01-31 14:11:31             Response:
    2022-01-31 14:11:31             Status:400 Bad Request
    2022-01-31 14:11:31             Response headers:[Date:[Mon, 31 Jan 2022 13:11:31 GMT], Set-Cookie:[CookieConsentPolicy=0:1; domain=planet-crm--uat.my.salesforce.com; path=/; expires=Tue, 31-Jan-2023 13:11:31 GMT; Max-Age=31536000, LSKey-c$CookieConsentPolicy=0:1; domain=planet-crm--uat.my.salesforce.com; path=/; expires=Tue, 31-Jan-2023 13:11:31 GMT; Max-Age=31536000, BrowserId=TqBmJoKXEeyRMY-w_02FQA; domain=.salesforce.com; path=/; expires=Tue, 31-Jan-2023 13:11:31 GMT; Max-Age=31536000], Strict-Transport-Security:[max-age=31536000; includeSubDomains], X-Content-Type-Options:[nosniff], X-XSS-Protection:[1; mode=block], X-Robots-Tag:[none], Cache-Control:[no-cache,must-revalidate,max-age=0,no-store,private], Sforce-Limit-Info:[api-usage=4717/16655000], Content-Type:[application/json;charset=UTF-8], Transfer-Encoding:[chunked]]
    2022-01-31 14:11:31             
    2022-01-31 14:11:31             
    2022-01-31 14:11:31             An error occured - after the request
    2022-01-31 14:11:31             Response error code: 400 (Response family:CLIENT_ERROR), Exception: [{"errorCode":"API_ERROR","message":"The HTTP entity body is required, but this request has no entity body."}]:Bad Request