I was able to successfully follow the Embedded C guide to set up my device with the PARSE API and send a test push to it, but I'm having an issue registering the device for custom push notifications. When I go to the Push page and try to "Send a push" I get a message saying "No Registered Devices". I assume that this has to do with the fact that the device does not register to any channels using the provided sample code. The API documentation lacks severely on the ParseClient class and therefore I am left wondering how one would achieve this?
Can the parseSendRequest function be used to modify fields in the Installation class?
The goal here is to be able to send custom push notifications to the said device, any sample code would be greatly appreciated.
Thanks!
After some trial and error this seemed to work for me to send non-targetted pushes like the button on the getting started page:
curl -X POST \
-H "X-Parse-Application-Id: ${APPLICATION_ID}" \
-H "X-Parse-REST-API-Key: ${REST_API_KEY}" \
-H "Content-Type: application/json" \
-d '{
"where": {
"deviceType": "embedded"
},
"data": {
"alert": "Hello World!"
}
}' https://api.parse.com/1/push
It does not quite answer your question of how to properly register the device but you can at least send custom push notifications.
Related
I installed Geth in order to fire JSON RPC calls to the ethereum test net Goerli. I followed the getting started tutorial here. I followed the instructions and did the following:
Generated a new account (wallet address) by calling clef newaccount --keystore <my_local_dir>/keystore
Started clef on Goerli (chain ID is 5) and used the newly generated keys by pointing to the keystore dir clef --keystore <my_local_dir>/keystore --configdir <my_local_dir>/clef --chainid 5
Started geth to sync with nodes by calling geth --datadir <my_local_dir> --signer=<my_local_dir>/clef/clef.ipc --goerli --syncmode snap --http
Attached to running node by calling geth attach http://127.0.0.1:8545. Although, I believe this step can be skipped, since I am trying to fire JSON RPC requests
Fired the request through postman - the generated curl command is the following:
--header 'Content-Type: application/json' \
--data-raw '{
"jsonrpc": "2.0",
"method": "eth_getBalance",
"params": ["0x631e9b031b16b18172a2b9d66c3668a68a668d20", "latest"],
"id": 1
}'
What could I possible be doing wrong? I see the account does have ether (balance), but I keep getting 0 as a result of my call:
{
"jsonrpc": "2.0",
"id": 1,
"result": "0x0"
}
Any idea?
After some additional research and talking with colleagues, I believe I now know why I wasn't able to retrieve blockchain data. It is only available once the node is fully synced:
Client execution will initiate its core functions, chosen endpoints, and start looking for peers. After successfully discovering peers, the client starts synchronization. Current blockchain data will be available once the client is successfully synced to the current state.
This can be found in the last paragraph here.
So the issue wasn't a failed installation or setup, but rather unsynced client.
Ref - https://support.oracle.com/cloud/faces/DocumentDisplay?id=2637471.1&_adf.ctrl-state=h87zqwsi3_730&_afrLoop=213040896345615
Can anybody help with a sample payload to invoke 'Import Applications' POST method to programmatically import the application to the Oracle Visual Builder Cloud Service.
I know I don't have the Content-Type or the request body or both not correct. I'm using Postman to test the endpoint
Steps
Setup the Oracle Visual Builder Cloud Service instance in https://cloud.oracle.com/?region=
Created an 'Visual Builder' instance in oracle cloud for my login/ tenancy
Launched the VBCS home page and created one or more applications
Used the VBCS REST endpoint (GET /resources/application/exportresources/{projectid}-{version}) to export one of the applications
I'm trying to import the application (POST /resources/application/importresources) to another VBCS instance but unable to determine the correct 'Content-Type' or the request payload format. I keep getting HTTP 415 or 400 error
Code shown below. SERVICENAME-CLOUDACCOUNT.SERVICETYPE is replaced from oracle cloud account.
curl --location --request POST 'https://SERVICENAME-CLOUDACCOUNT.SERVICETYPE.ocp.oraclecloud.com/ic/builder/resources/application/importresources' \
--header 'Authorization: Bearer yourOAuthToken' \
--header 'Content-Type: application/vnd.oracle.adf.error+json;application/json;application/vnd.oracle.adf.resourceitem+json;application/vnd.oracle.adf.resourcecollection+json' \
--header 'REST-Framework-Version: 4' \
--data-raw '{
"branchId": "0",
"importMode": "xyz",
"name": "Test",
"description": "sample",
"location": null,
"fileName": "abc",
"unzip": null
}'
Instead of hacking your way around - how about using the proper way of storing your code in a Git repo and then using the CI/CD features of VB Studio to move your app from one instance to the other?
This will also make upgrades of the app simpler going forward.
Here is an intro:
https://blogs.oracle.com/vbcs/post/automate-visual-applications-cicd-with-visual-builder-studio
I debugged the visual builder cloud instance logs to find the details of the rest api call. When importing the application from the front end ( OVBCS development platform UI ), the logic utilizes the 'Import Applications' endpoint.
Here is the working curl script for importing application resources to the oracle visual builder cloud instance using the REST end points
Login to Oracle Cloud using your cloud account credentials and tenancy
On navigation menu on top left -> OCI Classic Services -> Platform Services -> Visual Builder
Create an instance if you don't have one already. Click on the active instance and Start it up
Grab your VBCS instance base url. It will be something like https://yourInstanceName-yourTenancy.builder.ocp.oraclecloud.com/ic/builder/
Assuming you have a visual application created in your VBCS instance. Ref here
Assuming you are familiar with generating bearer token for oracle cloud applications. The OAuthToken mentioned in the below samples are generated based on your preferred OAuthType ( ResourceOwner or JWT or whatever setup you have for your cloud application)
Export your application. response will be zip file contents. save it to your file system
curl --location --request GET 'https://yourInstanceName-yourTenancy.builder.ocp.oraclecloud.com/ic/builder/resources/application/exportresources/yourAppId-yourAppVersion' --header 'Authorization: Bearer OAuthToken'
Let's say you saved the exported file in C:\temp\yourAppId-yourAppVersion.zip
Import your application as new application in the target instance
curl --location --request POST 'https://yourInstanceName-yourTenancy.builder.ocp.oraclecloud.com/ic/builder/resources/application/importresources?branchId=yourAppId&importMode=CREATE_NEW_APP&name=yourAppName&description=SomeOptionalDesc&fileName=yourAppId-yourAppVersion.zip&unzip=true' --header 'Authorization: Bearer OAuthToken' --header 'Content-Type: application/zip' --data-binary '#/C:/temp/yourAppId-yourAppVersion.zip'
Import your application to an existing application in the target instance. It will override the existing application version with the contents that you are importing.
curl --location --request POST 'https://yourInstanceName-yourTenancy.builder.ocp.oraclecloud.com/ic/builder/resources/application/importresources?branchId=yourAppId-yourAppVersion&importMode=KEEP_EXISTING&name=YourAppName&description=SomeOptionalDesc&fileName=yourAppId-yourAppVersion.zip&unzip=true' --header 'Authorization: Bearer OAuthToken' --header 'Content-Type: application/zip' --data-binary '#/C:/temp/yourAppId-yourAppVersion.zip'
I’m using the Mailchimp Events API to trigger events on the members in our Audience list. In general the API works as expected: When I send an event, I can see the event's name and properties in the member’s activity.
However, if any of the properties in the Event contain German umlauts, it doesn’t work. It records the event on the member but without the properties.
For example: When the event is triggered as follows:
curl --location --request POST 'https://us4.api.mailchimp.com/3.0/lists/1234/members/12343124/events' \
--header 'Content-Type: application/json; charset=utf-8' \
--header 'Authorization: Basic TED' \
--data-raw '{
"name": "test-event",
"properties": {
"link": "Münich"
}
}'
The event is records under the member's activity but without the properties.
Hope someone could help me out with this.
Thanks in advance.
Turns out Mailchimp Event API endpoints don't support it.
This was the response from Mailchimp API's support team:
Currently, using special characters in data passed over in relation to the Events endpoint is not supported. Our developers are aware and we're tracking feedback as a fix is in the works. I don't have a current ETA for that, unfortunately. The best option at this time is the avoid using special characters whenever possible, and please send any specific occurrences of this that you see our way so we can add them to our tracking.
My chatbot needs to start a new converstaion/reply chain in a public Microsoft Teams channel. Unfortunately, I'm getting a 403 BotNotInConversationRoster error when sending a POST request to /v3/conversations.
My requests POST /v3/conversations (see API reference) looks as follows (note: I removed the access token):
curl -X POST -H "Authorization: Bearer XXX" -H "Content-Type: application/json" https://smba.trafficmanager.net/de/v3/conversations -d '{"activity":{"text":"Test","type":"message"},"channelData":{"channel": {"id": "19:62fb45ddd8b2447082e5d1694ce8d735#thread.skype"}}}'
I don't understand the resulting error message.
{"error":{"code":"BotNotInConversationRoster","message":"The bot is not part of the conversation roster."}
From my understand an installed chatbot with scope team should be a member of each public channel by default. Or am I missing something?
Any ideas/examples?
It sounds like it could be that the Bot registration in Azure doesn't have the Teams channel configured properly - see the image for reference
To send bot notifications to the channels in ms teams, you should have install the bot app for team(not only for chat).
You can install your bot app to team either by
Add app to team manually in ms teams dashboard.
By using graph api, https://learn.microsoft.com/en-us/graph/api/teamsappinstallation-add?view=graph-rest-1.0&tabs=http
How can I make a missed call or a call with a time out using sinch .
using a curl request
Before a call I should able to select a DID which I already have .
Example :
curl --user "applicationyour_app_key:your_app_secret" --data '{"message":"your_message"}' -H 'Content-Type: application/json' https://messagingapi.sinch.com/v1/sms/the_phone_number
Above shows a query for SMS . Here my question is how to make the call with a time duration of 1 sec after ring using a DID
Send the SMS with you backend from you client when you receive the calldidend event with reason noanswer. if you tell me what plattforms you are using I could give you sample code