Customer Portal

need help using clover with REST api

Comments 4

  • Avatar
    admin
    0
    Comment actions Permalink
    Hi noob27,

    can you send me content of log window and graph file? (You can send it as private message).

    Otherwise: if you see "Authorization=user {account}:{api_password}" in properties of component - don't worry. It is just visualization. Colon instead of equal sign is send (checked by me on 3.2.1 version).

    Also try to get working HttpClient on some non-problematic page (http://google.com), or see our example graphs. It would also make a sense to log requests on server side (if possible) so you will see exact content of request.

    I hope this helps.
  • Avatar
    twhitney
    0
    Comment actions Permalink
    I am having similar issues with using a REST API.

    Essentially, I'm unsure of how to reference a variable within "Additional HTTP header properties". If I set up a parameter or pass the required information through Metadata, how do I reference it? I've tried the following and none of them seem to work...

    Authorization= OAuth $in.0.token
    Authorization= OAuth $0.token
    Authorization= OAuth {token}
    Authorization= OAuth $token

    I got past the first step of getting the auth token by hard-coding my user/pass into the http header but now I can't use the token I've received in subsequent API requests.

    Any help would be greatly appreciated.
  • Avatar
    admin
    0
    Comment actions Permalink
    You can create graph parameters like:

    user=jarek
    password=megasecret

    And then create header property "Authorization" with value "user ${user}:${password}".

    On server, header
    AUTHORIZATION: user jarek:megasecret
    is received.

    Unfortunately this approach can be dynamic just in case:
    * RunGraph is used (there you can specify graph parameter value on command line delivered by input port)
    * Or graph itself can be externally parametrized.

    Currently there is no way you can change parameters on-the-fly by graph itself.
  • Avatar
    twhitney
    0
    Comment actions Permalink
    Thank you Jarek.

    It is, indeed, unfortunate that we can't use internal variables within the HTTP headers. I will have to find another way around this limitation.

    Thank you for answering the question and providing a possible work-around. I appreciate it.

Please sign in to leave a comment.