Youtube LiveChat API: messageTextInvalid - youtube-livestreaming-api

I'm using the Youtube livechat.insert API (https://developers.google.com/youtube/v3/live/docs/liveChatMessages/insert), and occasionally get back the messageTextInvalid error. However the error description page doesn't give much of a hint as to what's wrong here (https://developers.google.com/youtube/v3/live/docs/errors#liveChatMessages_youtube.liveChatMessages.insert). I've ensured the messages being sent are <= 200 characters long, and do not have newlines in them. However a message like '(Discord) person: COMMENT : Wonderful!' returns this error that the text is invalid. Is there some information that I can find about what text is valid in the message? I also didn't find much information on the livechat message resource page (https://developers.google.com/youtube/v3/live/docs/liveChatMessages#resource)

Related

Splunk REST API error handling with ouput_mode=json OR output_mode=csv

Using the Splunk REST API, i see that XML response will return search syntax errors or warnings.
if you select output_mode="csv" or output_mode="json" and the search had a syntax error, it simply finishes quickly and returns zero results.
Is there a way to change this behavior so that an error in syntax will return an error message instead of just sending back 0 results? I'd like to use JSON and not have to overhaul to support XML.
Searching API documents, I keep coming up empty.

Unable to POST NZ employee openingBalances to Xero?

I am attempting to create a single opening balances record against an existing employee but keep getting a 400 Bad Request response with this detail...
At least one NZ opening balance item is required in the request
I am following the instructions as per this documentation...
https://developer.xero.com/documentation/api/payrollnz/employeeopeningbalances#post-opening-balances
URL : {DestinationID} is properly replaced with the employee GUIDhttps://api.xero.com/payroll.xro/2.0/employees/{DestinationID}/openingBalances
JSON Body[{"periodEndDate":"2011-01-30T00:00:00","daysPaid":5.00,"unpaidWeeks":0.00,"grossEarnings":1442.31}]
The Xero forums and support is pretty unreliable so I'm posting here in the hopes for a better response.
After some trial and error using the API Explorer that Xero provides I was able to get it working using their example....
I eventually learned that daysPaid and unpaidWeeks must both be integer whole numbers or else it fails.... The error message provided is misleading but this resolves the problem.

Outpan API C# POST Request

What does the Outpan server expect when posting data?
GET was giving me a json info that I was able to convert to an object.
Now when I'm giving information back just like the name:
https://api.outpan.com/v2/products/UPCCode/name?apikey=xxx
it will always not understand my information (error 400). Already tried sending the json back with additional info, "Foodname" and "name = Foodname"

Need To Resolve Yelp API Response Error: “Signature is invalid”

My issue is when I try and fetch the Yelp API I keep getting this error time after time and i'm not sure why i've checked all the parameters and still cant get anything back from Yelp
My Yelp API Fetch Link -
https://api.yelp.com/v2/search?term=food&ll=37.788022,-122.399797&oauth_consumer_key=MY_Consumer_Key&oauth_token=MY_TOKEN&oauth_signature_method=HMAC-SHA1&oauth_signature=TOKEN_SECRET&oauth_timestamp=1456337018&oauth_nonce=1456337018
My Error -
error: {
text: "Signature was invalid",
id: "INVALID_SIGNATURE",
description: "Invalid signature. Expected signature base string:
GET&https%3A%2F%2Fapi.yelp.com%2Fv2%2Fsearch&ll%3D37.788022%252C-122.399797%26oauth_consumer_key%3DG02O6tXnFkSbsGYOJxCQDw%26oauth_nonce%3D1456337018%26oauth_signature_method%3DHMAC-SHA1%26oauth_timestamp%3D1456337018%26oauth_token%3DBPMpqKrD4dA4xGGHKtC_-xitzb5LRNn8%26term%3Dfood"
}
Error in your API call url,yelp using oauth 1.0a,Which one url parameters should be in alphabet order(this one is telling clearly in your error description), So API call url should be like this:
https://api.yelp.com/v2/search?ll=37.788022,-122.399797&oauth_consumer_key=MY_Consumer_Key&oauth_nonce=1456337018&oauth_signature=TOKEN_SECRET&oauth_signature_method=HMAC-SHA1&oauth_timestamp=1456337018&oauth_token=MY_TOKEN&term=food

How to properly encode special characters in a REST API url

EDIT: The NHTSA docs, as CBroe points out, say to replace an ampersand with an underscore. However, I'm also getting an error with forward slashes (albeit a different one, page not found, because it's decoding the slash), for example the make 'EXISS/SOONER':
http://www.nhtsa.gov/webapi/api/Recalls/vehicle/modelyear/1997/make/EXISS%2FSOONER?format=json
And replacing the ampersand with an underscore no longer results in an error message, but in zero results returned, which should not be the case.
ORIGINAL POST:
I'm trying to download the content from the following URL:
http://www.nhtsa.gov/webapi/api/Recalls/vehicle/modelyear/1997/make/s&s?format=json
And the site returns the following error message:
Server Error in '/' Application.
A potentially dangerous Request.Path value was detected from the client (&).
The problem is the ampersand; a similar request for a different car make works:
http://www.nhtsa.gov/webapi/api/Recalls/vehicle/modelyear/1997/make/toyota?format=json
I have verified from a different endpoint that S&S is a valid make for the API.
Based on stackoverflow answers, I've tried all the following without success:
http://www.nhtsa.gov/webapi/api/Recalls/vehicle/modelyear/1997/make/s%26s?format=json
http://www.nhtsa.gov/webapi/api/Recalls/vehicle/modelyear/1997/make/s%26amp;s?format=json
http://www.nhtsa.gov/webapi/api/Recalls/vehicle/modelyear/1997/make/s%26amp%3Bs?format=json