Forum Discussion

Vani_metamicro's avatar
Vani_metamicro
Copper Contributor
Mar 03, 2020

post request is not working

Hello, 
I have created a Post URL using MS flow. I wanted to use the post URL in share point framework. I created a function as below. The response which i get back is Authentication {code"AuthorizationFailed"message"The authentication credentials are not valid}

Please may i know what am i doing incorrect? The Post URL works fine in postman.

 

 private _getListData(): Promise<any> {
   const postUrl = "https://prod-???????????????????????????????????/triggers/manual/paths/invoke?api-version=2016-06-01&sp=/triggers/manual/run&sv=1.0&sig=0RTMbBNtEVHqn5NBu-UiMMLWRLAQdV1FKJHGTqpTQsA";
    const spOptsISPHttpClientOptions = {
      body: `{ Title: 'Developer Workbench', BaseTemplate: 100 }`
    };
    this.context.spHttpClient.post(`${postUrl}/_api/web/lists`SPHttpClient.configurations.v1spOpts)
         .then((responseSPHttpClientResponse=> {
              // Access properties of the response object. 
        console.log(`Status code: ${response.status}`);
        console.log(`Status text: ${response.statusText}`);
        response.json().then((responseJSONJSON=> {
        });
      return;
}
No RepliesBe the first to reply

Resources