Is there a way to update and delete a Glip team or group? - ringcentral

I can retrieve a list of groups/teams or an individual one by using the chats API, but I cannot find how to update or delete a group or a team.
The GET APIs I use successfully include:
Get Chat List
GET https://platform.ringcentral.com/restapi/v1.0/glip/chats
Get Chat Info by ID
GET https://platform.ringcentral.com/restapi/v1.0/glip/chats/{chatId}
However, when I try to call PATCH or DELETE on the Chat ID API endpoint I receive a 404. Is there a way to delete a Glip team or group?

chats is a new endpoint to cover both Groups and Teams, however PATCH and DELETE have not been implemented on it yet.
Update Team
To update a team, use the old teams endpoint. The teamId below are the same as the chatId provided in the id property returned by the "Get Chat List" API.
Only the following body parameters are supported. Use the one(s) you wish to update.
PATCH https://platform.ringcentral.com/restapi/v1.0/glip/teams/{teamId}
{
"public": true,
"name": "My New Team Name",
"description": "My Fancy Team"
}
A successful PATCH will return a 200 OK response with a JSON body of the team properties.
Delete Team
To delete a team, use the old teams endpoint. The teamId below are the same as the chatId provided in the id property returned by the "Get Chat List" API.
DELETE https://platform.ringcentral.com/restapi/v1.0/glip/teams/{teamId}
A successful response will result in a 204 No Content response status code.
Update Group
There is no option to update a group as it is just a chat with multiple participants.
Delete Group
It is not possible to delete a Group or a PrivateChat. Attempting to do so will result in the error below. To delete a Group, convert it to a Team first and then delete it.
HTTP 400 Bad Request
{
"errors": [
{
"errorCode": "CNV-001",
"message": "Conversation with type [Group] cannot be deleted."
}
]
}

Related

Getting unexpected '#' error under postman Test tab

I am a learner in postman and do not have much experience in programming/scripting.
Here the issue.
Used POST api request - For getting the access token;
Used POST api request - To create an account;
Used POST api request - To cancel an account with CancellationReason
Need to crosscheck the cancellation details (some fields like cancellationReason) in web application.
In order to avoid manually check, i have used GET request api like below
by passing all the mapped fields (as per web application) in the GET request end url
(i.e. by sending the details in fetch_xml query parameter in the end url) in order to get those required fields returned.
Now i got a successful response with status code.
After that i want to compare the fetched values (from the response body) ... VS.... to the data i passed while cancelling the account (i.e. in POST api request - To cancel the account) and make sure both are same.
After that under Test tab - I have updated query like below, however it throwing an Unexpected '#' error (as the below query contains '#' in middle of the field name)
tests["Verify the CancellationReason matches"] = pm.expect(data._usr_cancellationReason_value#OData.Community.Display.V1.FormattedValue).to.eql("CancellationReason");
Can someone please help me to understand whether i should remove this #symbol or should replace with something else ?
Here is the response body:
{
"#odata.context": "https://hfrdcompanies.integrationdev01.crm3.cs.com/api/data/v9.1/$metadata#hfrd_workorders(_usr_cancellationchannel_value,usr_CancellationChannel,_usr_workorderreason_value,usr_WorkOrderReason,hfrd_workorderid,usr_cancellationuser,_usr_cancellationsource_value,usr_CancellationSource,hfrd_name,usr_CancellationChannel(),usr_AccountReason(),usr_CancellationSource())",
"value": [
{
"#odata.etag": "W/\"2345234523\"",
"_usr_cancellationchannel_value#OData.Community.Display.V1.FormattedValue": "Mobile App",
"_usr_cancellationchannel_value": "acefsdflin89-f9jf07-e969f1-a245nk11-00jnfnafn9799fc2a",
"_usr_Accountreason_value#OData.Community.Display.V1.FormattedValue": "Customer Inactive",
"_usr_Accountreason_value": "bde1234522-d45662-e2711-a84561-0007354a2d5c2a",
"hfrd_Accountid": "89025sf3-c668f-e7811-a4331-00asdhh3ab9bd1c",
"usr_cancellationuser": "Testuser08 ABC",
"_usr_cancellationsource_value#OData.Community.Display.V1.FormattedValue": "MOBILE",
"_usr_cancellationsource_value": "6c23asdf-c562-e411-a841-00asdfa",
"hfrd_name": "FP-WK-1000000642"
}
]
}
I want to validate the bold row

GMB MyBusiness API - How to set up real-time PubSub notifications?

I am working on integrating GMB into some of our internal apps, and would like to set up to receive real-time notifications for reviews and questions.
I have created a topic, and a subscription with a valid URL.
The next step is to tell GMB to send the notifications to the topic, and I believe the endpoint is the one below. However, it is very vague about the parameters it wants.
This is the documentation
https://developers.google.com/my-business/reference/rest/v4/accounts/updateNotifications
It wants a "Notification Settings Resource Name" in the URL, but it's not explained anywhere what that actually is. I have tried every possible value, but always get a 404 error response with the message "Requested entity was not found."
Has anyone successfully set this up? What values does the "getNotifications" endpoint want, and where in the various dashboards can this be found or created?
Any help is much appreciated!
As mentioned in the comments, you need to send the accountId as part of the URL.
To find this, you will first need to send a GET request to
https://mybusiness.googleapis.com/v4/accounts
This will return something along the following lines:
{
"accounts": [
{
"name": "accounts/102647145453118950380",
"accountName": "Tom Spencer",
"type": "PERSONAL",
"state": {
"status": "UNVERIFIED",
"vettedStatus": "NOT_VETTED"
},
"profilePhotoUrl": "//lh3.googleusercontent.com/a-/AOh14GgPkuJj03DeCa1isBAJALY4eOl09WGYVFrM4mG5=s132"
},
]
}
You can see here that accounts/102647145453118950380 is returned in the name field. Take this field, and construct the following URL:
https://mybusiness.googleapis.com/v4/accounts/102647145453118950380/notifications
Send a PUT request to this URL, with a request body resembling the following:
{
"topicName": "projects/{projectId}/topics/{topicId}",
"notificationTypes": [
"NEW_REVIEW",
"UPDATED_REVIEW"
]
}
Assuming you have pub/sub setup as per the documentation, this should send a message to your topic/subscribers whenever a new review is created or a review is updated.

How to POST or PATCH users role and access_level for BIM360 on Postman

I have been successful in creating a new Account User from following this tutorial: https://forge.autodesk.com/en/docs/bim360/v1/reference/http/users-POST/#example, and have used the PATCH method to set their status to active on Postman.
I would like to set their role and access_level but I am having trouble doing so. I have followed the link below to try and perform this function, but it requires the user to already be a BIM 360 Project Admin for it to work.
https://forge.autodesk.com/en/docs/bim360/v1/reference/http/projects-project_id-users-user_id-PATCH/
I also tried following the next link below to add a User to a project, but I am getting errors that I am unsure how to fix.
https://forge.autodesk.com/en/docs/bim360/v1/reference/http/projects-project_id-users-import-POST/
URI: https://developer.api.autodesk.com/hq/v2/accounts/:account_id/projects/:project_id/users/import
Method: PATCH
Authorization: *******************************************
Content-Type: application/json
x-user-id: {{user_id}}
Body:
{
"email": "john.smith#mail.com",
"services": {
"document_management": {
"access_level": "account_admin"
}
},
"company_id": ************************************,
"industry_roles": [
************************************
]
}
(The id for industry_role is IT).
Error:
{
"code": 1004,
"message": "this user doesn't exist."
}
I am unsure how I am getting this error since the User Id used for x-user-id is the same user_id associated with the email given in the request body. Is there a way to fix this or another method I can use?
The x-user-id header is not for specifying the user to import but rather:
x-user-id
string
In a two-legged authentication context, the app has access to all users specified by the administrator in the SaaS integrations UI. By providing this header, the API call will be limited to act on behalf of only the user specified.
Remove this field if that's not what you intended.
Verify the user id and email match each other via /GET users and /GET users:userid.
And be sure to provide either the user's email or the user ID and don't provide them both:
Note that you need to specify either an email, or a user_id. However, you cannot specify both.
See doc here

Google Photos Library API IDs are invalid

Cached IDs of media items, albums and enrichment items stopped working.
For example, calling mediaItems.get with a media item ID that was stored returns the following error:
{
"error": {
"code": 400,
"message": "Invalid media item ID.",
"status": "INVALID_ARGUMENT"
}
}
The format of all IDs returned by the Google Photos Library API changed on September 5.
If you have stored IDs such as albums ids, media item ids, or enrichment item ids before 5th September 2018, these will no longer work as the format of the IDs has changed recently. Obtain new IDs for use in your application.
You can make a request again to retrieve the new IDs, for example by listing the library contents, albums or submitting another search request.
See the API release notes for more information

Receipt_id is null in Paypal response, How can I get it?

I have integrated Paypal with my rails application by activemerchant gem, As of now I'm getting token and payer_id, but I need receipt_id which is null in response.
I have followed steps given in this link.
Response of Paypal is given below
"timestamp"=>"2016-04-12T19:23:46Z", "ack"=>"Success",
"correlation_id"=>"000a000f000r", "version"=>"124", "build"=>"000000",
"token"=>"AB-000000000000000", "transaction_id"=>"kjKJKHkj09809FED2",
"parent_transaction_id"=>NULL, "receipt_id"=>NULL,
"transaction_type"=>"express-checkout", "payment_type"=>"instant",
"payment_date"=>"2016-04-12T19:23:46Z", "gross_amount"=>"160.00",
"gross_amount_currency_id"=>"USD", "fee_amount"=>"6.54",
"fee_amount_currency_id"=>"USD", "tax_amount"=>"0.00",
"tax_amount_currency_id"=>"USD", "exchange_rate"=>NULL,
"payment_status"=>"Completed", "pending_reason"=>"none",
"reason_code"=>"none", "protection_eligibility"=>"Eligible",
"protection_eligibility_type"=>"ItemNotReceivedEligible,UnauthorizedPaymentEligible",
"secure_merchant_account_id"=>"JHBJKJKJBKJBKJH",
"success_page_redirect_requested"=>"false",
"coupled_payment_info"=>NULL, "Token"=>"AB-000000000000000",
"PaymentInfo"=>"{"TransactionID"=>"kjKJKHkj09809FED2",
"ParentTransactionID"=>nil, "ReceiptID"=>nil,
"TransactionType"=>"express-checkout", "PaymentType"=>"instant",
"PaymentDate"=>"2016-04-12T19:23:46Z", "GrossAmount"=>"160.00",
"FeeAmount"=>"6.54", "TaxAmount"=>"0.00", "ExchangeRate"=>nil,
"PaymentStatus"=>"Completed", "PendingReason"=>"none",
"ReasonCode"=>"none", "ProtectionEligibility"=>"Eligible",
"ProtectionEligibilityType"=>"ItemNotReceivedEligible,UnauthorizedPaymentEligible",
"SellerDetails"=>{"SecureMerchantAccountID"=>"JHBJKJKJBKJBKJH"}}",
"SuccessPageRedirectRequested"=>"false", "CoupledPaymentInfo"=>NULL
Is there any configuration in Paypal account to get receipt_id, or any request parameter I have to add/change?
Please suggest.
Thanks in advance.
I have discussed this with paypal developer support and it seems like the transaction sale ID is the appropriate ID to record and return to the user, it is also what gets recorded in the paypal account for a credit card transaction so if a user had a support question, it is the easiest number to give to accounts to look up the transaction details.
I am not 100% sure about how to access what is called the receipt_id, but I don't think it is intended to be populated in the response to the payment endpoint. If you are to get a receipt_id at all, it will likely come from hitting the endpoint GET /v1/payments/sale/<Transaction-Id>
As per the api, receipt_id is defined as
Receipt id is 16 digit number payment identification number returned for guest users to identify the payment.
I think "guest users" may have a specific meaning that is not relevant to just any transaction but I'm not positive on this.
I would recommend playing around with this endpoint after you get the transaction ID from the payments endpoint. The id located in the json returned from the payments endpoint at payment.transactions[0].related_resources[0].sale.id seemed to be the appropriate ID to record for a simple credit card transaction where I wanted to return a reference number to the client and to store for looking up the transaction at a later date.
I also was able to use that ID to interrogate the sale endpoint mentioned above for more information, but I never was able to get receipt_id to populate for a sandbox operation.
Hope this helps, I find some of the documentation to be lacking for the REST api.
"transactions": [
{
"amount": {
"total": "7.47",
"currency": "USD",
"details": {
"tax": "0.03",
"shipping": "0.03"
}
},
"description": "This is the payment transaction description.",
"related_resources": [
{
"sale": {
"id": "4RR959492F879224U",
"create_time": "2013-01-31T04:12:02Z",
"update_time": "2013-01-31T04:12:04Z",