Skip to main content
Removed credential details
Source Link
Jayant Das
  • 30.7k
  • 3
  • 42
  • 68

I have issue with posting an API header to Bright Pattern out of Developer Console using a workspace. below is the Code and when I send it I get an error:

Execute Anonymous Error on line 6 column:19 Unexpected token '('

It looks like there is an Problem with the opening bracket after the request.setHeader. However, it looks okay to me.

Http http = new Http();
HttpRequest request = new HttpRequest();
request.setEndpoint('https://sprout.brightpattern.com/clientweb/api/v1/chats?tenantUrl=sprout.brightpattern.com&timestamp=1538601898');
request.setMethod('POST');
// Set Header for the Authorization 
request.setHeader('Content-Type', 'application/json;charset=UTF-8';
  'Authorization: MOBILE-API-140-327-PLAIN'+ appId=9aeb0234a9cc4723a0ef353d65ae0b77appId=9aeb0234a + clientId=WebChat);
// Set the body as a JSON object
request.setBody('{"LeadId":"00QM000000FL93tMAD"}');
// Parse the JSON response
HttpResponse response = http.send(request);
if (response.getStatusCode() != 201) {
    System.debug('The status code returned was not expected: ' +
        response.getStatusCode() + ' ' + response.getStatus());
} else {
    System.debug(response.getBody());
}

I have issue with posting an API header to Bright Pattern out of Developer Console using a workspace. below is the Code and when I send it I get an error:

Execute Anonymous Error on line 6 column:19 Unexpected token '('

It looks like there is an Problem with the opening bracket after the request.setHeader. However, it looks okay to me.

Http http = new Http();
HttpRequest request = new HttpRequest();
request.setEndpoint('https://sprout.brightpattern.com/clientweb/api/v1/chats?tenantUrl=sprout.brightpattern.com&timestamp=1538601898');
request.setMethod('POST');
// Set Header for the Authorization 
request.setHeader('Content-Type', 'application/json;charset=UTF-8';
  'Authorization: MOBILE-API-140-327-PLAIN'+ appId=9aeb0234a9cc4723a0ef353d65ae0b77 + clientId=WebChat);
// Set the body as a JSON object
request.setBody('{"LeadId":"00QM000000FL93tMAD"}');
// Parse the JSON response
HttpResponse response = http.send(request);
if (response.getStatusCode() != 201) {
    System.debug('The status code returned was not expected: ' +
        response.getStatusCode() + ' ' + response.getStatus());
} else {
    System.debug(response.getBody());
}

I have issue with posting an API header to Bright Pattern out of Developer Console using a workspace. below is the Code and when I send it I get an error:

Execute Anonymous Error on line 6 column:19 Unexpected token '('

It looks like there is an Problem with the opening bracket after the request.setHeader. However, it looks okay to me.

Http http = new Http();
HttpRequest request = new HttpRequest();
request.setEndpoint('https://sprout.brightpattern.com/clientweb/api/v1/chats?tenantUrl=sprout.brightpattern.com&timestamp=1538601898');
request.setMethod('POST');
// Set Header for the Authorization 
request.setHeader('Content-Type', 'application/json;charset=UTF-8';
  'Authorization: MOBILE-API-140-327-PLAIN'+ appId=9aeb0234a + clientId=WebChat);
// Set the body as a JSON object
request.setBody('{"LeadId":"00QM000000FL93tMAD"}');
// Parse the JSON response
HttpResponse response = http.send(request);
if (response.getStatusCode() != 201) {
    System.debug('The status code returned was not expected: ' +
        response.getStatusCode() + ' ' + response.getStatus());
} else {
    System.debug(response.getBody());
}
added 16 characters in body; edited tags
Source Link
Adrian Larson
  • 151.3k
  • 38
  • 247
  • 431

I have issue with posting an API header to Bright Pattern out of Developer Console using a workspace. below is the Code and when I send it I get an "Execute Anonymous Error on line 6 columnerror:19 Unexpected token '('".

Execute Anonymous Error on line 6 column:19 Unexpected token '('

It looks like there is an Problem with the opening bracket after the It looks like there is an Problem with the opening bracket after the request.setHeader. However this looks ok.request.setHeader. However, it looks okay to me.

Http http = new Http();
HttpRequest request = new HttpRequest();
request.setEndpoint('https://sprout.brightpattern.com/clientweb/api/v1/chats?tenantUrl=sprout.brightpattern.com&timestamp=1538601898');
request.setMethod('POST');
// Set Header for the Authorization 
request.setHeader('Content-Type', 'application/json;charset=UTF-8';
  'Authorization: MOBILE-API-140-327-PLAIN'+ appId=9aeb0234a9cc4723a0ef353d65ae0b77 + clientId=WebChat);
// Set the body as a JSON object
request.setBody('{"LeadId":"00QM000000FL93tMAD"}');
// Parse the JSON response
HttpResponse response = http.send(request);
if (response.getStatusCode() != 201) {
    System.debug('The status code returned was not expected: ' +
        response.getStatusCode() + ' ' + response.getStatus());
} else {
    System.debug(response.getBody());
}

I have issue with posting an API header to Bright Pattern out of Developer Console using a workspace. below is the Code and when I send it I get an "Execute Anonymous Error on line 6 column:19 Unexpected token '('". It looks like there is an Problem with the opening bracket after the request.setHeader. However this looks ok.

Http http = new Http();
HttpRequest request = new HttpRequest();
request.setEndpoint('https://sprout.brightpattern.com/clientweb/api/v1/chats?tenantUrl=sprout.brightpattern.com&timestamp=1538601898');
request.setMethod('POST');
// Set Header for the Authorization 
request.setHeader('Content-Type', 'application/json;charset=UTF-8';
  'Authorization: MOBILE-API-140-327-PLAIN'+ appId=9aeb0234a9cc4723a0ef353d65ae0b77 + clientId=WebChat);
// Set the body as a JSON object
request.setBody('{"LeadId":"00QM000000FL93tMAD"}');
// Parse the JSON response
HttpResponse response = http.send(request);
if (response.getStatusCode() != 201) {
    System.debug('The status code returned was not expected: ' +
        response.getStatusCode() + ' ' + response.getStatus());
} else {
    System.debug(response.getBody());
}

I have issue with posting an API header to Bright Pattern out of Developer Console using a workspace. below is the Code and when I send it I get an error:

Execute Anonymous Error on line 6 column:19 Unexpected token '('

It looks like there is an Problem with the opening bracket after the request.setHeader. However, it looks okay to me.

Http http = new Http();
HttpRequest request = new HttpRequest();
request.setEndpoint('https://sprout.brightpattern.com/clientweb/api/v1/chats?tenantUrl=sprout.brightpattern.com&timestamp=1538601898');
request.setMethod('POST');
// Set Header for the Authorization 
request.setHeader('Content-Type', 'application/json;charset=UTF-8';
  'Authorization: MOBILE-API-140-327-PLAIN'+ appId=9aeb0234a9cc4723a0ef353d65ae0b77 + clientId=WebChat);
// Set the body as a JSON object
request.setBody('{"LeadId":"00QM000000FL93tMAD"}');
// Parse the JSON response
HttpResponse response = http.send(request);
if (response.getStatusCode() != 201) {
    System.debug('The status code returned was not expected: ' +
        response.getStatusCode() + ' ' + response.getStatus());
} else {
    System.debug(response.getBody());
}
added 70 characters in body
Source Link
sfdcfox
  • 501.6k
  • 21
  • 473
  • 828

I have issue with posting an API header to Bright Pattern out of Developer Console using a workspace. below is the Code and when I send it I get an "Execute Anonymous Error on line 6 column:19 Unexpected token '('". It looks like there is an Problem with the opening bracket after the request.setHeader. However this looks ok.

Http http = new Http(); HttpRequest request = new HttpRequest(); request.setEndpoint('https://sprout.brightpattern.com/clientweb/api/v1/chats?tenantUrl=sprout.brightpattern.com&timestamp=1538601898'); request.setMethod('POST'); // Set Header for the Authorization request.setHeader('Content-Type', 'application/json;charset=UTF-8'; 'Authorization: MOBILE-API-140-327-PLAIN'+ appId=9aeb0234a9cc4723a0ef353d65ae0b77 + clientId=WebChat); // Set the body as a JSON object request.setBody('{"LeadId":"00QM000000FL93tMAD"}'); // Parse the JSON response HttpResponse response = http.send(request); if (response.getStatusCode() != 201) { System.debug('The status code returned was not expected: ' + response.getStatusCode() + ' ' + response.getStatus()); } else { System.debug(response.getBody()); }

Http http = new Http();
HttpRequest request = new HttpRequest();
request.setEndpoint('https://sprout.brightpattern.com/clientweb/api/v1/chats?tenantUrl=sprout.brightpattern.com&timestamp=1538601898');
request.setMethod('POST');
// Set Header for the Authorization 
request.setHeader('Content-Type', 'application/json;charset=UTF-8';
  'Authorization: MOBILE-API-140-327-PLAIN'+ appId=9aeb0234a9cc4723a0ef353d65ae0b77 + clientId=WebChat);
// Set the body as a JSON object
request.setBody('{"LeadId":"00QM000000FL93tMAD"}');
// Parse the JSON response
HttpResponse response = http.send(request);
if (response.getStatusCode() != 201) {
    System.debug('The status code returned was not expected: ' +
        response.getStatusCode() + ' ' + response.getStatus());
} else {
    System.debug(response.getBody());
}

I have issue with posting an API header to Bright Pattern out of Developer Console using a workspace. below is the Code and when I send it I get an "Execute Anonymous Error on line 6 column:19 Unexpected token '('". It looks like there is an Problem with the opening bracket after the request.setHeader. However this looks ok.

Http http = new Http(); HttpRequest request = new HttpRequest(); request.setEndpoint('https://sprout.brightpattern.com/clientweb/api/v1/chats?tenantUrl=sprout.brightpattern.com&timestamp=1538601898'); request.setMethod('POST'); // Set Header for the Authorization request.setHeader('Content-Type', 'application/json;charset=UTF-8'; 'Authorization: MOBILE-API-140-327-PLAIN'+ appId=9aeb0234a9cc4723a0ef353d65ae0b77 + clientId=WebChat); // Set the body as a JSON object request.setBody('{"LeadId":"00QM000000FL93tMAD"}'); // Parse the JSON response HttpResponse response = http.send(request); if (response.getStatusCode() != 201) { System.debug('The status code returned was not expected: ' + response.getStatusCode() + ' ' + response.getStatus()); } else { System.debug(response.getBody()); }

I have issue with posting an API header to Bright Pattern out of Developer Console using a workspace. below is the Code and when I send it I get an "Execute Anonymous Error on line 6 column:19 Unexpected token '('". It looks like there is an Problem with the opening bracket after the request.setHeader. However this looks ok.

Http http = new Http();
HttpRequest request = new HttpRequest();
request.setEndpoint('https://sprout.brightpattern.com/clientweb/api/v1/chats?tenantUrl=sprout.brightpattern.com&timestamp=1538601898');
request.setMethod('POST');
// Set Header for the Authorization 
request.setHeader('Content-Type', 'application/json;charset=UTF-8';
  'Authorization: MOBILE-API-140-327-PLAIN'+ appId=9aeb0234a9cc4723a0ef353d65ae0b77 + clientId=WebChat);
// Set the body as a JSON object
request.setBody('{"LeadId":"00QM000000FL93tMAD"}');
// Parse the JSON response
HttpResponse response = http.send(request);
if (response.getStatusCode() != 201) {
    System.debug('The status code returned was not expected: ' +
        response.getStatusCode() + ' ' + response.getStatus());
} else {
    System.debug(response.getBody());
}
Source Link
Loading