Mailchimp API: Unable to trigger Events with umlauts in properties - mailchimp

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.

Related

Exporting and Importing Applications From VBCS With REST Calls

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'

Why does my SuiteQL POST request work when I use Postman, but when I cURL the same code in VS Code terminal, it returns 'INVALID_LOGIN'

I'm trying to use SuiteQL to query a workbook for a client implementation, but I'm having trouble getting it to work in VS Code. I downloaded the Postman environment template and collections archive from the SuiteTalk tools download page and then sent a test request. It returned a successful JSON response. I then tried to send the same sample request using cURL in the VS Code terminal, then with node-fetch, and then using an npm library called netsuite-rest. All of these return 401 'INVALID_LOGIN'. Why does it work when I use Postman, but nowhere else? Here's a sample of my cURL request:
curl --location --request POST 'https://<ACCOUNT_ID>.suitetalk.api.netsuite.com/services/rest/query/v1/suiteql?limit=5' \
--header 'prefer: transient' \
--header 'Content-Type: application/json' \
--header 'Authorization: OAuth realm="<ACCOUNT_ID>",oauth_consumer_key="<CONSUMER_KEY>",oauth_token="<TOKEN>",oauth_signature_method="HMAC-SHA256",oauth_timestamp="<TIMESTAMP>",oauth_nonce="<NONCE>",oauth_version="1.0",oauth_signature="<SIGNATURE>"' \
--header 'Cookie: NS_ROUTING_VERSION=LAGGING' \
--data-raw '{
"q": "SELECT id, companyName, email, dateCreated FROM customer WHERE dateCreated >= '\''01/01/2019'\'' AND dateCreated < '\''01/01/2020'\''"
}'
I see this is an old thread however, I myself am just getting started with NetSuite and Postman. For me, the netsuite Postman query will work fine when you get your access token and this will work for a short period of time. Eventually it will fail and at that time you need to use your refresh token to get a new access token. Then, add the fresh access token into your query authorization as a bearer token - and then the query will start working again.
Once it is actively working then there is a magic Area of postman = Code Snippet. So click on that and then notice that there is a pulldown menu of many code bases - that will display the entire code request for your query! For example you could choose nodeJS - Axios - and just copy the code and paste it in to your webpage.
The one thing you will have to remember is that the access token Will expire after a period of time and then you will have to replace the access token with a fresh one (using the refresh token).

Getting the list of sponsors

I'm working with a Youtuber with over 1mil subscribers and we need to fetch the list of sponsors when users log-in to check if they're sponsoring the channel, if they do they get access to a specific part of the website.
I went through the API docs and couldn't find a way to do it,
am I missing something?
thank you for your help in advance :)
Youtube Data API has Members resource that returns the list of members (sponsors) of a channel. It also returns membership level of each member.
curl \
'https://www.googleapis.com/youtube/v3/members?part=snippet&mode=all_current&maxResults=1000&key=[YOUR_API_KEY]' \
--header 'Authorization: Bearer [YOUR_ACCESS_TOKEN]' \
--header 'Accept: application/json' \
--compressed
EDIT: Updated answer to Members resource instead of Sponsor resource (deprecated as of 2020-03-31)

how to send multipart/form-data via InvokeHttp NiFi

I have a 3rd party REST, which I am successfully able to call like this using CURL (shell). This API return JSON. I tried calling same API, by changing content type to application/x-www-form-urlencoded but it doesn't work. I think I am forced to use content-type: multipart/form-data
curl --request POST --url https://************************* --header 'Authorization: Bearer ********' --header 'content-type: multipart/form-data; ' --form cluster_id=0717-035521-puny598 --form start_time=1534357800000 --form end_time=1534444199999 --form order=ASC --form limit=500
Now I want to call same API using InvokeHTTP processor (NiFi). So I configured it as follows. But I am not able to do a successful call. (it is not a proxy issue).
Following is how I am creating POST body (by FF)
I have tried replacing "enter" by \r\n etc, or changing body as name1=val1&name2=val2&.... etc. nothing worked.
This is the response I am getting.
[
I am able to run CURL (shell, from same server where Nifi is running). Also I am able to access url via postman.
[
finally, it worked. flow is somewhat like this.
GenerateFlowFile->UpdateAttribute->AttributesToJSON->InvokeHTTP
Only change, I made to InvokeHTTP. reverted content-type back to ${mime.type}.
I was struggling with this for a few hours. I've got a backend API that has
ResponseEntity<ByteArrayResource> post (#RequestPart("file") MultipartFile file) and a NiFi processor that sends XLSX data to this. I was getting the same issue... The key for me were the bottom two properties:
FlowFile Form Data Name -> file (this is the name of the variable in the API call)
Set Flowfile Form Data File Name -> true

PARSE API Push Notifications with Embedded C

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.

Resources