List all applications under a specific job - upwork-api

I'm trying to List all applications that is under a specific job using upwork API ..
applications that should return, contain the freelancers who I've sent invitation to, and the accepted the invitation but they aren't hired yet.
So i tried to use List job applications as client giving it the access_token, buyer_team_ref, job_key , but all i get is this weird response
"data": {
"paging": {
"offset": "0",
"count": "0",
"total": "0"
},
"scrolling": "",
"applications": []
}
}
that no applications is found in the applications [], while in my job at the website, i got applications, i got people who i hired them already and i can see them if i used List engagements. but for applications i can't see them.
So i was wondering if i'm using the wrong API, or there is another way to retrieve them, or something wrong with the API itself :D ??

If the people already hired, they are on a contract. Thus, List engagements is the right API. If you need more details about the difference between applications and contracts (engagements), feel free to contact our Support Team (https://support.upwork.com/)

Related

Why does it turn into an unavailable room when I create a google resource calendar with its API?

I'm going to create a google resource calendar room via its API (i.e. https://admin.googleapis.com/admin/directory/v1/customer/my_customer/resources/calendars). But the problem is, when I create one, it turns into an unavailable (crossed out) room within google calendar rooms and I couldn't find any attribute to make it available!
Here's the body request/response:
{
"kind": "admin#directory#resources#calendars#CalendarResource",
"etags": "\"CTyc505ppdmJR2motHVsU17kzItOkPo5vYViqlSF0rU/FB0b765ZgWIpTBaxn5YQIwZWWNM\"",
"resourceId": "9f698cdc-84f9-4688-95a7-c2207b4fa7ae",
"resourceName": "StackOverflow Test",
"generatedResourceName": "Orangery Hildesheim Nordstadt-EG-StackOverflow Test (3)",
"resourceEmail": "c_1881d77mmcaqsihgi426fseae6vnc#resource.calendar.google.com",
"capacity": 3,
"buildingId": "Orangery-Hildesheim-Nordstadt",
"floorName": "EG",
"resourceCategory": "CONFERENCE_ROOM"
}
Here's the output on google calendar:
After two months finally I found a solution!
In fact, the main problem is related to the lack of permission for those created resources for other users in the organization. To tackle this problem I used another google API named ACL (Access Control Level) ref, to set a privilege for other users. Basically, a google resource actually is a google resource calendar, so you can use ACL API to access that calendar. Moreover, the parameter to reach that calendar is resourceEmail as the unique ID of the respective resource calendar.
Here's the thing I did to make unavailable resources to be available (bookable):
POST https://www.googleapis.com/calendar/v3/calendars/calendarId/acl
change calendarId with the value of resourceEmail of the google resource.
the body of the request:
{
"scope": {
"type": "domain",
"value": "orangery.io" # if you selected type as `domain` you should write your domain name here.
},
"role": "writer"
}
[NOTE]:
With this procedure, you will need to the https://www.googleapis.com/auth/calendar authorization scope as well.

How can I turn my bot into a MS Teams app

I made a normal bot by using Microsoft Bot Framework and has deployed it to the Azure portal.
How can I possibly make it a Teams app other than channeling to Teams, for example, make it a Teams app package.
I checked some sample code on Github and noticed that general bots are a bit different from Teams bots, for example, general bots extend ActivityHandler but Teams bots extend TeamsActivityHandler. May I ask how can I turn my bot into a Teams app? Do I need to alter the code of the bot I made a lot?
Thanks
With a few exceptions, you don't really need to make changes to your bot code to deploy to Teams channel. However, I do think there are a few things you should be aware of and consider in your development. First of all, I'm going to assume you have or know how to turn on the channel from the Bot Service. Once you have done that, you can test your bot in Teams without even creating a Teams app by pasting the Microsoft App ID into the chat To: field (obviously it's not recommended to share this ID for general testing).
The main change you probably need is to remove mentions. These will mess with QnA Maker and/or LUIS as they are included in the query string. I have been doing this as the first step in the onMessage handler. My current bots use regex for this, e.g.
if (context._activity.text) ( // Make sure there is activity text before trying to replace
context._activity.text = context._activity.text.replace(/(#|<at>)((Bot Name)|(Teams App Manifest Name))(<\/at>)? ?/g, '');
}
However, I have also seen that the TurnContext object can do this via TurnContext.removeRecipientMention(context.activity); I've not actually tried that myself, though. If it works it would be very helpful in case you find yourself changing bot names as I have done in the past...
The other main change I made to my bots was creating Teams-specific adaptive cards with menu buttons. By default, Action.Submit will work for web channels but NOT Teams channel. A typical action would look like
{
"type": "ActionSet",
"actions": [
{
"type": "Action.Submit",
"title": "Get Order Status",
"data": "Get Order Status"
}
]
}
But Teams can't handle this and will error out on button click (at least when using standard Activity handler, not sure if it is the same if using TeamsActivityHandler.) Instead, you should check the channel before displaying cards with Action.Submit actions and display an alternative card instead. For example
if (context.activity.channelId == 'msteams') {
var welcomeCard = CardHelper.GetMenuCardTeams(welcomeMessage,'Y','Y');
} else {
var welcomeCard = CardHelper.GetMenuCard(welcomeMessage,'Y','Y');
}
And then your actions for Teams instead look like
{
"type": "ActionSet",
"actions": [
{
"type": "Action.Submit",
"title": "Get Order Status",
"data": {
"msteams": {
"type": "imBack",
"value": "Get Order Status"
}
}
}
]
}
I've tried combining these and it doesn't work well. You can add something to your handler to make Teams cards work in web, but the text will not be inserted into the chat like a typical button and it will instead be essentially like a backchannel event. I like this method much better.
Other than that you should be able to run your bot as-is, except for attachments as noted in your separate question. I have not gotten that to work and I believe it may be related to not using TeamsActivityHandler but I'm not sure.
Hopefully this helps. Go ahead and give it a try and you can create a new issue with any specific problems you face once the bot is operating in Teams.

Unable to assign LUIS az accounts to LUIS apps via REST

The luis resources that I created aren't showing up in the Luis portal (posted a question here) so decided to use the REST APIs to configure things manually. With the REST endpoints I was able to import apps. However, I wasn't able to add LU resource to the imported apps despite that the APIs return success.
Below is the call.
POST https://westus.api.cognitive.microsoft.com/luis/api/v2.0/apps/<appid>/azureaccounts
{
"azureSubscriptionId": "<id>",
"resourceGroup": "<rg name>",
"accountName": "<resource name>"
}
returns 201 CREATED
{
"code": "Success",
"message": "Operation Successful"
}
However, a subsequent GET call returns empty result.
GET https://westus.api.cognitive.microsoft.com/luis/api/v2.0/apps/<appid>/azureaccounts
tried the GET call a couple hours after and it is still returning empty result. What is going on?
It sounds like there's something wrong with your azure account and/or your luis.ai account. There are two places to raise support requests to handle these types of matters. First is uservoice on LUIS.ai:
While issues raised here are typically routed back to the bot framework support team, once there, they can be escalated.
Secondly, you can raise the issue in Azure:
You can follow this link HERE to get to that blade quickly.

How can I get the user's first and last name by his gmail?

I am developing an application to work admin.google.com. In my application through Google_Service_Directory I got a users. But I can not understand who it is - I see only gmail. I want by gmail to get the name and surname. How can I do it?
On the Internet, I found answers to the Google Plus library. But Google Plus is closing. What are some other ways to get your first and last name by gmail?
You have a few options and they will give you similar information.
people get Google+ api.
Request:
GET https://www.googleapis.com/plus/v1/people/me
response: people.resource
"objectType": "person",
"id": "11720047553265346",
"displayName": "Linda Lawton",
"name": {
"familyName": "Lawton",
"givenName": "Linda"
Note: this call appears on the Google+ api documentation how ever this end point is not being shutdown. (waiting for feed back from google on if this is shut down or not.)
Userinfo endpoint
The second option is to call the identity server directly to the userinfo endpoint as described in OpenIDConnect requires profile scope i think
people.get people api
people.get from the people api
request
GET https://people.googleapis.com/v1/people/me?personfield=names
response
"displayName": "Linda Lawton",
"familyName": "Lawton",
"givenName": "Linda",
"displayNameLastFirst": "Lawton, Linda"
Cant search on email
Note: This will give you the information on the current logged in user. There is no way to get back the name of a persona directly by their email address. Assuming you are running an service account with domain wide delegation you may be able to use people.get with the user id of one of the users on the domain. I have not tried this

Zoho API: Get the user that is making the request

I have seen Zoho APIs give us the option to get all kinds of user information, yet I cannot find any method to fetch info about the user that is currently making the request.
OAuth2 secured API's usually offer such an endpoint, like Google or Twitter do.
In their documentation there is something that looks like it:
https://www.zohoapis.com/crm/v2/users?type=CurrentUser
But then they shatter any hope with their explanation:
CurrentUser - To get the list of current CRM users
Is there any known way achieve this?
This is the right endpoint: https://accounts.zoho.com/oauth/user/info
It requires the aaaserver.profile.READ scope.
Example Response:
{
"ZUID": 123123123123,
"First_Name": "Example",
"Last_Name": "Name",
"Display_Name": "Example Name",
"Email": "example#email.com"
}
I have tested this personally and can confirm that the text on their docs is wrong.
They say:
CurrentUser - To get the list of current CRM users
But in reality, that endpoint really does return a single user everytime, the user to whom the oauth token belongs. So it's not returning "a list of current CRM users", but rather "the currently logged in user" - exactly as you desire.
So your gut was right, and that endpoint will achieve what you are trying to do.

Resources