Getting Result under HTTP Request Section

Certified Associate Developer

Hello All,

I'm working on a project where we are trying to collaborate with box.com for uploading files. I did lot of research and finally able to create an application which returns authorization code for communicating with box. I created a connected system and called that inside integration, When I click Test Request i'm getting my authorization code under HTTP Request section. I checked and found that the authorization code i'm getting there is the correct one but as its displayed under Http Request I'm unable to fetch its value directly from integration as no such function exists I guess. I also checked Result and Http Response section but unfortunately the Authorization code is unavailable there. Can someone please tell me any different way to execute the connected system so that i can get my result or any logic which will help me to get the required value from http request in existing code?

  Discussion posts and replies are publicly visible

Parents
  • 0
    Certified Lead Developer
    I assume this an OAuth2 connected system? If so, for Authorization grants, I would expect you can just create your Integration by configuring it to use the connected system you created as demonstrated here: docs.appian.com/.../Create_an_Integration.html. I expect Appian to seamlessly manage passing the Authorization header through to your integration. Is there something else you need to do with this authorization code?

    For other OAuth grant types, you'll generally have to make one *Integration* (not connected system) to call the token generation endpoint directly, parse the result, and pass into a second integration that would perform your use case in the external system (i.e. upload files).
  • 0
    Certified Associate Developer
    in reply to Justin Watts
    Hey Justin,

    I created the token with the second method now where there is no requirement for the connected system. I'm able to fetch the access_token but while using that inside the File Upload smart service, Files are not uploading even though there is no security applied on the folder. Also If I will copy the Authorization code from the first method and use it inside file upload smart service, It executes fine and file is successfully getting uploaded. That is why I was more concerned to use first method but don't know what to do next as the approach where access token is working fine, We have no ways to capture the authorization code to any variable and on another approach where access token is getting stored in the variable is not at all working
  • 0
    Certified Lead Developer
    in reply to viveku3486
    Does box not return a status code or any logging? I would think if the code isn't read properly, you'd get some kind of information confirming that. When you say that you are using the Auth code in the service, can you clarify what you mean? Adding a specific Authorization header? You should be able to start the HTTP Response as an output of the smart service, so maybe there is something in that response that might provide some guidance.

    Regardless, to answer your question directly, I'm not aware of any way to get information from a connected system outside of calling an integration.
  • 0
    Certified Associate Developer
    in reply to Justin Watts
    Hello Justin,

    While I'm using the second approach where we are directly calling the integration with token endpoint. I'm getting statuscode=200 including access_token under HttpResponse. I'm using that access_code to upload the file but its not doing so. Below is the HttpResponse I'm getting

    [statusLine=HTTP/1.1 200 OK, statusCode=200, headers=[object Object], contentType=application/json, body={"access_token":"","expires_in":3997,"restricted_to":[],"token_type":"bearer"}]

    I removed access_token text for security purpose.

    Now to answer your other questions. When I say auth code I mean the developer token which I'm getting after calling the connected system inside integration. This auth code works fine while I upload the file using this code as token under File Upload smart service. If I describe it in details then what I'm doing is as below

    1) I created a connected system with Authentication as "OAuth 2.0"
    2) Such that my authorization endpoint is "account.box.com/.../authorize" and Token Request Endpoint ="api.box.com/.../token" including client ID and Client secret
    3) Now I used this connected system inside integration with URL= "The authorization url"

    When I click on Test Request I get statuscode as 200 under result tab and Authorization Code under Http Request tab. This is the same authorization I was talking about in my previous reply. If I use this code as accessToken the file upload gets successful but the issue in this approach is related to getting the value from HttpRequest tab as no such method exists so far. I hope this helps to understand my current workflow
Reply
  • 0
    Certified Associate Developer
    in reply to Justin Watts
    Hello Justin,

    While I'm using the second approach where we are directly calling the integration with token endpoint. I'm getting statuscode=200 including access_token under HttpResponse. I'm using that access_code to upload the file but its not doing so. Below is the HttpResponse I'm getting

    [statusLine=HTTP/1.1 200 OK, statusCode=200, headers=[object Object], contentType=application/json, body={"access_token":"","expires_in":3997,"restricted_to":[],"token_type":"bearer"}]

    I removed access_token text for security purpose.

    Now to answer your other questions. When I say auth code I mean the developer token which I'm getting after calling the connected system inside integration. This auth code works fine while I upload the file using this code as token under File Upload smart service. If I describe it in details then what I'm doing is as below

    1) I created a connected system with Authentication as "OAuth 2.0"
    2) Such that my authorization endpoint is "account.box.com/.../authorize" and Token Request Endpoint ="api.box.com/.../token" including client ID and Client secret
    3) Now I used this connected system inside integration with URL= "The authorization url"

    When I click on Test Request I get statuscode as 200 under result tab and Authorization Code under Http Request tab. This is the same authorization I was talking about in my previous reply. If I use this code as accessToken the file upload gets successful but the issue in this approach is related to getting the value from HttpRequest tab as no such method exists so far. I hope this helps to understand my current workflow
Children
No Data