Send token via sms to a user with some options defined.
@param userId
@param options
@return Hash instance with API's response.
193324
public Hash requestSms(int userId, Map<String, String> options) {
		String url = "";
		
		try {
			url = URLEncoder.encode(Integer.toString(userId), ENCODE);
		}
		catch(Exception e) {
			e.printStackTrace();
		}
		
		MapToResponse opt = new MapToResponse(options);
		String content = this.get(SMS_PATH + url, opt);
		
		return instanceFromXml(this.getStatus(), content);
	}
933443
@SuppressWarnings("deprecation")
  private Credential newCredential(String userId) {
    Credential.Builder builder = new Credential.Builder(method).setTransport(transport)
        .setJsonFactory(jsonFactory)
        .setTokenServerEncodedUrl(tokenServerEncodedUrl)
        .setClientAuthentication(clientAuthentication)
        .setRequestInitializer(requestInitializer)
        .setClock(clock);
    if (credentialDataStore != null) {
      builder.addRefreshListener(
          new DataStoreCredentialRefreshListener(userId, credentialDataStore));
    } else if (credentialStore != null) {
      builder.addRefreshListener(new CredentialStoreRefreshListener(userId, credentialStore));
    }
    builder.getRefreshListeners().addAll(refreshListeners);
    return builder.build();
  }
699474
def get_access_token(options = {}, *arguments)
      response = consumer.token_request(consumer.http_method, (consumer.access_token_url? ? consumer.access_token_url : consumer.access_token_path), self, options, *arguments)
      OAuth::AccessToken.from_hash(consumer, response)
    end
141770
def post(options)
      payload = {
        username: @options['name'],
        channel:  @options['channel']
      }.merge(options)
      payload[:channel] = payload[:channel].gsub(/^#?/, '#') #slack api needs leading # on channel
      request = Net::HTTP::Post.new(@uri.request_uri)
      request.set_form_data(payload: payload.to_json)
      @http.request(request)
      return nil # so as not to trigger text in outgoing webhook reply
    end
775798
function(userId, extraData = {}) {
    if (!this.usingApiSecret || this.apiKey == null) {
      throw new errors.FeedError(
        'In order to create user tokens you need to initialize the API client with your API Secret',
      );
    }
    return signing.JWTUserSessionToken(this.apiSecret, userId, extraData, {
      noTimestamp: !this.expireTokens,
    });
  }
352730
function(userId) {
    return new Promise((resolve, reject) => {
      this._start()
          .uri('/api/user')
          .urlSegment(userId)
          .get()
          .go(this._responseHandler(resolve, reject));
    });
  }
1303993
public void setCredentials(String userid, String password) {
        Map<String, String> data = new HashMap<String, String>();
        data.put("userid", userid);
        data.put("password", password);
        RemotingHeader header = new RemotingHeader(RemotingHeader.CREDENTIALS, true, data);
        headers.put(RemotingHeader.CREDENTIALS, header);
    }
312033
@Override
    public String sendSMS(String CorpNum, String sender, String content,
                          Message[] Messages, Date reserveDT, Boolean adsYN, String UserID, String requestNum)
            throws PopbillException {
        return sendMessage(MessageType.SMS, CorpNum, sender, null, null, content,
                Messages, reserveDT, adsYN, UserID, requestNum);
    }
221113
function createToken(username, done) {
  return getUser(username, function(getUserErr, user) {
    if (getUserErr) {
      return done(getUserErr);
    }

    if (!user) {
      return done(new Error(`user '${username}' not found`));
    }

    const token = uuid.v4();

    return hashToken(token, function(cryptErr, hash) {
      if (cryptErr) {
        return done(cryptErr);
      }

      return getModels(function(m) {
        m.collections.token.create({
          uuid: hash,
          owner: user.id,
        }, function(createTokenErr) {
          if (createTokenErr) {
            return done(createTokenErr);
          }

          return done(null, token);
        }); // m.collections.token.create
      }); // getModels
    }); // hashToken
  }); // getUser
}
126147
def send_sms(self, text, **kw):
        

        params = {
            'user': self._user,
            'pass': self._passwd,
            'msg': text
        }

        kw.setdefault("verify", False)

        if not kw["verify"]:
            # remove SSL warning
            requests.packages.urllib3.disable_warnings(InsecureRequestWarning)

        res = requests.get(FreeClient.BASE_URL, params=params, **kw)
        return FreeResponse(res.status_code)
613731
function sendText(payload: {
  to: string,
  from: string,
  message: string,
  statusCallback: string,
}): Promise<null | TwilioResponse> {
  if (!(process.env.TWILIO_ACCOUNT_SID && process.env.TWILIO_AUTH_TOKEN)) {
    logErr(
      new Error(
        "Could not send text message, missing required Twilio env vars"
      ),
      { payload }
    );
    return Promise.resolve(null);
  } else if (!Twilio) {
    Twilio = require("twilio");
  }

  return new Twilio(
    process.env.TWILIO_ACCOUNT_SID,
    process.env.TWILIO_AUTH_TOKEN
  ).messages.create({
    to: `+1${payload.to}`,
    from: `+1${payload.from}`,
    body: payload.message,
    statusCallback: payload.statusCallback,
  });
}
98800
@CommandArgument
  public void passwd(
      @OptionArgument("username") String username,
      @OptionArgument("password") String password) {

    User user = users.get(username);

    if (user != null) {
      user.salt = passwd.generateSalt();
      user.hash = passwd.getEncryptedPassword(password, user.salt);
    } else {
      System.err.println(String.format("User '%s' does not exist", username));
    }

  }
452326
def send_message(self, chat_id, text, **options):
        
        return self.api_call("sendMessage", chat_id=chat_id, text=text, **options)
693748
protected function setOptions($options = null)
    {
        if ($options instanceof TokenInterface) {
            $this->_owner = UserSecurityIdentity::fromToken($options);
        }

        return $this;
    }
755693
public function sendPasswordResetToken(EntityInterface $user, $options = []) {
		$options = Hash::merge($this->_config['sendPasswordResetToken'], $options);
		$this->getMailer($this->getConfig('mailer'))
			->send('passwordResetToken', [$user, $options]);
	}
1187560
public GetQYUserInviteResponse invite(String userid){
        BeanUtil.requireNonNull(userid, "userid is null");
        GetQYUserInviteResponse response;
        String url = BASE_API_URL + "cgi-bin/invite/send?access_token=#";
        final Map<String, String> params = new HashMap<String, String>();
        params.put("userid", userid);
        BaseResponse r = executePost(url, JSONUtil.toJson(params));
        String resultJson = isSuccess(r.getErrcode()) ? r.getErrmsg() : r.toJsonString();
        response = JSONUtil.toBean(resultJson, GetQYUserInviteResponse.class);
        return response;
    }
501458
function Sms(opts) {

  if (!(this instanceof Sms)) {
    return new Sms(opts);
  }

  // Ensure opts is an object
  opts = opts || {};
  
  // API user 
  this.user = opts.user || null;
  
  // API password
  this.pass = opts.pass || null;
  
  // Message
  this.message = opts.message || null;    
}