Zoho lead api not saving data for a field - zoho

Hi i am using zoho v2 apis to create lead on zoho. All the values are save but one value is not saving. Check the attached file.
i have tried "Last_Page_Url" and "last_page_url" nothing works.

I used this api to get the api_name for the key.
curl "https://www.zohoapis.com/crm/v2/settings/fields?module=Leads"
-X GET
-H "Authorization: Zoho-oauthtoken 1000.8cb99dxxxxxxxxxxxxx9be93.9b8xxxxxxxxxxxxxxxf"

Related

Setting a User when calling cloud code from cURL (for testing)

I'm trying to call a cloud function using cURL (or from Postman) for testing. The problem is, I need to somehow set a "current user" so I can use request.user.
I've tried everything I can think of - setting it in the body of the request, using useMasterKey, fetching a user from an objectId and assigning it within the cloud code function etc. I've even tried making the request through a proxy to try see how it's done, so I could replicate it... I've got nothing.
Simply trying to save a new object to a class Orders with a user object...
In order to have a request.user in present in your cloud code, you will need to pass in a session token.
First query the session class.
curl -X GET \
-H "X-Parse-Application-Id: ${APPLICATION_ID}" \
-H "X-Parse-REST-API-Key: ${REST_API_KEY}" \
https://YOUR.PARSE-SERVER.HERE/parse/sessions
Then pick any user session token and add that to the header of your orginal request.
The header should be in this format
"X-Parse-Session-Token: your_session_token"
And it will work.

API call for deploying and undeploying Google AutoML natural language model - documentation error?

We have a google automl natural language model and while testing, have been deploying and undeploying the model by hand on the console.
We also have a google automl image classification model in a production application and we deploy and undeploy that from our application using the API.
I am now viewing the documentation for the automl natural language model and I want to be able to deploy the model from our application as-needed and undeploy it when finished. Obviously being deployed incurs charges so we minimise these by only having the deployed capability active when needed.
The documentation page for this functionality is here
https://cloud.google.com/natural-language/automl/docs/manage-models#deploy-models
This is next to the section in the documentation that describes deleting models here
https://cloud.google.com/natural-language/automl/docs/manage-models#delete-model
In the deploy and undeploy model, it shows the API call you make for undeploy (:undeploy) but it does not specifically show the one you make for deploy (which I would assume is :deploy but this is not noted in the documentaion)
IN the delete model section, the API endpoint shown is the undeploy endpoint. The documentation specifically says that if you use the undeploy command, it deletes the model. I believe this to be a documentation error but I don't want to try it as I don't want to delete our model by mistake.
It also doesn't specifically say this but in my image model, it returns me a long running operation and I can poll for the status of that. Is that how it works on the natural language models too?
Thanks for the clarification
Richard
Deploying a model was not properly documented for the REST usage. See deploy endpoint for reference.
curl -X POST \
-H "Authorization: Bearer "$(gcloud auth application-default print-access-token) \
https://automl.googleapis.com/v1/projects/your-project-id/locations/location-id/models/your-model-id:deploy
You are correct, this might be a documentation error. Another error is when using :undeploy it should be POST not GET.
curl -X POST \
-H "Authorization: Bearer "$(gcloud auth application-default print-access-token) \
https://automl.googleapis.com/v1/projects/your-project-id/locations/location-id/models/your-model-id:undeploy
For :delete it should be DELETE not GET.
curl -X DELETE \
-H "Authorization: Bearer "$(gcloud auth application-default print-access-token) \
https://automl.googleapis.com/v1/projects/your-project-id/locations/location-id/models/your-model-id
Yes you can poll for the status that was given. See Working with long-running operations for AutoML Natural Language for more details.
I also sent a feedback on the documentation about the mistakes you pointed out.

What is correct way to get access to YouTube Data 3 API?

Dear YouTube Data 3 API support, it's a question for you.
With https://github.com/googleapis/google-auth-library-ruby using json-key that we got to Service Account, we successfully get [TOKEN_KEY] for API calls.
But while we try to get Live Streaming list we get an error:
{
"message": "The user is not enabled for live streaming.",
"domain": "youtube.liveBroadcast",
"reason": "liveStreamingNotEnabled",
"extendedHelp": "https://www.youtube.com/features"
}
The request sample:
curl \
'https://youtube.googleapis.com/youtube/v3/liveBroadcasts?part=snippet%2CcontentDetails%2Cstatus&broadcastType=all&mine=true' \
--header 'Authorization: Bearer [TOKEN_KEY]' \
--header 'Accept: application/json' \
--compressed
What we have already done in Google Cloud Console:
Create a Project
Enable YouTube Dava 3 API
Create an API key
Create an OAuth ID
Create an Service Account
Connect Service Account in OAuth ID
We try some another ways but uselessly.
Of course, our account, in which we created the API application, has access for streaming through the studio.youtube.com (we have 10,000 subscribers and streams several times a week).
Also we studied the API documentation up and down, we do everything correctly step by step, as described.
I can write a private email with my account information to YouTube Data 3 support member, to make it easier for you to understand, and when we will successfully solve the problem I will write a comment to this question for the whole community.

Create Card through composer-rest-server

I am able to add participant using composer-rest-api and it is possible to upload card through composer-rest-api by rest API wallet. Is it possible to create Card through composer-rest-api?
I checked this answer Hyperledger Composer Web application user authentication, it mentions how to create card using javascript api. I used javascript code to create participant and issue it and when I run it ($node filename.js), it works fine. How can I add this to the rest API, which file exactly I need to modify for the rest server to be included create card.
yes sure - you would use the /api/system/issueIdentity operation as in http://localhost:3000/api/system/issueIdentity - you would get an option to save the card to a file (no credentials set, ie enrol ID and secret). You would then, again in REST, import the card (as you did) using http://localhost:3000/api/wallet/import'- and specify the card file to import from a 'Browse' (explorer) button. Once you import it to the wallet in your REST client, you can set it as the default card too usingsetDefault` endpoint operation if need be. Then use it once enrolled and indeed export it for use elsewhere. Example using curl:
curl -X POST --header 'Content-Type: application/json' --header 'Accept: application/json' -d '{ \ "participant": "org.acme.org.user#orguser1", \ "userID": "dave" \ }' 'http://localhost:3000/api/system/issueIdentity'
where orguser1 is your participant already created in Composer. Hope this helps.
I'm able to execute the curl command as provided by Mr O'Mahony. However, I don't know how to deal with the response I got back (please see below). Does anyone have javascript example code to handle the response? Thanks.
PK
�|eL��gDconnection.json{"name":"hlfv1","type":"hlfv1","orderers":[{"url":"grpc://localhost:7050"}],"ca":{"url":"http://localhost:7054","name":"ca.org1.example.com"},"peers":[{"requestURL":"grpc://localhost:7051","eventURL":"grpc://localhost:7053"}],"channel":"composerchannel","mspID":"Org1MSP","timeout":300}PK
�|eL�/
metadata.json{"userName":"voter114","version":1,"enrollmentSecret":"JoKCZAJxTfic","businessNetwork":"voting-network"}PK
�|eL��gDconnection.jsonPK
�|eL�/

Microsoft OneDrive API InvalidAuthenticationToken CompactToken parsing failed with error code: -2147184105

I have looked at the two similar questions in StackoverFlow and on the web but I still don't understand what I should do.
I want to download a file that is located on OneDrive programmatically using a bash script (with curl).
So I've seen here that I can use the code flow to access Microsoft Graph. So I proceeded like that (I inspired myself from the Jay Lee answer):
1- I get the code with this URL
https://login.live.com/oauth20_authorize.srf?client_id=10c492f9-132a-4079-adae-382dad9d4339&scope=onedrive.readonly&response_type=code&redirect_uri=https://login.microsoftonline.com/common/oauth2/nativeclient
2- Then I swap authorization code for access token with this URL:
curl -X POST https://login.live.com/oauth20_token.srf -d "client_id=${client_id}&redirect_uri=${redirect_uri}&code=${auth_code}&grant_type=authorization_code" --header "Content-Type:application/x-www-form-urlencoded"
And I store the token and the expire time in a file
3- I made some process to handle the fact that I have to refresh the token (according to the expire time).
4- I use my token to download my file programmatically with Microsoft Graph
api_data=$(curl https://graph.microsoft.com/v1.0/me/drive/items/B8D9948257F95B84%21104/content -H "Authorization: Bearer $access_token")
echo -e "$api_data"
The problem- When I run the program, I get this:
How come?
You're authenticating against the wrong endpoint. The login.live.com endpoint cannot provide a valid token for Graph. You need to use the v2 Endpoint for this instead.
Check out Microsoft v2 Endpoint Primer for a walkthrough. Given that you're using curl, the pseudo code provided should give you everything you need.

Resources