SkillsFuture Credit Pay Not working properly - api

We are using the API /skillsFutureCredits/claims/encryptRequests with the following payload
{
"claimRequest": {
"course": {
"id": "TGS-2020002051",
"fee": "1.00",
"runId": "278849",
"startDate": "2022-04-28"
},
"individual": {
"nric": "T5001077A",
"email": "abc#abc.com",
"homeNumber": "87654321",
"mobileNumber": "12345678"
},
"additionalInformation": "any additional information"
}
}
We get the encrypted response back and run /skillsFutureCredits/claims/decryptRequests with the following payload
{ "claimRequestStatus": "eyJ2IjoiIiwiaXYiOiJ4eS9XTGdiM3l2cHNEK1VENzh3TVFBa1BSWGpHSzhzbmJ0QUI4YUlTZmtNPSIsImtleXMiOnsiZGQ6YTk6YzM6NGY6Yzk6YWQ6OTY6NjQ6ZDc6YWQ6NDY6M2Q6ZDE6YmI6OGM6MDQ6Y2E6OGY6YzA6MWUiOiJWWnN1d2xacGtZdEdKZEtnV3dMblJxMGNmN1ZwK3ZXbjcvWFhEOG5TdVBJMGpRRkFIRG0vaUM5ejRPTEt4ODhST21pQ1p3WEVXU2NHd0lod2htMnBvM0ExMEdYZy80eWdDVEJhNkI1NVQ1TmdvWmlGTS9LWlBVRHFoVzFrUXQ3alB3anlTZm81Z0M5a0JtSnJDbXlJZ05veXFQV2RPcytBQ0J2SHgrUGVqT1d3T2trYThJbm9LS2NqenhHV2hKbWpoWEl2ZFM3aDUwdE10TmJQMk5wbTdvZWROeUl1OWw0Ty9BV3FWQmtYVGY2ZFRvb2J5OFJsM2JJcHhFQmp6Qy9pYzZBN3N5OGFrZDQ4Znk4WWhyTngvdXpDZ0NENVl0bElHSmFpYmt5bm55ZWNBS1NEbFdqMnNlOGdsbmdFNUZCa0hCZjdmWDVuU2VydXdmRDl4Q1MrbnRSYU5Yc3NweHJ2bE9sMmpWN0l1dENId2JvNmRnS3laMVRDSXc0Q2tta2tuY1VrcWluZk5nNjBHaFNOTXI3aGlUWmg4RnNESkJ4TmEzMFRpY1IvNExtTGdncFNyKy9HdDRweW1WTitiUDRuQ0o4QSt1L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
"error": "42+fmhx6gjvNyCQsf1ktG7nFNcfsjarCS1dVJ71ehiTxJcBz9utPN6K9Dv0jpISN7U4jy7Dv5jxcueQyQbC4qq/JWX7o7Pe0OeKUSYIMT/0xaPD19yOOyxuY0y+LWDhV9VP4oTFIGM/2hhoJRuLfGwVevQdQsRh3XLfcpPccO4Xer4D2KelIFACofkn0goY1"
which when decrypt, it is an empty data. In post man, it is showing 500 internal server error but not showing us what error it is.
Any help is greatly appreciated.

Related

Bad Request: One or more of the contents is not owned by the author. All contents must be owned by the author

I've been trying to POST an image to linkedin via the API given by linkedin: https://api.linkedin.com/v2/ugcPosts
Here are some of the steps I followed according to their documentation:
Step 1: Register the image,
Response I get:
{
"value": {
"mediaArtifact": "urn:li:digitalmediaMediaArtifact:(urn:li:digitalmediaAsset:C4D22AQHnSETazVUUiw,urn:li:digitalmediaMediaArtifactClass:feedshare-uploadedImage)",
"uploadMechanism": {
"com.linkedin.digitalmedia.uploading.MediaUploadHttpRequest": {
"uploadUrl": "https://api.linkedin.com/mediaUpload/C4D22AQHnSETazVUUiw/feedshare-uploadedImage/0?ca=vector_feedshare&cn=uploads&m=AQKy8KTj9ZExhAAAAYUvD_6GEclpKOZdwJvPF682Ld1UUb6h0V7VvAtpuA&app=206373578&sync=0&v=beta&ut=3dh6EETZGM5WA1",
"headers": {
"media-type-family": "STILLIMAGE"
}
}
},
"asset": "urn:li:digitalmediaAsset:C4D22AQHnSETazVUUiw",
"assetRealTimeTopic": "urn:li-realtime:digitalmediaAssetUpdatesTopic:urn:li:digitalmediaAsset:C4D22AQHnSETazVUUiw"
}
}
Step 2: Upload the image using upload URL from Step 1
Response: 201 Created status code with no message
Checked the status, it's says available: https://api.linkedin.com/v2/assets/C4D22AQHnSETazVUUiw
{
"recipes": [
{
"recipe": "urn:li:digitalmediaRecipe:feedshare-image",
"status": "AVAILABLE"
}
],
"serviceRelationships": [
{
"relationshipType": "OWNER",
"identifier": "urn:li:userGeneratedContent"
}
],
"mediaTypeFamily": "STILLIMAGE",
"created": 1671531855410,
"id": "C4D22AQHnSETazVUUiw",
"lastModified": 1671531901231,
"status": "ALLOWED"
}
Now when I am trying to POST it to the endpoint: https://api.linkedin.com/v2/ugcPosts
It's giving 400 bad Request with the following Error:
{
"errorDetailType": "com.linkedin.common.error.BadRequest",
"message": "com.linkedin.content.common.exception.BadRequestResponseException: One or more of the contents is not owned by the author. All contents must be owned by the author",
"errorDetails": {
"inputErrors": [
{
"description": "Content(s) you provided must be owned by post author",
"input": {},
"code": "INVALID_CONTENT_OWNERSHIP"
}
]
},
"status": 400
}
I've given all permissions to it:
r_emailaddress, r_liteprofile, w_member_social

Why doesn't GraphQL.NET honour the errors.extensions schema?

I recently rewrote some GraphQL services from Java to .NET Core.
In Java, I was able to provide custom error messages to the clients using the errors.extensions in the response, ie:
{
"data": {
"someMutation": null
},
"errors": [{
"cause": null,
"message": "Unauthorized",
"httpStatusCode": 0,
"extensions": {
"uiMessage": "Oh no, your session expired. You'll need to login again to continue.",
"httpStatusDescription": "Unauthorized",
"httpStatusCode": 401
},
"errorType": "ValidationError",
"path": null,
"localizedMessage": "Unauthorized",
"suppressed": []
}
]
}
However, in .NET, I don't seem to be able to replicate this format.
ErrorInfo.Extensions is added to the root of the response, not to the the Errors object itself, eg:
{
"data": {
"someMutation": null
},
"errors": [{
"message": "Auth token not provided"
}
],
"extensions": {
"httpStatusCode": 401,
"httpStatusDescription": null,
"uiMessage": "Oh no, your session expired. You'll need to login again to continue.",
}
}
The GraphQL spec reads (ref https://spec.graphql.org/October2021/#sec-Errors, https://spec.graphql.org/October2021/#example-8b658):
GraphQL services may provide an additional entry to errors with key
extensions. This entry, if set, must have a map as its value. This
entry is reserved for implementors to add additional information to
errors however they see fit, and there are no additional restrictions
on its contents.
eg:
{
"errors": [
{
"message": "Name for character with ID 1002 could not be fetched.",
"locations": [{ "line": 6, "column": 7 }],
"path": ["hero", "heroFriends", 1, "name"],
"extensions": {
"code": "CAN_NOT_FETCH_BY_ID",
"timestamp": "Fri Feb 9 14:33:09 UTC 2018"
}
}
]
}
I created a new test project (.NET Core 3.1) using the latest versions of the libraries (GraphQL 7.1.1 et al) but am still unable to add custom properties to errors.extensions.
This is the test mutation which intentionally throws an exception:
Field<StringGraphType>("greet")
.Argument<NonNullGraphType<StringGraphType>>("name")
.Resolve(context => {
try {
throw new Exception("Invalid input");
return "Hello " + context.GetArgument<String>("name");
} catch(Exception ex) {
// This doesn't seem to get returned anywhere in the response
Dictionary<String, object> extraData = new Dictionary<string, object>();
extraData.Add("error1", "message1");
// Add the error to the response using the overloaded constructor
context.Errors.Add(new ExecutionError("Oh dear, that went wrong", extraData));
// This gets added to the root of the response
context.OutputExtensions.Add("error2", "message2");
return null;
}
});
the mutation to invoke it:
mutation {greet(name:"Chewbacca")}
and the response (I don't know where errors.extensions.details comes from):
{
"errors": [
{
"message": "Oh dear, that went wrong",
"extensions": {
"details": "GraphQL.ExecutionError: Oh dear, that went wrong"
}
}
],
"data": {
"greet": null
},
"extensions": {
"error2": "message2"
}
}
I would imagine that the GraphQL.NET library would expose an Extensions dictionary on the ExecutionError object so one could add custom values in the usual manner, eg:
ExecutionError executionError = new ExecutionError("Oh dear, that went horribly wrong");
executionError.Extensions.Add("customError", "Your custom error here")
context.Errors.Add(executionError);
Which would result in a response similar to this:
{
"data": {
"someMutation": null
},
"errors": [{
"message": "Oh dear, that went horribly wrong",
"extensions": {
"customError": "Your custom error here"
}
}
]
}
I am hopeful that some bright individual in the community can (slap me upside the head and) point me in the right direction.

Why is my whatsapp message not being sent?

Testing with Postman, I'm trying to send a message per the glitch example project from docs
I'm trying to write an API endpoint I can hit with a webhook when people send a message to my Org's whatsapp number. The API would send an automated response.
When I send the POST, with the following body to https://graph.facebook.com/v14.0/redacted/messages it comes back with the following response:
{
"error": {
"message": "(#131030) Recipient phone number not in allowed list",
"type": "OAuthException",
"code": 131030,
"error_data": {
"messaging_product": "whatsapp",
"details": "Recipient phone number not in allowed list: Add recipient phone number to recipient list and try again."
},
"error_subcode": 2655007,
"fbtrace_id": "A5YKQbpB0PEaaA-gIROEv-n"
}
}
The error code isn't list one the error codes page, nor can I find anything about adding a recipient phone number anyway (it doesn't make sense to require a pre-defined list of recipient phone numbers to which I can send messages).
Here's the message body:
{
"messaging_product": "whatsapp",
"to": "redacted",
"text": {
"body": "Ack: Hello world"
}
}
How do I get the message sent? I'm not able to proceed with development of my app until I can send a message.
Just Remove + from your mobile number and add you country code before your number.
Then its working fine.
Request Body:
{
"messaging_product": "whatsapp",
"to": "91xxxxxxxxxx",
"type": "template",
"template": {
"name": "hello_world",
"language": {
"code": "en_US"
}
}
}
Response Body:
{
"messaging_product": "whatsapp",
"contacts": [
{
"input": "91xxxxxxxxxx",
"wa_id": "91xxxxxxxxxx"
}
],
"messages": [
{
"id": "wamid.HBgMOTE3NTM4OTE4MzIyFQIAERgSOERCM0ZDOTJFMDk1RjBFNURBAA=="
}
]
}
for Your Reference
I got the same error code and message here.
I was debugging it and see that the from number is a little different than the number I had registered when I will echo the message back.
You can put the number of phone hard coded that you have registered before to see it working.

The request includes at least one invalid\/malformed connection photo id

I'm using Google StreetView Publish API to connect photos in a virtual tour and to some external photos on Google StreetView such as a road.
This is the API I use:
https://developers.google.com/streetview/publish/reference/rest/v1/photo/update
And this is the body of the request:
{
"pose": {
"heading": 26,
"latLngPair": {
"latitude": 47.707604844777,
"longitude": -124.41849471719
}
},
"places": [
{
"place_id": "ChIJvcvraDvfjVQR45a-VRk0lGs"
}
],
"connections": [
{
"target": {
"id": "CAoSLEFGMVFpcE5fWGtUZTFWV3dxRm9tOEFlRHVmYVdvTmdDR2NueVZ0dzhid0ZX"
}
},
{
"target": {
"id": "rQfq6hLfyFVfC0V43rrWDw"
}
}
],
"captureTime": {
"seconds": "1653027016"
}
}
But I'm getting this error message when I'm trying to add external panorama ID ({"target":{"id": "rQfq6hLfyFVfC0V43rrWDw"}} to the connections array.
{
"error": {
"code": 400,
"message": "The request includes at least one invalid\/malformed connection photo id.",
"status": "INVALID_ARGUMENT",
"details": [
{
"#type": "type.googleapis.com\/google.rpc.ErrorInfo",
"metadata": {
"EXTERNAL_MESSAGE": "The request includes at least one invalid\/malformed connection photo id."
}
}
]
}
}
Does Google let to connect your panoramas to the Google StreetViews panoramas such as street photos, etc? Or what I was doing wrong? Thank you in advance
You can not link your panoramas directly to Google Street View panoramas.
For a while, Google connected the tours automatically, if they were in a certain range. They stopped doing this and undid those connections, so at the moment both exist side by side on the same map.

INVALID_ARGUMENT error with Google Analytics Reporting API

I'm trying to do a request to the userActivity.search method,
this is the payload that I'm trying to do:
{
"viewId": "<VIEW ID>",
"dateRange": {
"startDate": "7daysAgo",
"endDate": "today"
},
"user": {
"type": "CLIENT_ID",
"userId": "<USER ID>"
}
}
But I'm stuck getting this error:
{
"error": {
"code": 400,
"message": "CLIENT_ID: <ID> not found.",
"status": "INVALID_ARGUMENT"
}
}
The ClientId I get previously at other GA endpoint that list the ClientIds that I need to get more details.
What am I doing wrong?