Search code examples
http-headerspeoplesoft

How do I add an HTTP Authorization header to a REST call in PeopleSoft?


I need to consume a REST endpoint that is protected by OAuth. To do this I need to be able to add an Authorization : Bearer xxxxx header to my call. Is it possible to do this without using the PeopleSoft Integration Hub?

edit: changed Integration Broker to Integration Hub.


Solution

  • You can add custom headers via PeopleCode.

    &MSG = CreateMessage(OPERATION.SOME_REST_OPERATION)
    &result = &MSG.IBInfo.IBConnectorInfo.AddConnectorProperties("Authorization", "Bearer xxxxx", %Header); 
    /* TODO: Populate message with values */
    %IntBroker.SyncRequest(&MSG);
    

    Related PeopleBooks Documentation